@@ -125,8 +125,8 @@ namespace RTEGUI {
125
125
m_RightColumn->SetDrawColor (makecol (23 , 23 , 23 ));
126
126
m_RightColumn->SetDrawType (GUICollectionBox::Color);
127
127
128
- m_ActiveCollectionBoxList.reset (dynamic_cast <GUIListBox *>(m_EditorManager->AddControl (" ActiveCollectionBoxes" , " LISTBOX" , m_RightColumn.get (), 15 , 5 , 270 , 200 )));
129
- m_ControlsInActiveCollectionBoxList.reset (dynamic_cast <GUIListBox *>(m_EditorManager->AddControl (" ControlsInActiveCollectionBox" , " LISTBOX" , m_RightColumn.get (), 15 , m_ActiveCollectionBoxList->GetRelYPos () + 210 , 270 , 380 )));
128
+ m_ActiveCollectionBoxList.reset (dynamic_cast <GUIListBox *>(m_EditorManager->AddControl (" ActiveCollectionBoxes" , " LISTBOX" , m_RightColumn.get (), 15 , 5 , 270 , 230 )));
129
+ m_ControlsInActiveCollectionBoxList.reset (dynamic_cast <GUIListBox *>(m_EditorManager->AddControl (" ControlsInActiveCollectionBox" , " LISTBOX" , m_RightColumn.get (), 15 , m_ActiveCollectionBoxList->GetRelYPos () + 240 , 270 , 350 )));
130
130
131
131
// Add an area showing the editing box
132
132
GUICollectionBox *workspace = dynamic_cast <GUICollectionBox *>(m_EditorManager->AddControl (" Workspace" , " COLLECTIONBOX" , m_EditorBase.get (), m_WorkspacePosX, m_WorkspacePosY, m_WorkspaceWidth, m_WorkspaceHeight));
@@ -211,7 +211,19 @@ namespace RTEGUI {
211
211
212
212
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
213
213
214
- void GUIEditorApp::PopulateActiveBoxList () const {
214
+ void GUIEditorApp::AddItemToActiveCollectionBoxList (GUIControl *control, const std::string &indent) const {
215
+ m_ActiveCollectionBoxList->AddItem (indent + control->GetName ());
216
+
217
+ for (GUIControl *childControl : *control->GetChildren ()) {
218
+ if ((control = dynamic_cast <GUICollectionBox *>(childControl))) {
219
+ AddItemToActiveCollectionBoxList (control, indent + " \t " );
220
+ }
221
+ }
222
+ }
223
+
224
+ // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
225
+
226
+ void GUIEditorApp::PopulateActiveCollectionBoxList () const {
215
227
m_ActiveCollectionBoxList->ClearList ();
216
228
GUICollectionBox *collectionBox = nullptr ;
217
229
@@ -220,6 +232,12 @@ namespace RTEGUI {
220
232
// Look for CollectionBoxes with the root control as parent
221
233
if ((collectionBox = dynamic_cast <GUICollectionBox *>(control)) && collectionBox->GetParent () == m_RootControl) {
222
234
m_ActiveCollectionBoxList->AddItem (collectionBox->GetName ());
235
+
236
+ for (GUIControl *childControl : *collectionBox->GetChildren ()) {
237
+ if ((collectionBox = dynamic_cast <GUICollectionBox *>(childControl))) {
238
+ AddItemToActiveCollectionBoxList (collectionBox, " \t " );
239
+ }
240
+ }
223
241
// Check if this is selected in the editor, and if so, select it in the list too
224
242
if (m_SelectionInfo.Control == collectionBox) {
225
243
m_ActiveCollectionBoxList->SetSelectedIndex (m_ActiveCollectionBoxList->GetItemList ()->size () - 1 );
@@ -409,7 +427,7 @@ namespace RTEGUI {
409
427
410
428
if (parent) { m_ControlManager->AddControl (name, controlClass, parent, 0 , 0 , -1 , -1 ); }
411
429
412
- PopulateActiveBoxList ();
430
+ PopulateActiveCollectionBoxList ();
413
431
}
414
432
415
433
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -734,7 +752,7 @@ namespace RTEGUI {
734
752
m_PropertyPage->ClearValues ();
735
753
m_UnsavedChanges = false ;
736
754
737
- PopulateActiveBoxList ();
755
+ PopulateActiveCollectionBoxList ();
738
756
}
739
757
}
740
758
0 commit comments