@@ -196,12 +196,16 @@ namespace RTEGUI {
196
196
m_SelectionInfo.GrabbedControl = false ;
197
197
m_SelectionInfo.GrabbedHandle = false ;
198
198
m_SelectionInfo.Control = boxControl;
199
+
200
+ PopulateControlsInActiveCollectionBoxList (dynamic_cast <GUICollectionBox *>(boxControl));
199
201
}
200
202
} else {
201
203
// Deselection if clicked on no list item
202
204
m_SelectionInfo.GrabbedControl = false ;
203
205
m_SelectionInfo.GrabbedHandle = false ;
204
206
m_SelectionInfo.Control = nullptr ;
207
+
208
+ m_ControlsInActiveCollectionBoxList->ClearList ();
205
209
}
206
210
}
207
211
@@ -217,11 +221,27 @@ namespace RTEGUI {
217
221
if ((collectionBox = dynamic_cast <GUICollectionBox *>(control)) && collectionBox->GetParent () == m_RootControl) {
218
222
m_ActiveCollectionBoxList->AddItem (collectionBox->GetName ());
219
223
// Check if this is selected in the editor, and if so, select it in the list too
220
- if (collectionBox == m_SelectionInfo.Control ) { m_ActiveCollectionBoxList->SetSelectedIndex (m_ActiveCollectionBoxList->GetItemList ()->size () - 1 ); }
224
+ if (m_SelectionInfo.Control == collectionBox) {
225
+ m_ActiveCollectionBoxList->SetSelectedIndex (m_ActiveCollectionBoxList->GetItemList ()->size () - 1 );
226
+ PopulateControlsInActiveCollectionBoxList (collectionBox);
227
+ }
221
228
}
222
229
}
223
230
}
224
231
232
+ // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
233
+
234
+ void GUIEditorApp::PopulateControlsInActiveCollectionBoxList (GUICollectionBox *collectionBox) const {
235
+ m_ControlsInActiveCollectionBoxList->ClearList ();
236
+
237
+ // Go through all the top-level (directly under root) controls and add only the CollectionBoxes to the list here
238
+ for (GUIControl *control : *collectionBox->GetChildren ()) {
239
+ m_ControlsInActiveCollectionBoxList->AddItem (control->GetName ());
240
+ // Check if this is selected in the editor, and if so, select it in the list too
241
+ if (collectionBox == m_SelectionInfo.Control ) { m_ControlsInActiveCollectionBoxList->SetSelectedIndex (m_ActiveCollectionBoxList->GetItemList ()->size () - 1 ); }
242
+ }
243
+ }
244
+
225
245
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
226
246
227
247
GUIControl * GUIEditorApp::ControlUnderMouse (GUIControl *parent, int mousePosX, int mousePosY) {
0 commit comments