@@ -140,80 +140,6 @@ namespace RTEGUI {
140
140
m_RootControl = rootBox;
141
141
}
142
142
143
- // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
144
-
145
- void GUIEditorApp::UpdateGridSize (GUIEvent &editorEvent) {
146
- std::string newValue = dynamic_cast <GUITextBox *>(editorEvent.GetControl ())->GetText ();
147
- if (newValue.empty ()) { newValue = " 1" ; }
148
-
149
- bool validEntry = true ;
150
- for (const char &stringChar : newValue) {
151
- if (!std::isdigit (stringChar)) {
152
- validEntry = false ;
153
- break ;
154
- }
155
- }
156
- m_GridSize = validEntry ? std::clamp (std::stoi (newValue), 0 , 255 ) : m_GridSize;
157
- dynamic_cast <GUITextBox *>(editorEvent.GetControl ())->SetText (std::to_string (m_GridSize));
158
-
159
- m_EditorBase->SetFocus ();
160
- }
161
-
162
- // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
163
-
164
- void GUIEditorApp::UpdatePropertyPage (GUIEvent &editorEvent) {
165
- if (editorEvent.GetMsg () == GUIPropertyPage::Enter) {
166
- // Update the focused control properties
167
- GUIControl *control = m_SelectionInfo.Control ;
168
- if (control) { control->ApplyProperties (m_PropertyPage->GetPropertyValues ()); }
169
- m_UnsavedChanges = true ;
170
- m_EditorBase->SetFocus ();
171
- }
172
- if (editorEvent.GetMsg () == GUIPropertyPage::Changed) {
173
- // The properties are dirty and need to be updated
174
- m_UnsavedChanges = true ;
175
- }
176
- }
177
-
178
- // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
179
-
180
- void GUIEditorApp::UpdateControlProperties (GUIControl *control, bool setUnsavedChanges) {
181
- control->StoreProperties ();
182
-
183
- GUIProperties properties;
184
- properties.Update (control->GetProperties (), true );
185
- control->GetPanel ()->BuildProperties (&properties);
186
- m_PropertyPage->SetPropertyValues (&properties);
187
-
188
- if (setUnsavedChanges) { m_UnsavedChanges = true ; }
189
- }
190
-
191
- // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
192
-
193
- void GUIEditorApp::UpdateCollectionBoxList () {
194
- const GUIListPanel::Item *item = m_CollectionBoxList->GetSelected ();
195
-
196
- if (item) {
197
- // Try to find the box of that name, and select it
198
- GUIControl *boxControl = m_ControlManager->GetControl (item->m_Name .substr (item->m_Name .find_first_not_of (' \t ' ), std::string::npos));
199
- if (boxControl) {
200
- m_SelectionInfo.GrabbedControl = false ;
201
- m_SelectionInfo.GrabbedHandle = false ;
202
- m_SelectionInfo.Control = boxControl;
203
-
204
- PopulateCollectionBoxChildrenList (dynamic_cast <GUICollectionBox *>(boxControl));
205
- }
206
- } else {
207
- // Deselection if clicked on no list item
208
- m_SelectionInfo.GrabbedControl = false ;
209
- m_SelectionInfo.GrabbedHandle = false ;
210
- m_SelectionInfo.Control = nullptr ;
211
-
212
- m_ControlsInActiveCollectionBoxList->ClearList ();
213
- }
214
- m_EditorBase->SetFocus ();
215
- }
216
-
217
143
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
218
144
219
145
void GUIEditorApp::SelectActiveControlInList () const {
@@ -479,6 +405,80 @@ namespace RTEGUI {
479
405
return controlType;
480
406
}
481
407
408
+ // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
409
+
410
+ void GUIEditorApp::UpdateCollectionBoxList () {
411
+ const GUIListPanel::Item *item = m_CollectionBoxList->GetSelected ();
412
+
413
+ if (item) {
414
+ // Try to find the box of that name, and select it
415
+ GUIControl *boxControl = m_ControlManager->GetControl (item->m_Name .substr (item->m_Name .find_first_not_of (' \t ' ), std::string::npos));
416
+ if (boxControl) {
417
+ m_SelectionInfo.GrabbedControl = false ;
418
+ m_SelectionInfo.GrabbedHandle = false ;
419
+ m_SelectionInfo.Control = boxControl;
420
+
421
+ PopulateCollectionBoxChildrenList (dynamic_cast <GUICollectionBox *>(boxControl));
422
+ }
423
+ } else {
424
+ // Deselection if clicked on no list item
425
+ m_SelectionInfo.GrabbedControl = false ;
426
+ m_SelectionInfo.GrabbedHandle = false ;
427
+ m_SelectionInfo.Control = nullptr ;
428
+
429
+ m_ControlsInActiveCollectionBoxList->ClearList ();
430
+ }
431
+ m_EditorBase->SetFocus ();
432
+ }
433
+
434
+ // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
435
+
436
+ void GUIEditorApp::UpdateGridSize (GUIEvent &editorEvent) {
437
+ std::string newValue = dynamic_cast <GUITextBox *>(editorEvent.GetControl ())->GetText ();
438
+ if (newValue.empty ()) { newValue = " 1" ; }
439
+
440
+ bool validEntry = true ;
441
+ for (const char &stringChar : newValue) {
442
+ if (!std::isdigit (stringChar)) {
443
+ validEntry = false ;
444
+ break ;
445
+ }
446
+ }
447
+ m_GridSize = validEntry ? std::clamp (std::stoi (newValue), 0 , 255 ) : m_GridSize;
448
+ dynamic_cast <GUITextBox *>(editorEvent.GetControl ())->SetText (std::to_string (m_GridSize));
449
+
450
+ m_EditorBase->SetFocus ();
451
+ }
452
+
453
+ // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
454
+
455
+ void GUIEditorApp::UpdateControlProperties (GUIControl *control, bool setUnsavedChanges) {
456
+ control->StoreProperties ();
457
+
458
+ GUIProperties properties;
459
+ properties.Update (control->GetProperties (), true );
460
+ control->GetPanel ()->BuildProperties (&properties);
461
+ m_PropertyPage->SetPropertyValues (&properties);
462
+
463
+ if (setUnsavedChanges) { m_UnsavedChanges = true ; }
464
+ }
465
+
466
+ // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
467
+
468
+ void GUIEditorApp::UpdatePropertyPage (GUIEvent &editorEvent) {
469
+ if (editorEvent.GetMsg () == GUIPropertyPage::Enter) {
470
+ // Update the focused control properties
471
+ GUIControl *control = m_SelectionInfo.Control ;
472
+ if (control) { control->ApplyProperties (m_PropertyPage->GetPropertyValues ()); }
473
+ m_UnsavedChanges = true ;
474
+ m_EditorBase->SetFocus ();
475
+ }
476
+ if (editorEvent.GetMsg () == GUIPropertyPage::Changed) {
477
+ // The properties are dirty and need to be updated
478
+ m_UnsavedChanges = true ;
479
+ }
480
+ }
481
+
482
482
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
483
483
484
484
bool GUIEditorApp::Update () {
0 commit comments