Skip to content

Commit 8336982

Browse files
committed
Get mouse wheel scrolling working for lists
1 parent d240a4a commit 8336982

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Editor/EditorApp.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ namespace RTEGUI {
100100
}
101101
}
102102
}
103+
104+
if (mouse_z != 0) {
105+
if (m_EditorManager->GetControlManager()->GetControlUnderPoint(mousePosX, mousePosY, m_EditorManager->GetControlManager()->GetControl("CollectionBoxList"))) {
106+
dynamic_cast<GUIListPanel *>(m_EditorManager->GetControlManager()->GetControl("CollectionBoxList"))->OnMouseWheelChange(mousePosX, mousePosY, 0, mouse_z);
107+
} else if (m_EditorManager->GetControlManager()->GetControlUnderPoint(mousePosX, mousePosY, m_EditorManager->GetControlManager()->GetControl("ControlsInCollectionBoxList"))) {
108+
dynamic_cast<GUIListPanel *>(m_EditorManager->GetControlManager()->GetControl("ControlsInCollectionBoxList"))->OnMouseWheelChange(mousePosX, mousePosY, 0, mouse_z);
109+
}
110+
position_mouse_z(0);
111+
}
103112
}
104113

105114
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Editor/EditorManager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ namespace RTEGUI {
113113
GUILabel *collectionBoxListLabel = dynamic_cast<GUILabel *>(m_EditorControlManager->AddControl("CollectionBoxListLabel", "LABEL", listsPanel, 10, 5, 100, 20));
114114
collectionBoxListLabel->SetText("Active Containers :");
115115
m_CollectionBoxList.reset(dynamic_cast<GUIListBox *>(m_EditorControlManager->AddControl("CollectionBoxList", "LISTBOX", listsPanel, 5, collectionBoxListLabel->GetHeight() + 5, 260, 230)));
116+
m_CollectionBoxList->SetMouseScrolling(true);
116117

117118
GUILabel *controlsInCollectionBoxListLabel = dynamic_cast<GUILabel *>(m_EditorControlManager->AddControl("ControlsInCollectionBoxListLabel", "LABEL", listsPanel, 10, collectionBoxListLabel->GetHeight() + m_CollectionBoxList->GetHeight() + 10, 110, 20));
118119
controlsInCollectionBoxListLabel->SetText("Container Elements :");
119120
m_ControlsInCollectionBoxList.reset(dynamic_cast<GUIListBox *>(m_EditorControlManager->AddControl("ControlsInCollectionBoxList", "LISTBOX", listsPanel, 5, controlsInCollectionBoxListLabel->GetHeight() + m_CollectionBoxList->GetRelYPos() + 235, 260, 305)));
121+
m_ControlsInCollectionBoxList->SetMouseScrolling(true);
120122

121123
// Create the workspace area showing the editing box
122124
GUICollectionBox *workspace = dynamic_cast<GUICollectionBox *>(m_EditorControlManager->AddControl("Workspace", "COLLECTIONBOX", m_EditorBase.get(), m_WorkspacePosX, m_WorkspacePosY, m_WorkspaceWidth, m_WorkspaceHeight));

0 commit comments

Comments
 (0)