Ember
Loading...
Searching...
No Matches
PreferencesDialog.cpp
Go to the documentation of this file.
2#include "App/MainFrame.h"
6#include "Utils/Logger.h"
7#include <cmath>
8#include <functional>
9#include <wx/sizer.h>
10#include <wx/statbox.h>
11#include <wx/statline.h>
12#include <wx/stattext.h>
13
15 EVT_TREE_SEL_CHANGED(ID_SECTION_TREE, PreferencesDialog::OnSectionSelected)
16 EVT_BUTTON(wxID_OK, PreferencesDialog::OnOK) EVT_BUTTON(wxID_CANCEL, PreferencesDialog::OnCancel)
17 EVT_BUTTON(ID_APPLY, PreferencesDialog::OnApply)
18 EVT_BUTTON(ID_RESTORE_DEFAULTS, PreferencesDialog::OnRestoreDefaults)
19 EVT_BUTTON(ID_CONFIGURE_PARSER, PreferencesDialog::OnConfigureParser)
20 EVT_SLIDER(ID_DEFAULT_ZOOM, PreferencesDialog::OnZoomSliderChanged) // Update zoom label
21 EVT_SLIDER(ID_ZOOM_STEP_SIZE, PreferencesDialog::OnZoomSliderChanged) // Update zoom step label
22 EVT_SLIDER(ID_SELECTED_NODE_BG_TINT, PreferencesDialog::OnZoomSliderChanged) // Update tint label
23 EVT_SLIDER(ID_HOVERED_NODE_BG_TINT, PreferencesDialog::OnZoomSliderChanged) // Update tint label
24 EVT_SLIDER(ID_MOUSE_WHEEL_SENSITIVITY,
25 PreferencesDialog::OnMouseWheelSensitivityChanged) // Update sensitivity label
26 EVT_SLIDER(ID_PAN_SENSITIVITY, PreferencesDialog::OnPanSensitivityChanged) // Update pan sensitivity label
27 EVT_SLIDER(ID_PAN_SMOOTHNESS, PreferencesDialog::OnPanSmoothnessChanged) // Update pan smoothness label
28 EVT_SLIDER(ID_PAN_STEP_SIZE, PreferencesDialog::OnPanStepSizeChanged) // Update pan step size label
29 EVT_CHECKBOX(ID_MAX_WINDOW_UNLIMITED,
30 PreferencesDialog::OnMaxWindowUnlimitedChanged) // Enable/disable max size controls
31 EVT_CHECKBOX(ID_MAX_SCENES_UNLIMITED,
32 PreferencesDialog::OnMaxScenesUnlimitedChanged) // Enable/disable max scenes control
33 EVT_CHECKBOX(ID_BOTTOM_PANEL_HEIGHT_ENABLED, PreferencesDialog::OnBottomPanelHeightEnabledChanged)
34 EVT_CHECKBOX(ID_BOTTOM_PANEL_MIN_HEIGHT_ENABLED, PreferencesDialog::OnBottomPanelMinHeightEnabledChanged)
35 EVT_CHECKBOX(ID_LEFT_PANEL_WIDTH_ENABLED, PreferencesDialog::OnLeftPanelWidthEnabledChanged)
36 EVT_CHECKBOX(ID_LEFT_PANEL_MIN_WIDTH_ENABLED, PreferencesDialog::OnLeftPanelMinWidthEnabledChanged)
37 EVT_CHECKBOX(ID_RIGHT_PANEL_WIDTH_ENABLED, PreferencesDialog::OnRightPanelWidthEnabledChanged)
38 EVT_CHECKBOX(ID_RIGHT_PANEL_MIN_WIDTH_ENABLED,
39 PreferencesDialog::OnRightPanelMinWidthEnabledChanged) wxEND_EVENT_TABLE()
40
41 // Custom tree item data to store panel pointer
42 class SectionTreeItemData : public wxTreeItemData {
43 public:
44 SectionTreeItemData(wxPanel *panel) : m_panel(panel) {}
45 wxPanel *GetPanel() const { return m_panel; }
46
47 private:
48 wxPanel *m_panel;
49};
50
52 : wxDialog(parent, wxID_ANY, "EmberForge Preferences", wxDefaultPosition, wxSize(1600, 1000),
53 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
54 m_splitter(nullptr), m_sectionTree(nullptr), m_settingsPanel(nullptr), m_windowPanel(nullptr),
55 m_mainPanelPanel(nullptr), m_behaviorTreeViewPanel(nullptr), m_bottomPanelPanel(nullptr),
56 m_fileExplorerPanel(nullptr), m_sidePanelPanel(nullptr), m_parserPanel(nullptr), m_panUpHotkeyTextCtrl(nullptr),
57 m_panUpHotkeyCaptureButton(nullptr), m_panDownHotkeyTextCtrl(nullptr), m_panDownHotkeyCaptureButton(nullptr),
58 m_panLeftHotkeyTextCtrl(nullptr), m_panLeftHotkeyCaptureButton(nullptr), m_panRightHotkeyTextCtrl(nullptr),
59 m_panRightHotkeyCaptureButton(nullptr),
60 // Initialize debug text controls to nullptr (order must match declaration)
61 m_showCoordinateInfo(nullptr), m_coordinateInfoFontSize(nullptr), m_coordinateInfoColorPicker(nullptr),
62 m_coordinateInfoAnchor(nullptr), m_coordinateInfoX(nullptr), m_coordinateInfoY(nullptr),
63 m_showSelectedNodeInfo(nullptr), m_selectedNodeInfoFontSize(nullptr), m_selectedNodeDebugInfoColorPicker(nullptr),
64 m_selectedNodeInfoAnchor(nullptr), m_selectedNodeInfoX(nullptr), m_selectedNodeInfoY(nullptr),
65 m_showTreeInfo(nullptr), m_treeInfoFontSize(nullptr), m_treeInfoColorPicker(nullptr), m_treeInfoAnchor(nullptr),
66 m_treeInfoX(nullptr), m_treeInfoY(nullptr), m_showControlsHelp(nullptr), m_controlsHelpFontSize(nullptr),
67 m_controlsHelpColorPicker(nullptr), m_controlsHelpAnchor(nullptr), m_controlsHelpX(nullptr),
68 m_controlsHelpY(nullptr), m_capturingTextCtrl(nullptr) {
69 SetMinSize(wxSize(1400, 900));
70 CreateLayout();
71 LoadCurrentSettings();
72
73 // Bind dialog-level mouse events for capturing mouse buttons anywhere in the dialog
74 Bind(wxEVT_LEFT_DOWN, &PreferencesDialog::OnDialogMouseDown, this);
75 Bind(wxEVT_MIDDLE_DOWN, &PreferencesDialog::OnDialogMouseDown, this);
76 Bind(wxEVT_RIGHT_DOWN, &PreferencesDialog::OnDialogMouseDown, this);
77
78 // Select first item in tree by default
79 wxTreeItemId rootId = m_sectionTree->GetRootItem();
80 if (rootId.IsOk()) {
81 wxTreeItemIdValue cookie;
82 wxTreeItemId firstItem = m_sectionTree->GetFirstChild(rootId, cookie);
83 if (firstItem.IsOk()) {
84 m_sectionTree->SelectItem(firstItem);
85 }
86 }
87
88 // Bind mousewheel event to all spin controls to prevent accidental value changes while scrolling
89 auto preventScrollWhenUnfocused = [](wxMouseEvent &event) {
90 wxSpinCtrl *spin = dynamic_cast<wxSpinCtrl *>(event.GetEventObject());
91 if (spin && spin->HasFocus()) {
92 event.Skip(); // Allow scroll wheel when focused
93 }
94 // Otherwise consume the event (don't skip) to prevent value changes
95 };
96
97 // Bind to all spin controls
98 if (m_minWindowWidth)
99 m_minWindowWidth->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
100 if (m_minWindowHeight)
101 m_minWindowHeight->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
102 if (m_maxWindowWidth)
103 m_maxWindowWidth->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
104 if (m_maxWindowHeight)
105 m_maxWindowHeight->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
106 if (m_gridSize)
107 m_gridSize->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
108 if (m_coordinateInfoFontSize)
109 m_coordinateInfoFontSize->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
110 if (m_coordinateInfoX)
111 m_coordinateInfoX->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
112 if (m_coordinateInfoY)
113 m_coordinateInfoY->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
114 if (m_selectedNodeInfoFontSize)
115 m_selectedNodeInfoFontSize->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
116 if (m_selectedNodeInfoX)
117 m_selectedNodeInfoX->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
118 if (m_selectedNodeInfoY)
119 m_selectedNodeInfoY->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
120 if (m_treeInfoFontSize)
121 m_treeInfoFontSize->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
122 if (m_treeInfoX)
123 m_treeInfoX->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
124 if (m_treeInfoY)
125 m_treeInfoY->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
126 if (m_controlsHelpFontSize)
127 m_controlsHelpFontSize->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
128 if (m_controlsHelpX)
129 m_controlsHelpX->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
130 if (m_controlsHelpY)
131 m_controlsHelpY->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
132 if (m_maxScenes)
133 m_maxScenes->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
134 // Scene Hierarchy new controls
135 if (m_hierarchyTreeIndentationSize)
136 m_hierarchyTreeIndentationSize->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
137 if (m_hierarchyFontSize)
138 m_hierarchyFontSize->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
139 if (m_bottomPanelHeight)
140 m_bottomPanelHeight->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
141 if (m_bottomPanelMinHeight)
142 m_bottomPanelMinHeight->Bind(wxEVT_MOUSEWHEEL, preventScrollWhenUnfocused);
143
144 // Make the settings panel and section panels steal focus when clicked
145 // This ensures spin controls lose focus when clicking on empty space
146 auto stealFocusOnClick = [this](wxMouseEvent &event) {
147 // Transfer focus to the section tree to remove focus from spin controls
148 if (m_sectionTree) {
149 m_sectionTree->SetFocus();
150 }
151 event.Skip();
152 };
153
154 // Bind click handlers to the settings panel and all section panels
155 if (m_settingsPanel) {
156 m_settingsPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
157 }
158 if (m_windowPanel)
159 m_windowPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
160 if (m_mainPanelPanel)
161 m_mainPanelPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
162 if (m_behaviorTreeViewPanel)
163 m_behaviorTreeViewPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
164 if (m_bottomPanelPanel)
165 m_bottomPanelPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
166 if (m_fileExplorerPanel)
167 m_fileExplorerPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
168 if (m_logTabPanel)
169 m_logTabPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
170 if (m_sidePanelPanel)
171 m_sidePanelPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
172 if (m_leftPanelPanel)
173 m_leftPanelPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
174 if (m_rightPanelPanel)
175 m_rightPanelPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
176 if (m_tabsSubPanel)
177 m_tabsSubPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
178 if (m_sceneHierarchyPanel)
179 m_sceneHierarchyPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
180 if (m_parserPanel)
181 m_parserPanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
182 if (m_performancePanel)
183 m_performancePanel->Bind(wxEVT_LEFT_DOWN, stealFocusOnClick);
184
185 LOG_INFO("UI", "Preferences dialog created");
186}
187
189 wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
190
191 // Create splitter window
192 m_splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D | wxSP_LIVE_UPDATE);
193 m_splitter->SetMinimumPaneSize(120);
194 m_splitter->SetSashGravity(0.15); // 15% for section list, 85% for settings
195
196 // Create left panel for section tree
197 wxPanel *leftPanel = new wxPanel(m_splitter, wxID_ANY);
198 leftPanel->SetBackgroundColour(wxColour(45, 45, 45));
199 wxBoxSizer *leftSizer = new wxBoxSizer(wxVERTICAL);
200
201 // Section tree
202 m_sectionTree = new wxTreeCtrl(leftPanel, ID_SECTION_TREE, wxDefaultPosition, wxDefaultSize,
203 wxTR_DEFAULT_STYLE | wxTR_HIDE_ROOT | wxTR_NO_LINES);
204 m_sectionTree->SetBackgroundColour(wxColour(45, 45, 45));
205 m_sectionTree->SetForegroundColour(wxColour(200, 200, 200));
206
207 leftSizer->Add(m_sectionTree, 1, wxEXPAND | wxALL, 5);
208 leftPanel->SetSizer(leftSizer);
209
210 // Create right panel for settings
211 wxPanel *rightPanel = new wxPanel(m_splitter, wxID_ANY);
212 rightPanel->SetBackgroundColour(wxColour(50, 50, 50));
213 wxBoxSizer *rightSizer = new wxBoxSizer(wxVERTICAL);
214
215 // Settings scrolled window
216 m_settingsPanel = new wxScrolledWindow(rightPanel, wxID_ANY);
217 m_settingsPanel->SetBackgroundColour(wxColour(50, 50, 50));
218 m_settingsPanel->SetScrollRate(0, 10);
219
220 m_settingsSizer = new wxBoxSizer(wxVERTICAL);
221
222 // Create all section panels
224
226 rightSizer->Add(m_settingsPanel, 1, wxEXPAND | wxALL, 10);
227
228 rightPanel->SetSizer(rightSizer);
229
230 // Split the window
231 m_splitter->SplitVertically(leftPanel, rightPanel, 150);
232 mainSizer->Add(m_splitter, 1, wxEXPAND | wxALL, 0);
233
234 // Button sizer at bottom
235 wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL);
236
237 m_restoreDefaultsButton = new wxButton(this, ID_RESTORE_DEFAULTS, "Restore Defaults");
238 m_restoreDefaultsButton->SetToolTip("Reset all settings to their default values");
239
240 buttonSizer->Add(m_restoreDefaultsButton, 0, wxALL, 5);
241 buttonSizer->AddStretchSpacer();
242
243 m_applyButton = new wxButton(this, ID_APPLY, "Apply");
244 m_applyButton->SetToolTip("Apply changes without closing the dialog");
245
246 m_cancelButton = new wxButton(this, wxID_CANCEL, "Cancel");
247 m_okButton = new wxButton(this, wxID_OK, "OK");
248 m_okButton->SetDefault();
249
250 buttonSizer->Add(m_applyButton, 0, wxALL, 5);
251 buttonSizer->Add(m_cancelButton, 0, wxALL, 5);
252 buttonSizer->Add(m_okButton, 0, wxALL, 5);
253
254 mainSizer->Add(buttonSizer, 0, wxEXPAND | wxALL, 10);
255
256 SetSizer(mainSizer);
257 Layout();
258}
259
261 // Create all section panels (hidden initially)
275
276 // Add to sizer (all will be shown/hidden dynamically)
277 m_settingsSizer->Add(m_windowPanel, 1, wxEXPAND | wxALL, 5);
278 m_settingsSizer->Add(m_mainPanelPanel, 1, wxEXPAND | wxALL, 5);
279 m_settingsSizer->Add(m_behaviorTreeViewPanel, 1, wxEXPAND | wxALL, 5);
280 m_settingsSizer->Add(m_bottomPanelPanel, 1, wxEXPAND | wxALL, 5);
281 m_settingsSizer->Add(m_fileExplorerPanel, 1, wxEXPAND | wxALL, 5);
282 m_settingsSizer->Add(m_logTabPanel, 1, wxEXPAND | wxALL, 5);
283 m_settingsSizer->Add(m_sidePanelPanel, 1, wxEXPAND | wxALL, 5);
284 m_settingsSizer->Add(m_leftPanelPanel, 1, wxEXPAND | wxALL, 5);
285 m_settingsSizer->Add(m_rightPanelPanel, 1, wxEXPAND | wxALL, 5);
286 m_settingsSizer->Add(m_tabsSubPanel, 1, wxEXPAND | wxALL, 5);
287 m_settingsSizer->Add(m_sceneHierarchyPanel, 1, wxEXPAND | wxALL, 5);
288 m_settingsSizer->Add(m_parserPanel, 1, wxEXPAND | wxALL, 5);
289 m_settingsSizer->Add(m_performancePanel, 1, wxEXPAND | wxALL, 5);
290
291 // Hide all panels initially
292 m_windowPanel->Hide();
293 m_mainPanelPanel->Hide();
295 m_bottomPanelPanel->Hide();
296 m_fileExplorerPanel->Hide();
297 m_logTabPanel->Hide();
298 m_sidePanelPanel->Hide();
299 m_leftPanelPanel->Hide();
300 m_rightPanelPanel->Hide();
301 m_tabsSubPanel->Hide();
302 m_sceneHierarchyPanel->Hide();
303 m_parserPanel->Hide();
304 m_performancePanel->Hide();
305
306 // Build tree structure after panels are created
307 wxTreeItemId root = m_sectionTree->AddRoot("Preferences");
308
309 // Window section
310 wxTreeItemId windowItem = m_sectionTree->AppendItem(root, "Window");
311 m_sectionTree->SetItemData(windowItem, new SectionTreeItemData(m_windowPanel));
312
313 // Main Panel section with child
314 wxTreeItemId mainPanelItem = m_sectionTree->AppendItem(root, "Main Panel");
315 m_sectionTree->SetItemData(mainPanelItem, new SectionTreeItemData(m_mainPanelPanel));
316
317 wxTreeItemId behaviorTreeViewItem = m_sectionTree->AppendItem(mainPanelItem, "Behavior Tree View");
318 m_sectionTree->SetItemData(behaviorTreeViewItem, new SectionTreeItemData(m_behaviorTreeViewPanel));
319
320 // Expand Main Panel by default to show child
321 m_sectionTree->Expand(mainPanelItem);
322
323 // Side Panel section (parent for all panels that inherit from SidePanel)
324 wxTreeItemId sidePanelItem = m_sectionTree->AppendItem(root, "Side Panel");
325 m_sectionTree->SetItemData(sidePanelItem, new SectionTreeItemData(m_sidePanelPanel));
326
327 // Left Panel under Side Panel
328 wxTreeItemId leftPanelItem = m_sectionTree->AppendItem(sidePanelItem, "Left Panel");
329 m_sectionTree->SetItemData(leftPanelItem, new SectionTreeItemData(m_leftPanelPanel));
330
331 // Right Panel under Side Panel
332 wxTreeItemId rightPanelItem = m_sectionTree->AppendItem(sidePanelItem, "Right Panel");
333 m_sectionTree->SetItemData(rightPanelItem, new SectionTreeItemData(m_rightPanelPanel));
334
335 // Bottom Panel under Side Panel
336 wxTreeItemId bottomPanelItem = m_sectionTree->AppendItem(sidePanelItem, "Bottom Panel");
337 m_sectionTree->SetItemData(bottomPanelItem, new SectionTreeItemData(m_bottomPanelPanel));
338
339 // Expand Side Panel by default
340 m_sectionTree->Expand(sidePanelItem);
341
342 // Tabs section (top-level)
343 wxTreeItemId tabsItem = m_sectionTree->AppendItem(root, "Tabs");
344 m_sectionTree->SetItemData(tabsItem, new SectionTreeItemData(m_tabsSubPanel));
345
346 // File Explorer Tab under Tabs
347 wxTreeItemId fileExplorerItem = m_sectionTree->AppendItem(tabsItem, "File Explorer Tab");
348 m_sectionTree->SetItemData(fileExplorerItem, new SectionTreeItemData(m_fileExplorerPanel));
349
350 // Log Tab under Tabs
351 wxTreeItemId logTabItem = m_sectionTree->AppendItem(tabsItem, "Log Tab");
352 m_sectionTree->SetItemData(logTabItem, new SectionTreeItemData(m_logTabPanel));
353
354 // Scene Hierarchy Tab under Tabs
355 wxTreeItemId sceneHierarchyItem = m_sectionTree->AppendItem(tabsItem, "Scene Hierarchy Tab");
356 m_sectionTree->SetItemData(sceneHierarchyItem, new SectionTreeItemData(m_sceneHierarchyPanel));
357
358 // Expand Tabs by default
359 m_sectionTree->Expand(tabsItem);
360
361 // Parser section
362 wxTreeItemId parserItem = m_sectionTree->AppendItem(root, "Parser");
363 m_sectionTree->SetItemData(parserItem, new SectionTreeItemData(m_parserPanel));
364
365 // Performance section
366 wxTreeItemId performanceItem = m_sectionTree->AppendItem(root, "Performance");
367 m_sectionTree->SetItemData(performanceItem, new SectionTreeItemData(m_performancePanel));
368}
369
370wxPanel *PreferencesDialog::CreateWindowSettings(wxWindow *parent) {
371 wxPanel *panel = new wxPanel(parent, wxID_ANY);
372 panel->SetBackgroundColour(wxColour(50, 50, 50));
373 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
374
375 // Appearance group
376 wxStaticBoxSizer *appearanceGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Appearance");
377
378 // Theme choice
379 wxBoxSizer *themeSizer = new wxBoxSizer(wxHORIZONTAL);
380 wxStaticText *themeLabel = new wxStaticText(panel, wxID_ANY, "Theme:");
381 themeLabel->SetForegroundColour(wxColour(200, 200, 200));
382 themeSizer->Add(themeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
383
384 wxArrayString themes;
385 themes.Add("Dark");
386 themes.Add("Light (Not Implemented)");
387 m_themeChoice = new wxChoice(panel, ID_THEME_CHOICE, wxDefaultPosition, wxDefaultSize, themes);
388 themeSizer->Add(m_themeChoice, 1, wxEXPAND);
389 appearanceGroup->Add(themeSizer, 0, wxEXPAND | wxALL, 5);
390
391 // Accent color
392 wxBoxSizer *accentSizer = new wxBoxSizer(wxHORIZONTAL);
393 wxStaticText *accentLabel = new wxStaticText(panel, wxID_ANY, "Accent Color:");
394 accentLabel->SetForegroundColour(wxColour(200, 200, 200));
395 accentSizer->Add(accentLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
396
397 m_accentColorPicker = new wxColourPickerCtrl(panel, ID_ACCENT_COLOR);
398 accentSizer->Add(m_accentColorPicker, 0, wxALIGN_CENTER_VERTICAL);
399 appearanceGroup->Add(accentSizer, 0, wxEXPAND | wxALL, 5);
400
401 panelSizer->Add(appearanceGroup, 0, wxEXPAND | wxALL, 5);
402
403 // Startup group
404 wxStaticBoxSizer *startupGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Startup");
405
406 wxBoxSizer *startupModeSizer = new wxBoxSizer(wxHORIZONTAL);
407 wxStaticText *startupModeLabel = new wxStaticText(panel, wxID_ANY, "Window mode on startup:");
408 startupModeLabel->SetForegroundColour(wxColour(200, 200, 200));
409 startupModeSizer->Add(startupModeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
410
411 wxArrayString startupModes;
412 startupModes.Add("Normal");
413 startupModes.Add("Maximized");
414 m_startupModeChoice = new wxChoice(panel, ID_STARTUP_MODE, wxDefaultPosition, wxDefaultSize, startupModes);
415 startupModeSizer->Add(m_startupModeChoice, 1, wxEXPAND);
416 startupGroup->Add(startupModeSizer, 0, wxEXPAND | wxALL, 5);
417
418 panelSizer->Add(startupGroup, 0, wxEXPAND | wxALL, 5);
419
420 // File Menu Hotkeys group
421 wxStaticBoxSizer *fileHotkeysGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "File Menu Hotkeys");
422
423 // Helper lambda to create hotkey row
424 auto createHotkeyRow = [&](const wxString &labelText, wxTextCtrl *&textCtrl, wxButton *&captureBtn) {
425 wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
426 wxStaticText *label = new wxStaticText(panel, wxID_ANY, labelText, wxDefaultPosition, wxSize(120, -1));
427 label->SetForegroundColour(wxColour(200, 200, 200));
428 sizer->Add(label, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
429
430 textCtrl = new wxTextCtrl(panel, wxID_ANY, "", wxDefaultPosition, wxSize(150, -1), wxTE_READONLY);
431 textCtrl->SetBackgroundColour(wxColour(60, 60, 60));
432 textCtrl->SetForegroundColour(wxColour(200, 200, 200));
433 textCtrl->Bind(wxEVT_KEY_DOWN, &PreferencesDialog::OnHotkeyTextKeyDown, this);
434 textCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
435 sizer->Add(textCtrl, 1, wxEXPAND);
436
437 captureBtn = new wxButton(panel, wxID_ANY, "Capture", wxDefaultPosition, wxSize(80, -1));
438 captureBtn->Bind(wxEVT_BUTTON, &PreferencesDialog::OnHotkeyCaptureClicked, this);
439 sizer->Add(captureBtn, 0, wxLEFT, 5);
440
441 return sizer;
442 };
443
444 fileHotkeysGroup->Add(createHotkeyRow("New Project:", m_newProjectHotkeyTextCtrl, m_newProjectHotkeyCaptureButton),
445 0, wxEXPAND | wxALL, 3);
446 fileHotkeysGroup->Add(
447 createHotkeyRow("Open Project:", m_openProjectHotkeyTextCtrl, m_openProjectHotkeyCaptureButton), 0,
448 wxEXPAND | wxALL, 3);
449 fileHotkeysGroup->Add(createHotkeyRow("Open File:", m_openFileHotkeyTextCtrl, m_openFileHotkeyCaptureButton), 0,
450 wxEXPAND | wxALL, 3);
451 fileHotkeysGroup->Add(createHotkeyRow("Save:", m_saveHotkeyTextCtrl, m_saveHotkeyCaptureButton), 0,
452 wxEXPAND | wxALL, 3);
453 fileHotkeysGroup->Add(createHotkeyRow("Save As:", m_saveAsHotkeyTextCtrl, m_saveAsHotkeyCaptureButton), 0,
454 wxEXPAND | wxALL, 3);
455
456 panelSizer->Add(fileHotkeysGroup, 0, wxEXPAND | wxALL, 5);
457
458 // View Menu Hotkeys group
459 wxStaticBoxSizer *viewHotkeysGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "View Menu Hotkeys");
460 viewHotkeysGroup->Add(createHotkeyRow("Maximize:", m_maximizeHotkeyTextCtrl, m_maximizeHotkeyCaptureButton), 0,
461 wxEXPAND | wxALL, 3);
462 viewHotkeysGroup->Add(createHotkeyRow("Reset UI:", m_resetUIHotkeyTextCtrl, m_resetUIHotkeyCaptureButton), 0,
463 wxEXPAND | wxALL, 3);
464
465 panelSizer->Add(viewHotkeysGroup, 0, wxEXPAND | wxALL, 5);
466
467 // Settings Menu Hotkeys group
468 wxStaticBoxSizer *settingsHotkeysGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Settings Menu Hotkeys");
469 settingsHotkeysGroup->Add(
470 createHotkeyRow("Preferences:", m_preferencesHotkeyTextCtrl, m_preferencesHotkeyCaptureButton), 0,
471 wxEXPAND | wxALL, 3);
472 settingsHotkeysGroup->Add(
473 createHotkeyRow("Parser Config:", m_parserConfigHotkeyTextCtrl, m_parserConfigHotkeyCaptureButton), 0,
474 wxEXPAND | wxALL, 3);
475
476 panelSizer->Add(settingsHotkeysGroup, 0, wxEXPAND | wxALL, 5);
477
478 // Window Appearance group
479 wxStaticBoxSizer *windowAppearanceGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Window Appearance");
480
481 // Show status bar
482 m_showStatusBar = new wxCheckBox(panel, ID_SHOW_STATUS_BAR, "Show status bar at bottom");
483 m_showStatusBar->SetForegroundColour(wxColour(200, 200, 200));
484 m_showStatusBar->SetToolTip("Display the status bar at the bottom of the window");
485 windowAppearanceGroup->Add(m_showStatusBar, 0, wxALL, 5);
486
487 // Show panel captions
488 m_showPanelCaptions = new wxCheckBox(panel, ID_SHOW_PANEL_CAPTIONS, "Show panel caption headers");
489 m_showPanelCaptions->SetForegroundColour(wxColour(200, 200, 200));
490 m_showPanelCaptions->SetToolTip("Display caption headers above panels (Left Panel, Right Panel, etc.)");
491 windowAppearanceGroup->Add(m_showPanelCaptions, 0, wxALL, 5);
492
493 // Always on top
494 m_alwaysOnTop = new wxCheckBox(panel, ID_ALWAYS_ON_TOP, "Always on top");
495 m_alwaysOnTop->SetForegroundColour(wxColour(200, 200, 200));
496 m_alwaysOnTop->SetToolTip("Keep window above all other windows");
497 windowAppearanceGroup->Add(m_alwaysOnTop, 0, wxALL, 5);
498
499 panelSizer->Add(windowAppearanceGroup, 0, wxEXPAND | wxALL, 5);
500
501 // Window Constraints group
502 wxStaticBoxSizer *constraintsGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Window Constraints");
503
504 // Minimum size
505 wxStaticText *minSizeLabel = new wxStaticText(panel, wxID_ANY, "Minimum Window Size:");
506 minSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
507 constraintsGroup->Add(minSizeLabel, 0, wxALL, 5);
508
509 wxBoxSizer *minSizeSizer = new wxBoxSizer(wxHORIZONTAL);
510 wxStaticText *minWidthLabel = new wxStaticText(panel, wxID_ANY, "Width:");
511 minWidthLabel->SetForegroundColour(wxColour(200, 200, 200));
512 minSizeSizer->Add(minWidthLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
513
514 m_minWindowWidth = new wxSpinCtrl(panel, ID_MIN_WINDOW_WIDTH, "800", wxDefaultPosition, wxSize(120, -1),
515 wxSP_ARROW_KEYS, 400, 4000, 800);
516 minSizeSizer->Add(m_minWindowWidth, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
517
518 wxStaticText *minHeightLabel = new wxStaticText(panel, wxID_ANY, "Height:");
519 minHeightLabel->SetForegroundColour(wxColour(200, 200, 200));
520 minSizeSizer->Add(minHeightLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
521
522 m_minWindowHeight = new wxSpinCtrl(panel, ID_MIN_WINDOW_HEIGHT, "600", wxDefaultPosition, wxSize(120, -1),
523 wxSP_ARROW_KEYS, 300, 3000, 600);
524 minSizeSizer->Add(m_minWindowHeight, 0);
525
526 constraintsGroup->Add(minSizeSizer, 0, wxEXPAND | wxALL, 5);
527
528 // Maximum size
529 wxStaticText *maxSizeLabel = new wxStaticText(panel, wxID_ANY, "Maximum Window Size:");
530 maxSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
531 constraintsGroup->Add(maxSizeLabel, 0, wxALL, 5);
532
533 m_maxWindowUnlimited = new wxCheckBox(panel, ID_MAX_WINDOW_UNLIMITED, "Unlimited (no maximum size)");
534 m_maxWindowUnlimited->SetForegroundColour(wxColour(200, 200, 200));
535 constraintsGroup->Add(m_maxWindowUnlimited, 0, wxALL, 5);
536
537 wxBoxSizer *maxSizeSizer = new wxBoxSizer(wxHORIZONTAL);
538 wxStaticText *maxWidthLabel = new wxStaticText(panel, wxID_ANY, "Width:");
539 maxWidthLabel->SetForegroundColour(wxColour(200, 200, 200));
540 maxSizeSizer->Add(maxWidthLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
541
542 m_maxWindowWidth = new wxSpinCtrl(panel, ID_MAX_WINDOW_WIDTH, "-1", wxDefaultPosition, wxSize(120, -1),
543 wxSP_ARROW_KEYS, -1, 8000, -1);
544 maxSizeSizer->Add(m_maxWindowWidth, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
545
546 wxStaticText *maxHeightLabel = new wxStaticText(panel, wxID_ANY, "Height:");
547 maxHeightLabel->SetForegroundColour(wxColour(200, 200, 200));
548 maxSizeSizer->Add(maxHeightLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
549
550 m_maxWindowHeight = new wxSpinCtrl(panel, ID_MAX_WINDOW_HEIGHT, "-1", wxDefaultPosition, wxSize(120, -1),
551 wxSP_ARROW_KEYS, -1, 6000, -1);
552 maxSizeSizer->Add(m_maxWindowHeight, 0);
553
554 constraintsGroup->Add(maxSizeSizer, 0, wxEXPAND | wxALL, 5);
555
556 // Aspect ratio
557 m_enforceAspectRatio = new wxCheckBox(panel, ID_ENFORCE_ASPECT_RATIO, "Enforce aspect ratio");
558 m_enforceAspectRatio->SetForegroundColour(wxColour(200, 200, 200));
559 m_enforceAspectRatio->SetToolTip("Maintain window width/height ratio when resizing");
560 constraintsGroup->Add(m_enforceAspectRatio, 0, wxALL, 5);
561
562 wxBoxSizer *aspectRatioSizer = new wxBoxSizer(wxHORIZONTAL);
563 wxStaticText *aspectLabel = new wxStaticText(panel, wxID_ANY, "Aspect Ratio:");
564 aspectLabel->SetForegroundColour(wxColour(200, 200, 200));
565 aspectRatioSizer->Add(aspectLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
566
567 m_aspectRatioWidth = new wxTextCtrl(panel, ID_ASPECT_RATIO_WIDTH, "16", wxDefaultPosition, wxSize(50, -1));
568 aspectRatioSizer->Add(m_aspectRatioWidth, 0, wxRIGHT, 5);
569
570 wxStaticText *aspectColon = new wxStaticText(panel, wxID_ANY, ":");
571 aspectColon->SetForegroundColour(wxColour(200, 200, 200));
572 aspectRatioSizer->Add(aspectColon, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
573
574 m_aspectRatioHeight = new wxTextCtrl(panel, ID_ASPECT_RATIO_HEIGHT, "9", wxDefaultPosition, wxSize(50, -1));
575 aspectRatioSizer->Add(m_aspectRatioHeight, 0);
576
577 wxStaticText *aspectNote = new wxStaticText(panel, wxID_ANY, "(e.g., 16:9, 4:3, 21:9)");
578 aspectNote->SetForegroundColour(wxColour(150, 150, 150));
579 aspectRatioSizer->Add(aspectNote, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
580
581 constraintsGroup->Add(aspectRatioSizer, 0, wxEXPAND | wxALL, 5);
582
583 panelSizer->Add(constraintsGroup, 0, wxEXPAND | wxALL, 5);
584 panelSizer->AddStretchSpacer();
585
586 panel->SetSizer(panelSizer);
587 return panel;
588}
589
591 wxPanel *panel = new wxPanel(parent, wxID_ANY);
592 panel->SetBackgroundColour(wxColour(50, 50, 50));
593 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
594
595 // Canvas group
596 wxStaticBoxSizer *canvasGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Canvas");
597
598 wxBoxSizer *bgColorSizer = new wxBoxSizer(wxHORIZONTAL);
599 wxStaticText *bgColorLabel = new wxStaticText(panel, wxID_ANY, "Background Color:");
600 bgColorLabel->SetForegroundColour(wxColour(200, 200, 200));
601 bgColorSizer->Add(bgColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
602
603 m_canvasBackgroundPicker = new wxColourPickerCtrl(panel, ID_CANVAS_BACKGROUND);
604 bgColorSizer->Add(m_canvasBackgroundPicker, 0, wxALIGN_CENTER_VERTICAL);
605 canvasGroup->Add(bgColorSizer, 0, wxEXPAND | wxALL, 5);
606
607 panelSizer->Add(canvasGroup, 0, wxEXPAND | wxALL, 5);
608
609 // Scene Management group
610 wxStaticBoxSizer *sceneManagementGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Scene Management");
611
612 wxBoxSizer *maxScenesSizer = new wxBoxSizer(wxHORIZONTAL);
613 wxStaticText *maxScenesLabel = new wxStaticText(panel, wxID_ANY, "Maximum Scenes:");
614 maxScenesLabel->SetForegroundColour(wxColour(200, 200, 200));
615 maxScenesSizer->Add(maxScenesLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
616
618 new wxSpinCtrl(panel, ID_MAX_SCENES, "10", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 1, 50, 10);
619 maxScenesSizer->Add(m_maxScenes, 0, wxALIGN_CENTER_VERTICAL);
620
621 m_maxScenesUnlimited = new wxCheckBox(panel, ID_MAX_SCENES_UNLIMITED, "Unlimited");
622 m_maxScenesUnlimited->SetForegroundColour(wxColour(200, 200, 200));
623 maxScenesSizer->Add(m_maxScenesUnlimited, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 40);
624
625 sceneManagementGroup->Add(maxScenesSizer, 0, wxEXPAND | wxALL, 5);
626
627 wxStaticText *sceneNote =
628 new wxStaticText(panel, wxID_ANY, "Limit the number of behavior tree scenes that can be open simultaneously");
629 sceneNote->SetForegroundColour(wxColour(150, 150, 150));
630 sceneNote->Wrap(450);
631 sceneManagementGroup->Add(sceneNote, 0, wxALL, 5);
632
633 // Close confirmation
634 wxBoxSizer *closeConfirmSizer = new wxBoxSizer(wxHORIZONTAL);
635 wxStaticText *closeConfirmLabel = new wxStaticText(panel, wxID_ANY, "Close Confirmation:");
636 closeConfirmLabel->SetForegroundColour(wxColour(200, 200, 200));
637 closeConfirmSizer->Add(closeConfirmLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
638
639 wxArrayString closeConfirmOptions;
640 closeConfirmOptions.Add("Always Ask");
641 closeConfirmOptions.Add("Never Ask");
642 closeConfirmOptions.Add("Ask If Unsaved");
644 new wxChoice(panel, ID_CLOSE_CONFIRMATION, wxDefaultPosition, wxDefaultSize, closeConfirmOptions);
645 closeConfirmSizer->Add(m_closeConfirmation, 1, wxEXPAND);
646
647 sceneManagementGroup->Add(closeConfirmSizer, 0, wxEXPAND | wxALL, 5);
648
649 panelSizer->Add(sceneManagementGroup, 0, wxEXPAND | wxALL, 5);
650
651 // Tab Switching Hotkeys group
652 wxStaticBoxSizer *tabSwitchingGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Tab Switching");
653
654 // Next scene hotkey
655 wxBoxSizer *nextSceneHotkeySizer = new wxBoxSizer(wxHORIZONTAL);
656 wxStaticText *nextSceneLabel = new wxStaticText(panel, wxID_ANY, "Next Scene:");
657 nextSceneLabel->SetForegroundColour(wxColour(200, 200, 200));
658 nextSceneHotkeySizer->Add(nextSceneLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
659
660 m_nextSceneHotkeyTextCtrl = new wxTextCtrl(panel, wxID_ANY, "", wxDefaultPosition, wxSize(150, -1), wxTE_READONLY);
661 m_nextSceneHotkeyTextCtrl->SetBackgroundColour(wxColour(60, 60, 60));
662 m_nextSceneHotkeyTextCtrl->SetForegroundColour(wxColour(200, 200, 200));
664 m_nextSceneHotkeyTextCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
665 nextSceneHotkeySizer->Add(m_nextSceneHotkeyTextCtrl, 1, wxEXPAND);
666
667 m_nextSceneHotkeyCaptureButton = new wxButton(panel, wxID_ANY, "Capture", wxDefaultPosition, wxSize(80, -1));
669 nextSceneHotkeySizer->Add(m_nextSceneHotkeyCaptureButton, 0, wxLEFT, 5);
670
671 tabSwitchingGroup->Add(nextSceneHotkeySizer, 0, wxEXPAND | wxALL, 5);
672
673 // Previous scene hotkey
674 wxBoxSizer *previousSceneHotkeySizer = new wxBoxSizer(wxHORIZONTAL);
675 wxStaticText *previousSceneLabel = new wxStaticText(panel, wxID_ANY, "Previous Scene:");
676 previousSceneLabel->SetForegroundColour(wxColour(200, 200, 200));
677 previousSceneHotkeySizer->Add(previousSceneLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
678
680 new wxTextCtrl(panel, wxID_ANY, "", wxDefaultPosition, wxSize(150, -1), wxTE_READONLY);
681 m_previousSceneHotkeyTextCtrl->SetBackgroundColour(wxColour(60, 60, 60));
682 m_previousSceneHotkeyTextCtrl->SetForegroundColour(wxColour(200, 200, 200));
684 m_previousSceneHotkeyTextCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
685 previousSceneHotkeySizer->Add(m_previousSceneHotkeyTextCtrl, 1, wxEXPAND);
686
687 m_previousSceneHotkeyCaptureButton = new wxButton(panel, wxID_ANY, "Capture", wxDefaultPosition, wxSize(80, -1));
689 previousSceneHotkeySizer->Add(m_previousSceneHotkeyCaptureButton, 0, wxLEFT, 5);
690
691 tabSwitchingGroup->Add(previousSceneHotkeySizer, 0, wxEXPAND | wxALL, 5);
692
693 panelSizer->Add(tabSwitchingGroup, 0, wxEXPAND | wxALL, 5);
694 panelSizer->AddStretchSpacer();
695
696 panel->SetSizer(panelSizer);
697 return panel;
698}
699
701 wxPanel *panel = new wxPanel(parent, wxID_ANY);
702 panel->SetBackgroundColour(wxColour(50, 50, 50));
703 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
704
705 // Zoom group
706 wxStaticBoxSizer *zoomGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Zoom & View");
707
708 // Default zoom slider
709 wxBoxSizer *zoomSizer = new wxBoxSizer(wxHORIZONTAL);
710 wxStaticText *zoomLabelText = new wxStaticText(panel, wxID_ANY, "Default Zoom:");
711 zoomLabelText->SetForegroundColour(wxColour(200, 200, 200));
712 zoomSizer->Add(zoomLabelText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
713
715 new wxSlider(panel, ID_DEFAULT_ZOOM, 100, 10, 200, wxDefaultPosition, wxSize(200, -1), wxSL_HORIZONTAL);
716 m_defaultZoomSlider->Bind(wxEVT_MOUSEWHEEL, &PreferencesDialog::OnSliderMouseWheel, this);
717 zoomSizer->Add(m_defaultZoomSlider, 1, wxEXPAND | wxRIGHT, 10);
718
719 m_zoomLabel = new wxStaticText(panel, wxID_ANY, "100%");
720 m_zoomLabel->SetForegroundColour(wxColour(200, 200, 200));
721 m_zoomLabel->SetMinSize(wxSize(50, -1));
722 zoomSizer->Add(m_zoomLabel, 0, wxALIGN_CENTER_VERTICAL);
723
724 zoomGroup->Add(zoomSizer, 0, wxEXPAND | wxALL, 5);
725
726 // Zoom step size
727 wxBoxSizer *zoomStepSizer = new wxBoxSizer(wxHORIZONTAL);
728 wxStaticText *zoomStepLabel = new wxStaticText(panel, wxID_ANY, "Zoom step size:");
729 zoomStepLabel->SetForegroundColour(wxColour(200, 200, 200));
730 zoomStepSizer->Add(zoomStepLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
731
733 new wxSlider(panel, ID_ZOOM_STEP_SIZE, 10, 1, 50, wxDefaultPosition, wxSize(200, -1), wxSL_HORIZONTAL);
734 m_zoomStepSize->Bind(wxEVT_MOUSEWHEEL, &PreferencesDialog::OnSliderMouseWheel, this);
735 zoomStepSizer->Add(m_zoomStepSize, 1, wxEXPAND | wxRIGHT, 10);
736
737 m_zoomStepSizeLabel = new wxStaticText(panel, wxID_ANY, "10%");
738 m_zoomStepSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
739 m_zoomStepSizeLabel->SetMinSize(wxSize(50, -1));
740 zoomStepSizer->Add(m_zoomStepSizeLabel, 0, wxALIGN_CENTER_VERTICAL);
741
742 zoomGroup->Add(zoomStepSizer, 0, wxEXPAND | wxALL, 5);
743
744 // Mouse wheel sensitivity
745 wxBoxSizer *wheelSensitivitySizer = new wxBoxSizer(wxHORIZONTAL);
746 wxStaticText *wheelSensitivityText = new wxStaticText(panel, wxID_ANY, "Mouse wheel sensitivity:");
747 wheelSensitivityText->SetForegroundColour(wxColour(200, 200, 200));
748 wheelSensitivitySizer->Add(wheelSensitivityText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
749
750 m_mouseWheelSensitivity = new wxSlider(panel, ID_MOUSE_WHEEL_SENSITIVITY, 100, 10, 500, wxDefaultPosition,
751 wxSize(200, -1), wxSL_HORIZONTAL);
753 wheelSensitivitySizer->Add(m_mouseWheelSensitivity, 1, wxEXPAND | wxRIGHT, 10);
754
755 m_mouseWheelSensitivityLabel = new wxStaticText(panel, wxID_ANY, "1.0x");
756 m_mouseWheelSensitivityLabel->SetForegroundColour(wxColour(200, 200, 200));
757 m_mouseWheelSensitivityLabel->SetMinSize(wxSize(50, -1));
758 wheelSensitivitySizer->Add(m_mouseWheelSensitivityLabel, 0, wxALIGN_CENTER_VERTICAL);
759 zoomGroup->Add(wheelSensitivitySizer, 0, wxEXPAND | wxALL, 5);
760
761 // Zoom follows cursor
762 m_zoomFollowsCursor = new wxCheckBox(panel, ID_ZOOM_FOLLOWS_CURSOR, "Zoom towards cursor position");
763 m_zoomFollowsCursor->SetForegroundColour(wxColour(200, 200, 200));
764 zoomGroup->Add(m_zoomFollowsCursor, 0, wxALL, 5);
765
766 // Reset view hotkey (full reset: zoom + pan)
767 wxBoxSizer *resetViewHotkeySizer = new wxBoxSizer(wxHORIZONTAL);
768 wxStaticText *resetViewHotkeyLabel = new wxStaticText(panel, wxID_ANY, "Reset view hotkey:");
769 resetViewHotkeyLabel->SetForegroundColour(wxColour(200, 200, 200));
770 resetViewHotkeySizer->Add(resetViewHotkeyLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
771
772 m_resetViewHotkeyTextCtrl = new wxTextCtrl(panel, ID_RESET_VIEW_HOTKEY_TEXT, "R", wxDefaultPosition,
773 wxSize(150, -1), wxTE_READONLY | wxTE_CENTRE);
774 m_resetViewHotkeyTextCtrl->SetBackgroundColour(wxColour(60, 60, 60));
775 m_resetViewHotkeyTextCtrl->SetForegroundColour(wxColour(200, 200, 200));
777 m_resetViewHotkeyTextCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
778 resetViewHotkeySizer->Add(m_resetViewHotkeyTextCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
779
780 m_resetViewHotkeyCaptureButton = new wxButton(panel, ID_RESET_VIEW_HOTKEY_CAPTURE, "Capture");
782 resetViewHotkeySizer->Add(m_resetViewHotkeyCaptureButton, 0, wxALIGN_CENTER_VERTICAL);
783 zoomGroup->Add(resetViewHotkeySizer, 0, wxEXPAND | wxALL, 5);
784
785 panelSizer->Add(zoomGroup, 0, wxEXPAND | wxALL, 5);
786
787 // Pan group
788 wxStaticBoxSizer *panGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Panning");
789
790 // Pan sensitivity slider
791 wxBoxSizer *panSensitivitySizer = new wxBoxSizer(wxHORIZONTAL);
792 wxStaticText *panSensitivityText = new wxStaticText(panel, wxID_ANY, "Pan sensitivity:");
793 panSensitivityText->SetForegroundColour(wxColour(200, 200, 200));
794 panSensitivitySizer->Add(panSensitivityText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
795
797 new wxSlider(panel, ID_PAN_SENSITIVITY, 151, 10, 200, wxDefaultPosition, wxSize(200, -1), wxSL_HORIZONTAL);
798 m_panSensitivity->Bind(wxEVT_MOUSEWHEEL, &PreferencesDialog::OnSliderMouseWheel, this);
799 panSensitivitySizer->Add(m_panSensitivity, 1, wxEXPAND | wxRIGHT, 10);
800
801 m_panSensitivityLabel = new wxStaticText(panel, wxID_ANY, "1.51x");
802 m_panSensitivityLabel->SetForegroundColour(wxColour(200, 200, 200));
803 m_panSensitivityLabel->SetMinSize(wxSize(50, -1));
804 panSensitivitySizer->Add(m_panSensitivityLabel, 0, wxALIGN_CENTER_VERTICAL);
805 panGroup->Add(panSensitivitySizer, 0, wxEXPAND | wxALL, 5);
806
807 // Pan smoothness slider
808 wxBoxSizer *panSmoothnessSizer = new wxBoxSizer(wxHORIZONTAL);
809 wxStaticText *panSmoothnessText = new wxStaticText(panel, wxID_ANY, "Pan smoothness:");
810 panSmoothnessText->SetForegroundColour(wxColour(200, 200, 200));
811 panSmoothnessSizer->Add(panSmoothnessText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
812
814 new wxSlider(panel, ID_PAN_SMOOTHNESS, 30, 0, 100, wxDefaultPosition, wxSize(200, -1), wxSL_HORIZONTAL);
815 m_panSmoothness->Bind(wxEVT_MOUSEWHEEL, &PreferencesDialog::OnSliderMouseWheel, this);
817 panSmoothnessSizer->Add(m_panSmoothness, 1, wxEXPAND | wxRIGHT, 10);
818
819 m_panSmoothnessLabel = new wxStaticText(panel, wxID_ANY, "30%");
820 m_panSmoothnessLabel->SetForegroundColour(wxColour(200, 200, 200));
821 m_panSmoothnessLabel->SetMinSize(wxSize(50, -1));
822 panSmoothnessSizer->Add(m_panSmoothnessLabel, 0, wxALIGN_CENTER_VERTICAL);
823 panGroup->Add(panSmoothnessSizer, 0, wxEXPAND | wxALL, 5);
824
825 // Pan step size slider
826 wxBoxSizer *panStepSizeSizer = new wxBoxSizer(wxHORIZONTAL);
827 wxStaticText *panStepSizeText = new wxStaticText(panel, wxID_ANY, "Pan step size:");
828 panStepSizeText->SetForegroundColour(wxColour(200, 200, 200));
829 panStepSizeSizer->Add(panStepSizeText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
830
832 new wxSlider(panel, ID_PAN_STEP_SIZE, 40, 10, 500, wxDefaultPosition, wxSize(200, -1), wxSL_HORIZONTAL);
833 m_panStepSize->Bind(wxEVT_MOUSEWHEEL, &PreferencesDialog::OnSliderMouseWheel, this);
834 m_panStepSize->Bind(wxEVT_SLIDER, &PreferencesDialog::OnPanStepSizeChanged, this);
835 panStepSizeSizer->Add(m_panStepSize, 1, wxEXPAND | wxRIGHT, 10);
836
837 m_panStepSizeLabel = new wxStaticText(panel, wxID_ANY, "40px");
838 m_panStepSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
839 m_panStepSizeLabel->SetMinSize(wxSize(50, -1));
840 panStepSizeSizer->Add(m_panStepSizeLabel, 0, wxALIGN_CENTER_VERTICAL);
841 panGroup->Add(panStepSizeSizer, 0, wxEXPAND | wxALL, 5);
842
843 // Enable smooth panning checkbox
844 m_enableSmoothPanning = new wxCheckBox(panel, ID_ENABLE_SMOOTH_PANNING, "Enable smooth panning (arrow keys)");
845 m_enableSmoothPanning->SetForegroundColour(wxColour(200, 200, 200));
846 panGroup->Add(m_enableSmoothPanning, 0, wxALL, 5);
847
848 // Pan key (hold to pan)
849 wxBoxSizer *panKeyHotkeySizer = new wxBoxSizer(wxHORIZONTAL);
850 wxStaticText *panKeyHotkeyLabel = new wxStaticText(panel, wxID_ANY, "Pan key (hold + drag):");
851 panKeyHotkeyLabel->SetForegroundColour(wxColour(200, 200, 200));
852 panKeyHotkeySizer->Add(panKeyHotkeyLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
853
854 m_panKeyTextCtrl = new wxTextCtrl(panel, ID_PAN_KEY_TEXT, "Middle Mouse Button", wxDefaultPosition, wxSize(150, -1),
855 wxTE_READONLY | wxTE_CENTRE);
856 m_panKeyTextCtrl->SetBackgroundColour(wxColour(60, 60, 60));
857 m_panKeyTextCtrl->SetForegroundColour(wxColour(200, 200, 200));
858 m_panKeyTextCtrl->Bind(wxEVT_KEY_DOWN, &PreferencesDialog::OnHotkeyTextKeyDown, this);
859 m_panKeyTextCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
860 // Mouse events are now handled at dialog level via OnDialogMouseDown
861 panKeyHotkeySizer->Add(m_panKeyTextCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
862
863 m_panKeyCaptureButton = new wxButton(panel, ID_PAN_KEY_CAPTURE, "Capture");
865 panKeyHotkeySizer->Add(m_panKeyCaptureButton, 0, wxALIGN_CENTER_VERTICAL);
866 panGroup->Add(panKeyHotkeySizer, 0, wxEXPAND | wxALL, 5);
867
868 // Pan up hotkey
869 wxBoxSizer *panUpHotkeySizer = new wxBoxSizer(wxHORIZONTAL);
870 wxStaticText *panUpLabel = new wxStaticText(panel, wxID_ANY, "Pan up:");
871 panUpLabel->SetForegroundColour(wxColour(200, 200, 200));
872 panUpHotkeySizer->Add(panUpLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
873
874 m_panUpHotkeyTextCtrl = new wxTextCtrl(panel, ID_PAN_UP_HOTKEY_TEXT, "Up", wxDefaultPosition, wxSize(150, -1),
875 wxTE_READONLY | wxTE_CENTRE);
876 m_panUpHotkeyTextCtrl->SetBackgroundColour(wxColour(60, 60, 60));
877 m_panUpHotkeyTextCtrl->SetForegroundColour(wxColour(200, 200, 200));
879 m_panUpHotkeyTextCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
880 panUpHotkeySizer->Add(m_panUpHotkeyTextCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
881
882 m_panUpHotkeyCaptureButton = new wxButton(panel, ID_PAN_UP_HOTKEY_CAPTURE, "Capture");
884 panUpHotkeySizer->Add(m_panUpHotkeyCaptureButton, 0, wxALIGN_CENTER_VERTICAL);
885 panGroup->Add(panUpHotkeySizer, 0, wxEXPAND | wxALL, 5);
886
887 // Pan down hotkey
888 wxBoxSizer *panDownHotkeySizer = new wxBoxSizer(wxHORIZONTAL);
889 wxStaticText *panDownLabel = new wxStaticText(panel, wxID_ANY, "Pan down:");
890 panDownLabel->SetForegroundColour(wxColour(200, 200, 200));
891 panDownHotkeySizer->Add(panDownLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
892
893 m_panDownHotkeyTextCtrl = new wxTextCtrl(panel, ID_PAN_DOWN_HOTKEY_TEXT, "Down", wxDefaultPosition, wxSize(150, -1),
894 wxTE_READONLY | wxTE_CENTRE);
895 m_panDownHotkeyTextCtrl->SetBackgroundColour(wxColour(60, 60, 60));
896 m_panDownHotkeyTextCtrl->SetForegroundColour(wxColour(200, 200, 200));
898 m_panDownHotkeyTextCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
899 panDownHotkeySizer->Add(m_panDownHotkeyTextCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
900
901 m_panDownHotkeyCaptureButton = new wxButton(panel, ID_PAN_DOWN_HOTKEY_CAPTURE, "Capture");
903 panDownHotkeySizer->Add(m_panDownHotkeyCaptureButton, 0, wxALIGN_CENTER_VERTICAL);
904 panGroup->Add(panDownHotkeySizer, 0, wxEXPAND | wxALL, 5);
905
906 // Pan left hotkey
907 wxBoxSizer *panLeftHotkeySizer = new wxBoxSizer(wxHORIZONTAL);
908 wxStaticText *panLeftLabel = new wxStaticText(panel, wxID_ANY, "Pan left:");
909 panLeftLabel->SetForegroundColour(wxColour(200, 200, 200));
910 panLeftHotkeySizer->Add(panLeftLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
911
912 m_panLeftHotkeyTextCtrl = new wxTextCtrl(panel, ID_PAN_LEFT_HOTKEY_TEXT, "Left", wxDefaultPosition, wxSize(150, -1),
913 wxTE_READONLY | wxTE_CENTRE);
914 m_panLeftHotkeyTextCtrl->SetBackgroundColour(wxColour(60, 60, 60));
915 m_panLeftHotkeyTextCtrl->SetForegroundColour(wxColour(200, 200, 200));
917 m_panLeftHotkeyTextCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
918 panLeftHotkeySizer->Add(m_panLeftHotkeyTextCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
919
920 m_panLeftHotkeyCaptureButton = new wxButton(panel, ID_PAN_LEFT_HOTKEY_CAPTURE, "Capture");
922 panLeftHotkeySizer->Add(m_panLeftHotkeyCaptureButton, 0, wxALIGN_CENTER_VERTICAL);
923 panGroup->Add(panLeftHotkeySizer, 0, wxEXPAND | wxALL, 5);
924
925 // Pan right hotkey
926 wxBoxSizer *panRightHotkeySizer = new wxBoxSizer(wxHORIZONTAL);
927 wxStaticText *panRightLabel = new wxStaticText(panel, wxID_ANY, "Pan right:");
928 panRightLabel->SetForegroundColour(wxColour(200, 200, 200));
929 panRightHotkeySizer->Add(panRightLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
930
931 m_panRightHotkeyTextCtrl = new wxTextCtrl(panel, ID_PAN_RIGHT_HOTKEY_TEXT, "Right", wxDefaultPosition,
932 wxSize(150, -1), wxTE_READONLY | wxTE_CENTRE);
933 m_panRightHotkeyTextCtrl->SetBackgroundColour(wxColour(60, 60, 60));
934 m_panRightHotkeyTextCtrl->SetForegroundColour(wxColour(200, 200, 200));
936 m_panRightHotkeyTextCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
937 panRightHotkeySizer->Add(m_panRightHotkeyTextCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
938
939 m_panRightHotkeyCaptureButton = new wxButton(panel, ID_PAN_RIGHT_HOTKEY_CAPTURE, "Capture");
941 panRightHotkeySizer->Add(m_panRightHotkeyCaptureButton, 0, wxALIGN_CENTER_VERTICAL);
942 panGroup->Add(panRightHotkeySizer, 0, wxEXPAND | wxALL, 5);
943
944 panelSizer->Add(panGroup, 0, wxEXPAND | wxALL, 5);
945
946 // Action hotkeys group
947 wxStaticBoxSizer *navGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Action Hotkeys");
948
949 // Expand/Collapse hotkey (previously "Center on selected")
950 wxBoxSizer *centerHotkeySizer = new wxBoxSizer(wxHORIZONTAL);
951 wxStaticText *centerHotkeyLabel = new wxStaticText(panel, wxID_ANY, "Expand/Collapse:");
952 centerHotkeyLabel->SetForegroundColour(wxColour(200, 200, 200));
953 centerHotkeySizer->Add(centerHotkeyLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
954
955 m_centerOnNodeHotkeyTextCtrl = new wxTextCtrl(panel, ID_CENTER_ON_NODE_HOTKEY_TEXT, "C", wxDefaultPosition,
956 wxSize(150, -1), wxTE_READONLY | wxTE_CENTRE);
957 m_centerOnNodeHotkeyTextCtrl->SetBackgroundColour(wxColour(60, 60, 60));
958 m_centerOnNodeHotkeyTextCtrl->SetForegroundColour(wxColour(200, 200, 200));
960 m_centerOnNodeHotkeyTextCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
961 centerHotkeySizer->Add(m_centerOnNodeHotkeyTextCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
962
965 centerHotkeySizer->Add(m_centerOnNodeHotkeyCaptureButton, 0, wxALIGN_CENTER_VERTICAL);
966 navGroup->Add(centerHotkeySizer, 0, wxEXPAND | wxALL, 5);
967
968 // Delete node hotkey
969 wxBoxSizer *deleteHotkeySizer = new wxBoxSizer(wxHORIZONTAL);
970 wxStaticText *deleteHotkeyLabel = new wxStaticText(panel, wxID_ANY, "Delete node:");
971 deleteHotkeyLabel->SetForegroundColour(wxColour(200, 200, 200));
972 deleteHotkeySizer->Add(deleteHotkeyLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
973
974 m_deleteNodeHotkeyTextCtrl = new wxTextCtrl(panel, ID_DELETE_NODE_HOTKEY_TEXT, "Delete", wxDefaultPosition,
975 wxSize(150, -1), wxTE_READONLY | wxTE_CENTRE);
976 m_deleteNodeHotkeyTextCtrl->SetBackgroundColour(wxColour(60, 60, 60));
977 m_deleteNodeHotkeyTextCtrl->SetForegroundColour(wxColour(200, 200, 200));
979 m_deleteNodeHotkeyTextCtrl->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent &e) { /* Prevent direct clicks */ });
980 deleteHotkeySizer->Add(m_deleteNodeHotkeyTextCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
981
982 m_deleteNodeHotkeyCaptureButton = new wxButton(panel, ID_DELETE_NODE_HOTKEY_CAPTURE, "Capture");
984 deleteHotkeySizer->Add(m_deleteNodeHotkeyCaptureButton, 0, wxALIGN_CENTER_VERTICAL);
985 navGroup->Add(deleteHotkeySizer, 0, wxEXPAND | wxALL, 5);
986
987 panelSizer->Add(navGroup, 0, wxEXPAND | wxALL, 5);
988
989 // Grid group
990 wxStaticBoxSizer *gridGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Grid");
991
992 m_showGrid = new wxCheckBox(panel, ID_SHOW_GRID, "Show grid");
993 m_showGrid->SetForegroundColour(wxColour(200, 200, 200));
994 gridGroup->Add(m_showGrid, 0, wxALL, 5);
995
996 wxBoxSizer *gridSizeSizer = new wxBoxSizer(wxHORIZONTAL);
997 wxStaticText *gridSizeLabel = new wxStaticText(panel, wxID_ANY, "Grid size (pixels):");
998 gridSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
999 gridSizeSizer->Add(gridSizeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1000
1001 m_gridSize =
1002 new wxSpinCtrl(panel, ID_GRID_SIZE, "20", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 10, 100, 20);
1003 gridSizeSizer->Add(m_gridSize, 0, wxALIGN_CENTER_VERTICAL);
1004 gridGroup->Add(gridSizeSizer, 0, wxEXPAND | wxALL, 5);
1005
1006 // Grid background color
1007 wxBoxSizer *gridBgColorSizer = new wxBoxSizer(wxHORIZONTAL);
1008 wxStaticText *gridBgColorLabel = new wxStaticText(panel, wxID_ANY, "Grid background color:");
1009 gridBgColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1010 gridBgColorSizer->Add(gridBgColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1011
1012 m_gridBackgroundPicker = new wxColourPickerCtrl(panel, ID_GRID_BACKGROUND);
1013 gridBgColorSizer->Add(m_gridBackgroundPicker, 0, wxALIGN_CENTER_VERTICAL);
1014 gridGroup->Add(gridBgColorSizer, 0, wxEXPAND | wxALL, 5);
1015
1016 // Grid line color
1017 wxBoxSizer *gridLineColorSizer = new wxBoxSizer(wxHORIZONTAL);
1018 wxStaticText *gridLineColorLabel = new wxStaticText(panel, wxID_ANY, "Grid line color:");
1019 gridLineColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1020 gridLineColorSizer->Add(gridLineColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1021
1022 m_gridLineColorPicker = new wxColourPickerCtrl(panel, ID_GRID_LINE_COLOR);
1023 gridLineColorSizer->Add(m_gridLineColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1024 gridGroup->Add(gridLineColorSizer, 0, wxEXPAND | wxALL, 5);
1025
1026 // Connection line color
1027 wxBoxSizer *connectionColorSizer = new wxBoxSizer(wxHORIZONTAL);
1028 wxStaticText *connectionColorLabel = new wxStaticText(panel, wxID_ANY, "Connection line color:");
1029 connectionColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1030 connectionColorSizer->Add(connectionColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1031
1032 m_connectionLineColorPicker = new wxColourPickerCtrl(panel, ID_CONNECTION_LINE_COLOR);
1033 connectionColorSizer->Add(m_connectionLineColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1034 gridGroup->Add(connectionColorSizer, 0, wxEXPAND | wxALL, 5);
1035
1036 // Highlight path to selected node
1037 m_highlightPathToSelected = new wxCheckBox(panel, ID_HIGHLIGHT_PATH_TO_SELECTED, "Highlight path to selected node");
1038 m_highlightPathToSelected->SetForegroundColour(wxColour(200, 200, 200));
1039 gridGroup->Add(m_highlightPathToSelected, 0, wxALL, 5);
1040
1041 // Path highlight color
1042 wxBoxSizer *pathHighlightColorSizer = new wxBoxSizer(wxHORIZONTAL);
1043 wxStaticText *pathHighlightColorLabel = new wxStaticText(panel, wxID_ANY, "Path highlight color:");
1044 pathHighlightColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1045 pathHighlightColorSizer->Add(pathHighlightColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1046
1047 m_pathHighlightColorPicker = new wxColourPickerCtrl(panel, ID_PATH_HIGHLIGHT_COLOR);
1048 pathHighlightColorSizer->Add(m_pathHighlightColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1049 gridGroup->Add(pathHighlightColorSizer, 0, wxEXPAND | wxALL, 5);
1050
1051 panelSizer->Add(gridGroup, 0, wxEXPAND | wxALL, 5);
1052
1053 // Node Appearance group
1054 wxStaticBoxSizer *nodeAppearanceGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Node Appearance");
1055
1056 // === IDLE NODE SUBSECTION ===
1057 wxStaticBoxSizer *idleNodeGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Idle Node");
1058
1059 // Background color
1060 wxBoxSizer *idleNodeBgColorSizer = new wxBoxSizer(wxHORIZONTAL);
1061 wxStaticText *idleNodeBgColorLabel = new wxStaticText(panel, wxID_ANY, "Background color:");
1062 idleNodeBgColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1063 idleNodeBgColorSizer->Add(idleNodeBgColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1064 m_idleNodeBgColorPicker = new wxColourPickerCtrl(panel, ID_IDLE_NODE_BG_COLOR);
1065 idleNodeBgColorSizer->Add(m_idleNodeBgColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1066 idleNodeGroup->Add(idleNodeBgColorSizer, 0, wxEXPAND | wxALL, 3);
1067
1068 // Border color
1069 wxBoxSizer *idleNodeBorderColorSizer = new wxBoxSizer(wxHORIZONTAL);
1070 wxStaticText *idleNodeBorderColorLabel = new wxStaticText(panel, wxID_ANY, "Border color:");
1071 idleNodeBorderColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1072 idleNodeBorderColorSizer->Add(idleNodeBorderColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1073 m_idleNodeBorderColorPicker = new wxColourPickerCtrl(panel, ID_IDLE_NODE_BORDER_COLOR);
1074 idleNodeBorderColorSizer->Add(m_idleNodeBorderColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1075 idleNodeGroup->Add(idleNodeBorderColorSizer, 0, wxEXPAND | wxALL, 3);
1076
1077 // Text color
1078 wxBoxSizer *idleNodeTextColorSizer = new wxBoxSizer(wxHORIZONTAL);
1079 wxStaticText *idleNodeTextColorLabel = new wxStaticText(panel, wxID_ANY, "Text color:");
1080 idleNodeTextColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1081 idleNodeTextColorSizer->Add(idleNodeTextColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1082 m_idleNodeTextColorPicker = new wxColourPickerCtrl(panel, ID_IDLE_NODE_TEXT_COLOR);
1083 idleNodeTextColorSizer->Add(m_idleNodeTextColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1084 idleNodeGroup->Add(idleNodeTextColorSizer, 0, wxEXPAND | wxALL, 3);
1085
1086 nodeAppearanceGroup->Add(idleNodeGroup, 0, wxEXPAND | wxALL, 3);
1087
1088 // === HOVERED NODE SUBSECTION ===
1089 wxStaticBoxSizer *hoveredNodeGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Hovered Node");
1090
1091 // Background tint
1092 wxBoxSizer *hoveredNodeBgTintSizer = new wxBoxSizer(wxHORIZONTAL);
1093 wxStaticText *hoveredNodeBgTintText = new wxStaticText(panel, wxID_ANY, "Background tint:");
1094 hoveredNodeBgTintText->SetForegroundColour(wxColour(200, 200, 200));
1095 hoveredNodeBgTintSizer->Add(hoveredNodeBgTintText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1096 m_hoveredNodeBgTint = new wxSlider(panel, ID_HOVERED_NODE_BG_TINT, -13, -100, 100, wxDefaultPosition,
1097 wxSize(200, -1), wxSL_HORIZONTAL);
1098 m_hoveredNodeBgTint->Bind(wxEVT_MOUSEWHEEL, &PreferencesDialog::OnSliderMouseWheel, this);
1099 hoveredNodeBgTintSizer->Add(m_hoveredNodeBgTint, 1, wxEXPAND | wxRIGHT, 10);
1100 m_hoveredNodeBgTintLabel = new wxStaticText(panel, wxID_ANY, "-13%");
1101 m_hoveredNodeBgTintLabel->SetForegroundColour(wxColour(200, 200, 200));
1102 m_hoveredNodeBgTintLabel->SetMinSize(wxSize(50, -1));
1103 hoveredNodeBgTintSizer->Add(m_hoveredNodeBgTintLabel, 0, wxALIGN_CENTER_VERTICAL);
1104 hoveredNodeGroup->Add(hoveredNodeBgTintSizer, 0, wxEXPAND | wxALL, 3);
1105
1106 // Border color
1107 wxBoxSizer *hoveredNodeColorSizer = new wxBoxSizer(wxHORIZONTAL);
1108 wxStaticText *hoveredNodeColorLabel = new wxStaticText(panel, wxID_ANY, "Border color:");
1109 hoveredNodeColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1110 hoveredNodeColorSizer->Add(hoveredNodeColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1111 m_hoveredNodeColorPicker = new wxColourPickerCtrl(panel, ID_HOVERED_NODE_COLOR);
1112 hoveredNodeColorSizer->Add(m_hoveredNodeColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1113 hoveredNodeGroup->Add(hoveredNodeColorSizer, 0, wxEXPAND | wxALL, 3);
1114
1115 // Text color
1116 wxBoxSizer *hoveredNodeTextColorSizer = new wxBoxSizer(wxHORIZONTAL);
1117 wxStaticText *hoveredNodeTextColorLabel = new wxStaticText(panel, wxID_ANY, "Text color:");
1118 hoveredNodeTextColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1119 hoveredNodeTextColorSizer->Add(hoveredNodeTextColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1120 m_hoveredNodeTextColorPicker = new wxColourPickerCtrl(panel, ID_HOVERED_NODE_TEXT_COLOR);
1121 hoveredNodeTextColorSizer->Add(m_hoveredNodeTextColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1122 hoveredNodeGroup->Add(hoveredNodeTextColorSizer, 0, wxEXPAND | wxALL, 3);
1123
1124 // Info text color
1125 wxBoxSizer *hoveredNodeInfoColorSizer = new wxBoxSizer(wxHORIZONTAL);
1126 wxStaticText *hoveredNodeInfoColorLabel = new wxStaticText(panel, wxID_ANY, "Info text color:");
1127 hoveredNodeInfoColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1128 hoveredNodeInfoColorSizer->Add(hoveredNodeInfoColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1129 m_hoveredNodeInfoColorPicker = new wxColourPickerCtrl(panel, ID_HOVERED_NODE_INFO_COLOR);
1130 hoveredNodeInfoColorSizer->Add(m_hoveredNodeInfoColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1131 hoveredNodeGroup->Add(hoveredNodeInfoColorSizer, 0, wxEXPAND | wxALL, 3);
1132
1133 nodeAppearanceGroup->Add(hoveredNodeGroup, 0, wxEXPAND | wxALL, 3);
1134
1135 // === SELECTED NODE SUBSECTION ===
1136 wxStaticBoxSizer *selectedNodeGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Selected Node");
1137
1138 // Background tint
1139 wxBoxSizer *selectedNodeBgTintSizer = new wxBoxSizer(wxHORIZONTAL);
1140 wxStaticText *selectedNodeBgTintText = new wxStaticText(panel, wxID_ANY, "Background tint:");
1141 selectedNodeBgTintText->SetForegroundColour(wxColour(200, 200, 200));
1142 selectedNodeBgTintSizer->Add(selectedNodeBgTintText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1143 m_selectedNodeBgTint = new wxSlider(panel, ID_SELECTED_NODE_BG_TINT, -33, -100, 100, wxDefaultPosition,
1144 wxSize(200, -1), wxSL_HORIZONTAL);
1145 m_selectedNodeBgTint->Bind(wxEVT_MOUSEWHEEL, &PreferencesDialog::OnSliderMouseWheel, this);
1146 selectedNodeBgTintSizer->Add(m_selectedNodeBgTint, 1, wxEXPAND | wxRIGHT, 10);
1147 m_selectedNodeBgTintLabel = new wxStaticText(panel, wxID_ANY, "-33%");
1148 m_selectedNodeBgTintLabel->SetForegroundColour(wxColour(200, 200, 200));
1149 m_selectedNodeBgTintLabel->SetMinSize(wxSize(50, -1));
1150 selectedNodeBgTintSizer->Add(m_selectedNodeBgTintLabel, 0, wxALIGN_CENTER_VERTICAL);
1151 selectedNodeGroup->Add(selectedNodeBgTintSizer, 0, wxEXPAND | wxALL, 3);
1152
1153 // Border color
1154 wxBoxSizer *selectedNodeColorSizer = new wxBoxSizer(wxHORIZONTAL);
1155 wxStaticText *selectedNodeColorLabel = new wxStaticText(panel, wxID_ANY, "Border color:");
1156 selectedNodeColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1157 selectedNodeColorSizer->Add(selectedNodeColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1158 m_selectedNodeColorPicker = new wxColourPickerCtrl(panel, ID_SELECTED_NODE_COLOR);
1159 selectedNodeColorSizer->Add(m_selectedNodeColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1160 selectedNodeGroup->Add(selectedNodeColorSizer, 0, wxEXPAND | wxALL, 3);
1161
1162 // Text color
1163 wxBoxSizer *selectedNodeTextColorSizer = new wxBoxSizer(wxHORIZONTAL);
1164 wxStaticText *selectedNodeTextColorLabel = new wxStaticText(panel, wxID_ANY, "Text color:");
1165 selectedNodeTextColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1166 selectedNodeTextColorSizer->Add(selectedNodeTextColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1167 m_selectedNodeTextColorPicker = new wxColourPickerCtrl(panel, ID_SELECTED_NODE_TEXT_COLOR);
1168 selectedNodeTextColorSizer->Add(m_selectedNodeTextColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1169 selectedNodeGroup->Add(selectedNodeTextColorSizer, 0, wxEXPAND | wxALL, 3);
1170
1171 // Info text color
1172 wxBoxSizer *selectedNodeInfoColorSizer = new wxBoxSizer(wxHORIZONTAL);
1173 wxStaticText *selectedNodeInfoColorLabel = new wxStaticText(panel, wxID_ANY, "Info text color:");
1174 selectedNodeInfoColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1175 selectedNodeInfoColorSizer->Add(selectedNodeInfoColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1176 m_selectedNodeInfoColorPicker = new wxColourPickerCtrl(panel, ID_SELECTED_NODE_INFO_COLOR);
1177 selectedNodeInfoColorSizer->Add(m_selectedNodeInfoColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1178 selectedNodeGroup->Add(selectedNodeInfoColorSizer, 0, wxEXPAND | wxALL, 3);
1179
1180 nodeAppearanceGroup->Add(selectedNodeGroup, 0, wxEXPAND | wxALL, 3);
1181
1182 panelSizer->Add(nodeAppearanceGroup, 0, wxEXPAND | wxALL, 5);
1183
1184 // ==================== DEBUG TEXT CUSTOMIZATION SECTIONS ====================
1185
1186 // === COORDINATE SYSTEM INFO (Zoom & Pan) ===
1187 wxStaticBoxSizer *coordInfoGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Coordinate System Info (Zoom & Pan)");
1188
1189 m_showCoordinateInfo = new wxCheckBox(panel, ID_SHOW_COORDINATE_INFO, "Show coordinate system info");
1191 m_showCoordinateInfo->SetForegroundColour(wxColour(200, 200, 200));
1192 coordInfoGroup->Add(m_showCoordinateInfo, 0, wxALL, 5);
1193 }
1194
1195 // Font size
1196 wxBoxSizer *coordFontSizeSizer = new wxBoxSizer(wxHORIZONTAL);
1197 wxStaticText *coordFontSizeLabel = new wxStaticText(panel, wxID_ANY, "Font size:");
1198 if (coordFontSizeLabel) {
1199 coordFontSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
1200 coordFontSizeSizer->Add(coordFontSizeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1201 }
1202 m_coordinateInfoFontSize = new wxSpinCtrl(panel, ID_COORDINATE_INFO_FONT_SIZE, "9", wxDefaultPosition,
1203 wxSize(120, -1), wxSP_ARROW_KEYS, 6, 20, 9);
1205 coordFontSizeSizer->Add(m_coordinateInfoFontSize, 0, wxALIGN_CENTER_VERTICAL);
1206 }
1207 if (coordFontSizeSizer->GetItemCount() > 0) {
1208 coordInfoGroup->Add(coordFontSizeSizer, 0, wxEXPAND | wxALL, 5);
1209 }
1210
1211 // Color
1212 wxBoxSizer *coordColorSizer = new wxBoxSizer(wxHORIZONTAL);
1213 wxStaticText *coordColorLabel = new wxStaticText(panel, wxID_ANY, "Text color:");
1214 coordColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1215 coordColorSizer->Add(coordColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1216 m_coordinateInfoColorPicker = new wxColourPickerCtrl(panel, ID_COORDINATE_INFO_COLOR);
1217 coordColorSizer->Add(m_coordinateInfoColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1218 coordInfoGroup->Add(coordColorSizer, 0, wxEXPAND | wxALL, 5);
1219
1220 // Anchor
1221 wxBoxSizer *coordAnchorSizer = new wxBoxSizer(wxHORIZONTAL);
1222 wxStaticText *coordAnchorLabel = new wxStaticText(panel, wxID_ANY, "Anchor:");
1223 coordAnchorLabel->SetForegroundColour(wxColour(200, 200, 200));
1224 coordAnchorSizer->Add(coordAnchorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1225 wxArrayString anchorChoices;
1226 anchorChoices.Add("Top-Left");
1227 anchorChoices.Add("Top-Right");
1228 anchorChoices.Add("Bottom-Left");
1229 anchorChoices.Add("Bottom-Right");
1230 m_coordinateInfoAnchor = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxSize(150, -1), anchorChoices);
1231 m_coordinateInfoAnchor->SetSelection(0);
1232 coordAnchorSizer->Add(m_coordinateInfoAnchor, 0, wxALIGN_CENTER_VERTICAL);
1233 coordInfoGroup->Add(coordAnchorSizer, 0, wxEXPAND | wxALL, 5);
1234
1235 // Position X and Y
1236 wxBoxSizer *coordPosSizer = new wxBoxSizer(wxHORIZONTAL);
1237 wxStaticText *coordPosLabel = new wxStaticText(panel, wxID_ANY, "Offset:");
1238 coordPosLabel->SetForegroundColour(wxColour(200, 200, 200));
1239 coordPosSizer->Add(coordPosLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1240 wxStaticText *coordXLabel = new wxStaticText(panel, wxID_ANY, "X:");
1241 coordXLabel->SetForegroundColour(wxColour(200, 200, 200));
1242 coordPosSizer->Add(coordXLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
1243 m_coordinateInfoX = new wxSpinCtrl(panel, ID_COORDINATE_INFO_X, "10", wxDefaultPosition, wxSize(120, -1),
1244 wxSP_ARROW_KEYS, 0, 9999, 10);
1245 coordPosSizer->Add(m_coordinateInfoX, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1246 wxStaticText *coordYLabel = new wxStaticText(panel, wxID_ANY, "Y:");
1247 coordYLabel->SetForegroundColour(wxColour(200, 200, 200));
1248 coordPosSizer->Add(coordYLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
1249 m_coordinateInfoY = new wxSpinCtrl(panel, ID_COORDINATE_INFO_Y, "10", wxDefaultPosition, wxSize(120, -1),
1250 wxSP_ARROW_KEYS, 0, 9999, 10);
1251 coordPosSizer->Add(m_coordinateInfoY, 0, wxALIGN_CENTER_VERTICAL);
1252 coordInfoGroup->Add(coordPosSizer, 0, wxEXPAND | wxALL, 5);
1253
1254 panelSizer->Add(coordInfoGroup, 0, wxEXPAND | wxALL, 5);
1255
1256 // === SELECTED NODE INFO ===
1257 wxStaticBoxSizer *selectedInfoGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Selected Node Info");
1258
1259 m_showSelectedNodeInfo = new wxCheckBox(panel, ID_SHOW_SELECTED_NODE_INFO, "Show selected node info");
1260 m_showSelectedNodeInfo->SetForegroundColour(wxColour(200, 200, 200));
1261 selectedInfoGroup->Add(m_showSelectedNodeInfo, 0, wxALL, 5);
1262
1263 // Font size
1264 wxBoxSizer *selFontSizeSizer = new wxBoxSizer(wxHORIZONTAL);
1265 wxStaticText *selFontSizeLabel = new wxStaticText(panel, wxID_ANY, "Font size:");
1266 selFontSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
1267 selFontSizeSizer->Add(selFontSizeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1268 m_selectedNodeInfoFontSize = new wxSpinCtrl(panel, ID_SELECTED_NODE_INFO_FONT_SIZE, "9", wxDefaultPosition,
1269 wxSize(120, -1), wxSP_ARROW_KEYS, 6, 20, 9);
1270 selFontSizeSizer->Add(m_selectedNodeInfoFontSize, 0, wxALIGN_CENTER_VERTICAL);
1271 selectedInfoGroup->Add(selFontSizeSizer, 0, wxEXPAND | wxALL, 5);
1272
1273 // Color
1274 wxBoxSizer *selColorSizer = new wxBoxSizer(wxHORIZONTAL);
1275 wxStaticText *selColorLabel = new wxStaticText(panel, wxID_ANY, "Text color:");
1276 selColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1277 selColorSizer->Add(selColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1279 selColorSizer->Add(m_selectedNodeDebugInfoColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1280 selectedInfoGroup->Add(selColorSizer, 0, wxEXPAND | wxALL, 5);
1281
1282 // Anchor
1283 wxBoxSizer *selAnchorSizer = new wxBoxSizer(wxHORIZONTAL);
1284 wxStaticText *selAnchorLabel = new wxStaticText(panel, wxID_ANY, "Anchor:");
1285 selAnchorLabel->SetForegroundColour(wxColour(200, 200, 200));
1286 selAnchorSizer->Add(selAnchorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1287 m_selectedNodeInfoAnchor = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxSize(150, -1), anchorChoices);
1288 m_selectedNodeInfoAnchor->SetSelection(0);
1289 selAnchorSizer->Add(m_selectedNodeInfoAnchor, 0, wxALIGN_CENTER_VERTICAL);
1290 selectedInfoGroup->Add(selAnchorSizer, 0, wxEXPAND | wxALL, 5);
1291
1292 // Position X and Y
1293 wxBoxSizer *selPosSizer = new wxBoxSizer(wxHORIZONTAL);
1294 wxStaticText *selPosLabel = new wxStaticText(panel, wxID_ANY, "Offset:");
1295 selPosLabel->SetForegroundColour(wxColour(200, 200, 200));
1296 selPosSizer->Add(selPosLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1297 wxStaticText *selXLabel = new wxStaticText(panel, wxID_ANY, "X:");
1298 selXLabel->SetForegroundColour(wxColour(200, 200, 200));
1299 selPosSizer->Add(selXLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
1300 m_selectedNodeInfoX = new wxSpinCtrl(panel, ID_SELECTED_NODE_INFO_X, "10", wxDefaultPosition, wxSize(120, -1),
1301 wxSP_ARROW_KEYS, 0, 9999, 10);
1302 selPosSizer->Add(m_selectedNodeInfoX, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1303 wxStaticText *selYLabel = new wxStaticText(panel, wxID_ANY, "Y:");
1304 selYLabel->SetForegroundColour(wxColour(200, 200, 200));
1305 selPosSizer->Add(selYLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
1306 m_selectedNodeInfoY = new wxSpinCtrl(panel, ID_SELECTED_NODE_INFO_Y, "30", wxDefaultPosition, wxSize(120, -1),
1307 wxSP_ARROW_KEYS, 0, 9999, 30);
1308 selPosSizer->Add(m_selectedNodeInfoY, 0, wxALIGN_CENTER_VERTICAL);
1309 selectedInfoGroup->Add(selPosSizer, 0, wxEXPAND | wxALL, 5);
1310
1311 panelSizer->Add(selectedInfoGroup, 0, wxEXPAND | wxALL, 5);
1312
1313 // === TREE STATISTICS INFO ===
1314 wxStaticBoxSizer *treeStatsGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Tree Statistics Info");
1315
1316 m_showTreeInfo = new wxCheckBox(panel, ID_SHOW_TREE_INFO, "Show tree statistics");
1317 m_showTreeInfo->SetForegroundColour(wxColour(200, 200, 200));
1318 treeStatsGroup->Add(m_showTreeInfo, 0, wxALL, 5);
1319
1320 // Font size
1321 wxBoxSizer *treeFontSizeSizer = new wxBoxSizer(wxHORIZONTAL);
1322 wxStaticText *treeFontSizeLabel = new wxStaticText(panel, wxID_ANY, "Font size:");
1323 treeFontSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
1324 treeFontSizeSizer->Add(treeFontSizeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1325 m_treeInfoFontSize = new wxSpinCtrl(panel, ID_TREE_INFO_FONT_SIZE, "9", wxDefaultPosition, wxSize(120, -1),
1326 wxSP_ARROW_KEYS, 6, 20, 9);
1327 treeFontSizeSizer->Add(m_treeInfoFontSize, 0, wxALIGN_CENTER_VERTICAL);
1328 treeStatsGroup->Add(treeFontSizeSizer, 0, wxEXPAND | wxALL, 5);
1329
1330 // Color
1331 wxBoxSizer *treeColorSizer = new wxBoxSizer(wxHORIZONTAL);
1332 wxStaticText *treeColorLabel = new wxStaticText(panel, wxID_ANY, "Text color:");
1333 treeColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1334 treeColorSizer->Add(treeColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1335 m_treeInfoColorPicker = new wxColourPickerCtrl(panel, ID_TREE_INFO_COLOR);
1336 treeColorSizer->Add(m_treeInfoColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1337 treeStatsGroup->Add(treeColorSizer, 0, wxEXPAND | wxALL, 5);
1338
1339 // Anchor
1340 wxBoxSizer *treeAnchorSizer = new wxBoxSizer(wxHORIZONTAL);
1341 wxStaticText *treeAnchorLabel = new wxStaticText(panel, wxID_ANY, "Anchor:");
1342 treeAnchorLabel->SetForegroundColour(wxColour(200, 200, 200));
1343 treeAnchorSizer->Add(treeAnchorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1344 m_treeInfoAnchor = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxSize(150, -1), anchorChoices);
1345 m_treeInfoAnchor->SetSelection(0);
1346 treeAnchorSizer->Add(m_treeInfoAnchor, 0, wxALIGN_CENTER_VERTICAL);
1347 treeStatsGroup->Add(treeAnchorSizer, 0, wxEXPAND | wxALL, 5);
1348
1349 // Position X and Y
1350 wxBoxSizer *treePosSizer = new wxBoxSizer(wxHORIZONTAL);
1351 wxStaticText *treePosLabel = new wxStaticText(panel, wxID_ANY, "Offset:");
1352 treePosLabel->SetForegroundColour(wxColour(200, 200, 200));
1353 treePosSizer->Add(treePosLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1354 wxStaticText *treeXLabel = new wxStaticText(panel, wxID_ANY, "X:");
1355 treeXLabel->SetForegroundColour(wxColour(200, 200, 200));
1356 treePosSizer->Add(treeXLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
1357 m_treeInfoX =
1358 new wxSpinCtrl(panel, ID_TREE_INFO_X, "10", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 0, 9999, 10);
1359 treePosSizer->Add(m_treeInfoX, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1360 wxStaticText *treeYLabel = new wxStaticText(panel, wxID_ANY, "Y:");
1361 treeYLabel->SetForegroundColour(wxColour(200, 200, 200));
1362 treePosSizer->Add(treeYLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
1363 m_treeInfoY =
1364 new wxSpinCtrl(panel, ID_TREE_INFO_Y, "50", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 0, 9999, 50);
1365 treePosSizer->Add(m_treeInfoY, 0, wxALIGN_CENTER_VERTICAL);
1366 treeStatsGroup->Add(treePosSizer, 0, wxEXPAND | wxALL, 5);
1367
1368 panelSizer->Add(treeStatsGroup, 0, wxEXPAND | wxALL, 5);
1369
1370 // === FPS DISPLAY ===
1371 wxStaticBoxSizer *fpsGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "FPS Display");
1372
1373 m_showFPS = new wxCheckBox(panel, wxID_ANY, "Show FPS counter");
1374 m_showFPS->SetForegroundColour(wxColour(200, 200, 200));
1375 fpsGroup->Add(m_showFPS, 0, wxALL, 5);
1376
1377 // Font size
1378 wxBoxSizer *fpsFontSizeSizer = new wxBoxSizer(wxHORIZONTAL);
1379 wxStaticText *fpsFontSizeLabel = new wxStaticText(panel, wxID_ANY, "Font size:");
1380 fpsFontSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
1381 fpsFontSizeSizer->Add(fpsFontSizeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1382 m_fpsFontSize = new wxSpinCtrl(panel, wxID_ANY, "9", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 6, 20, 9);
1383 fpsFontSizeSizer->Add(m_fpsFontSize, 0, wxALIGN_CENTER_VERTICAL);
1384 fpsGroup->Add(fpsFontSizeSizer, 0, wxEXPAND | wxALL, 5);
1385
1386 // Color
1387 wxBoxSizer *fpsColorSizer = new wxBoxSizer(wxHORIZONTAL);
1388 wxStaticText *fpsColorLabel = new wxStaticText(panel, wxID_ANY, "Text color:");
1389 fpsColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1390 fpsColorSizer->Add(fpsColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1391 m_fpsColorPicker = new wxColourPickerCtrl(panel, wxID_ANY);
1392 fpsColorSizer->Add(m_fpsColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1393 fpsGroup->Add(fpsColorSizer, 0, wxEXPAND | wxALL, 5);
1394
1395 // Anchor
1396 wxBoxSizer *fpsAnchorSizer = new wxBoxSizer(wxHORIZONTAL);
1397 wxStaticText *fpsAnchorLabel = new wxStaticText(panel, wxID_ANY, "Anchor:");
1398 fpsAnchorLabel->SetForegroundColour(wxColour(200, 200, 200));
1399 fpsAnchorSizer->Add(fpsAnchorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1400 m_fpsAnchor = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxSize(150, -1), anchorChoices);
1401 m_fpsAnchor->SetSelection(0); // Default to Top-Left
1402 fpsAnchorSizer->Add(m_fpsAnchor, 0, wxALIGN_CENTER_VERTICAL);
1403 fpsGroup->Add(fpsAnchorSizer, 0, wxEXPAND | wxALL, 5);
1404
1405 // Position X and Y
1406 wxBoxSizer *fpsPosSizer = new wxBoxSizer(wxHORIZONTAL);
1407 wxStaticText *fpsPosLabel = new wxStaticText(panel, wxID_ANY, "Offset:");
1408 fpsPosLabel->SetForegroundColour(wxColour(200, 200, 200));
1409 fpsPosSizer->Add(fpsPosLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1410 wxStaticText *fpsXLabel = new wxStaticText(panel, wxID_ANY, "X:");
1411 fpsXLabel->SetForegroundColour(wxColour(200, 200, 200));
1412 fpsPosSizer->Add(fpsXLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
1413 m_fpsX = new wxSpinCtrl(panel, wxID_ANY, "10", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 0, 9999, 10);
1414 fpsPosSizer->Add(m_fpsX, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1415 wxStaticText *fpsYLabel = new wxStaticText(panel, wxID_ANY, "Y:");
1416 fpsYLabel->SetForegroundColour(wxColour(200, 200, 200));
1417 fpsPosSizer->Add(fpsYLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
1418 m_fpsY = new wxSpinCtrl(panel, wxID_ANY, "70", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 0, 9999, 70);
1419 fpsPosSizer->Add(m_fpsY, 0, wxALIGN_CENTER_VERTICAL);
1420 fpsGroup->Add(fpsPosSizer, 0, wxEXPAND | wxALL, 5);
1421
1422 panelSizer->Add(fpsGroup, 0, wxEXPAND | wxALL, 5);
1423
1424 // === CONTROLS HELP TEXT ===
1425 wxStaticBoxSizer *controlsHelpGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Controls Help Text");
1426
1427 m_showControlsHelp = new wxCheckBox(panel, ID_SHOW_CONTROLS_HELP, "Show controls/hotkeys help");
1428 m_showControlsHelp->SetForegroundColour(wxColour(200, 200, 200));
1429 controlsHelpGroup->Add(m_showControlsHelp, 0, wxALL, 5);
1430
1431 // Font size
1432 wxBoxSizer *ctrlFontSizeSizer = new wxBoxSizer(wxHORIZONTAL);
1433 wxStaticText *ctrlFontSizeLabel = new wxStaticText(panel, wxID_ANY, "Font size:");
1434 ctrlFontSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
1435 ctrlFontSizeSizer->Add(ctrlFontSizeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1436 m_controlsHelpFontSize = new wxSpinCtrl(panel, ID_CONTROLS_HELP_FONT_SIZE, "11", wxDefaultPosition, wxSize(120, -1),
1437 wxSP_ARROW_KEYS, 6, 20, 11);
1438 ctrlFontSizeSizer->Add(m_controlsHelpFontSize, 0, wxALIGN_CENTER_VERTICAL);
1439 controlsHelpGroup->Add(ctrlFontSizeSizer, 0, wxEXPAND | wxALL, 5);
1440
1441 // Color
1442 wxBoxSizer *ctrlColorSizer = new wxBoxSizer(wxHORIZONTAL);
1443 wxStaticText *ctrlColorLabel = new wxStaticText(panel, wxID_ANY, "Text color:");
1444 ctrlColorLabel->SetForegroundColour(wxColour(200, 200, 200));
1445 ctrlColorSizer->Add(ctrlColorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1446 m_controlsHelpColorPicker = new wxColourPickerCtrl(panel, ID_CONTROLS_HELP_COLOR);
1447 ctrlColorSizer->Add(m_controlsHelpColorPicker, 0, wxALIGN_CENTER_VERTICAL);
1448 controlsHelpGroup->Add(ctrlColorSizer, 0, wxEXPAND | wxALL, 5);
1449
1450 // Anchor
1451 wxBoxSizer *ctrlAnchorSizer = new wxBoxSizer(wxHORIZONTAL);
1452 wxStaticText *ctrlAnchorLabel = new wxStaticText(panel, wxID_ANY, "Anchor:");
1453 ctrlAnchorLabel->SetForegroundColour(wxColour(200, 200, 200));
1454 ctrlAnchorSizer->Add(ctrlAnchorLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1455 m_controlsHelpAnchor = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxSize(150, -1), anchorChoices);
1456 m_controlsHelpAnchor->SetSelection(2); // Default to Bottom-Left
1457 ctrlAnchorSizer->Add(m_controlsHelpAnchor, 0, wxALIGN_CENTER_VERTICAL);
1458 controlsHelpGroup->Add(ctrlAnchorSizer, 0, wxEXPAND | wxALL, 5);
1459
1460 // Position X and Y
1461 wxBoxSizer *ctrlPosSizer = new wxBoxSizer(wxHORIZONTAL);
1462 wxStaticText *ctrlPosLabel = new wxStaticText(panel, wxID_ANY, "Offset:");
1463 ctrlPosLabel->SetForegroundColour(wxColour(200, 200, 200));
1464 ctrlPosSizer->Add(ctrlPosLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1465 wxStaticText *ctrlXLabel = new wxStaticText(panel, wxID_ANY, "X:");
1466 ctrlXLabel->SetForegroundColour(wxColour(200, 200, 200));
1467 ctrlPosSizer->Add(ctrlXLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
1468 m_controlsHelpX = new wxSpinCtrl(panel, ID_CONTROLS_HELP_X, "10", wxDefaultPosition, wxSize(120, -1),
1469 wxSP_ARROW_KEYS, 0, 9999, 10);
1470 ctrlPosSizer->Add(m_controlsHelpX, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1471 wxStaticText *ctrlYLabel = new wxStaticText(panel, wxID_ANY, "Y:");
1472 ctrlYLabel->SetForegroundColour(wxColour(200, 200, 200));
1473 ctrlPosSizer->Add(ctrlYLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
1474 m_controlsHelpY = new wxSpinCtrl(panel, ID_CONTROLS_HELP_Y, "25", wxDefaultPosition, wxSize(120, -1),
1475 wxSP_ARROW_KEYS, 0, 9999, 25);
1476 ctrlPosSizer->Add(m_controlsHelpY, 0, wxALIGN_CENTER_VERTICAL);
1477 controlsHelpGroup->Add(ctrlPosSizer, 0, wxEXPAND | wxALL, 5);
1478
1479 panelSizer->Add(controlsHelpGroup, 0, wxEXPAND | wxALL, 5);
1480
1481 panelSizer->AddStretchSpacer();
1482
1483 panel->SetSizer(panelSizer);
1484 return panel;
1485}
1486
1488 wxPanel *panel = new wxPanel(parent, wxID_ANY);
1489 panel->SetBackgroundColour(wxColour(50, 50, 50));
1490 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
1491
1492 // Panel Layout group
1493 wxStaticBoxSizer *layoutGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Panel Layout");
1494
1495 // Default panel height
1496 wxBoxSizer *heightSizer = new wxBoxSizer(wxHORIZONTAL);
1497
1499 new wxCheckBox(panel, ID_BOTTOM_PANEL_HEIGHT_ENABLED, "Default panel height (pixels):");
1500 m_bottomPanelHeightEnabled->SetForegroundColour(wxColour(200, 200, 200));
1501 m_bottomPanelHeightEnabled->SetValue(true);
1503 heightSizer->Add(m_bottomPanelHeightEnabled, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1504
1506 new wxSpinCtrl(panel, wxID_ANY, "200", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 50, 1000, 200);
1507 heightSizer->Add(m_bottomPanelHeight, 0, wxALIGN_CENTER_VERTICAL);
1508 layoutGroup->Add(heightSizer, 0, wxEXPAND | wxALL, 5);
1509
1510 // Minimum panel height
1511 wxBoxSizer *minHeightSizer = new wxBoxSizer(wxHORIZONTAL);
1512
1514 new wxCheckBox(panel, ID_BOTTOM_PANEL_MIN_HEIGHT_ENABLED, "Minimum panel height (pixels):");
1515 m_bottomPanelMinHeightEnabled->SetForegroundColour(wxColour(200, 200, 200));
1516 m_bottomPanelMinHeightEnabled->SetValue(true);
1518 minHeightSizer->Add(m_bottomPanelMinHeightEnabled, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1519
1521 new wxSpinCtrl(panel, wxID_ANY, "100", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 0, 1000, 100);
1522 minHeightSizer->Add(m_bottomPanelMinHeight, 0, wxALIGN_CENTER_VERTICAL);
1523 layoutGroup->Add(minHeightSizer, 0, wxEXPAND | wxALL, 5);
1524
1525 // Show panel on startup
1526 wxBoxSizer *startupSizer = new wxBoxSizer(wxHORIZONTAL);
1527 wxStaticText *startupLabel = new wxStaticText(panel, wxID_ANY, "On startup:");
1528 startupLabel->SetForegroundColour(wxColour(200, 200, 200));
1529 startupSizer->Add(startupLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1530
1531 wxArrayString startupOptions;
1532 startupOptions.Add("Show panel");
1533 startupOptions.Add("Hide panel");
1534 startupOptions.Add("Remember last state");
1535 m_bottomPanelStartup = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, startupOptions);
1536 m_bottomPanelStartup->SetSelection(0);
1537 startupSizer->Add(m_bottomPanelStartup, 1, wxEXPAND);
1538 layoutGroup->Add(startupSizer, 0, wxEXPAND | wxALL, 5);
1539
1540 panelSizer->Add(layoutGroup, 0, wxEXPAND | wxALL, 5);
1541
1542 // Tab Bar group
1543 wxStaticBoxSizer *tabBarGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Tab Bar");
1544
1545 m_showTabCloseButtons = new wxCheckBox(panel, wxID_ANY, "Show close buttons on tabs");
1546 m_showTabCloseButtons->SetForegroundColour(wxColour(200, 200, 200));
1547 m_showTabCloseButtons->SetValue(true);
1548 tabBarGroup->Add(m_showTabCloseButtons, 0, wxALL, 5);
1549
1550 panelSizer->Add(tabBarGroup, 0, wxEXPAND | wxALL, 5);
1551
1552 // Behavior group
1553 wxStaticBoxSizer *behaviorGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Behavior");
1554
1555 m_rememberLastTab = new wxCheckBox(panel, wxID_ANY, "Remember last active tab between sessions");
1556 m_rememberLastTab->SetForegroundColour(wxColour(200, 200, 200));
1557 m_rememberLastTab->SetValue(true);
1558 behaviorGroup->Add(m_rememberLastTab, 0, wxALL, 5);
1559
1560 m_allowPanelCollapse = new wxCheckBox(panel, wxID_ANY, "Allow panel collapse (drag splitter to hide)");
1561 m_allowPanelCollapse->SetForegroundColour(wxColour(200, 200, 200));
1562 m_allowPanelCollapse->SetValue(true);
1563 behaviorGroup->Add(m_allowPanelCollapse, 0, wxALL, 5);
1564
1565 panelSizer->Add(behaviorGroup, 0, wxEXPAND | wxALL, 5);
1566 panelSizer->AddStretchSpacer();
1567
1568 panel->SetSizer(panelSizer);
1569 return panel;
1570}
1571
1573 wxPanel *panel = new wxPanel(parent, wxID_ANY);
1574 panel->SetBackgroundColour(wxColour(50, 50, 50));
1575 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
1576
1577 // General Settings group
1578 wxStaticBoxSizer *generalGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "General");
1579
1580 m_showBreadcrumb = new wxCheckBox(panel, wxID_ANY, "Show breadcrumb navigation");
1581 m_showBreadcrumb->SetForegroundColour(wxColour(200, 200, 200));
1582 generalGroup->Add(m_showBreadcrumb, 0, wxALL, 5);
1583
1584 m_showHistory = new wxCheckBox(panel, wxID_ANY, "Show navigation history button");
1585 m_showHistory->SetForegroundColour(wxColour(200, 200, 200));
1586 generalGroup->Add(m_showHistory, 0, wxALL, 5);
1587
1588 // Start Path Mode
1589 wxBoxSizer *startPathSizer = new wxBoxSizer(wxHORIZONTAL);
1590 wxStaticText *startPathLabel = new wxStaticText(panel, wxID_ANY, "Default start path:");
1591 startPathLabel->SetForegroundColour(wxColour(200, 200, 200));
1592 startPathSizer->Add(startPathLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1593
1594 wxArrayString startPathOptions;
1595 startPathOptions.Add("Executable Directory");
1596 startPathOptions.Add("Custom Path");
1597 m_startPathMode = new wxChoice(panel, ID_START_PATH_MODE, wxDefaultPosition, wxDefaultSize, startPathOptions);
1598 startPathSizer->Add(m_startPathMode, 1, wxEXPAND);
1599 generalGroup->Add(startPathSizer, 0, wxEXPAND | wxALL, 5);
1600
1601 // Custom Path
1602 wxBoxSizer *customPathSizer = new wxBoxSizer(wxHORIZONTAL);
1603 wxStaticText *customPathLabel = new wxStaticText(panel, wxID_ANY, "Custom path:");
1604 customPathLabel->SetForegroundColour(wxColour(200, 200, 200));
1605 customPathSizer->Add(customPathLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1606
1607 m_customStartPath = new wxTextCtrl(panel, ID_CUSTOM_START_PATH);
1608 m_customStartPath->SetBackgroundColour(wxColour(60, 60, 60));
1609 m_customStartPath->SetForegroundColour(wxColour(200, 200, 200));
1610 customPathSizer->Add(m_customStartPath, 1, wxEXPAND | wxRIGHT, 5);
1611
1612 m_browseStartPath = new wxButton(panel, ID_BROWSE_START_PATH, "Browse...", wxDefaultPosition, wxSize(80, -1));
1613 customPathSizer->Add(m_browseStartPath, 0);
1614 generalGroup->Add(customPathSizer, 0, wxEXPAND | wxALL, 5);
1615
1616 // Bind events
1618 m_browseStartPath->Bind(wxEVT_BUTTON, &PreferencesDialog::OnBrowseStartPath, this);
1619
1620 panelSizer->Add(generalGroup, 0, wxEXPAND | wxALL, 5);
1621
1622 // Tree View Settings group
1623 wxStaticBoxSizer *treeViewGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Tree View");
1624
1625 m_treeShowHiddenFiles = new wxCheckBox(panel, ID_TREE_SHOW_HIDDEN_FILES, "Show hidden files");
1626 m_treeShowHiddenFiles->SetForegroundColour(wxColour(200, 200, 200));
1627 treeViewGroup->Add(m_treeShowHiddenFiles, 0, wxALL, 5);
1628
1629 m_treeShowFileExtensions = new wxCheckBox(panel, ID_TREE_SHOW_EXTENSIONS, "Show file extensions");
1630 m_treeShowFileExtensions->SetForegroundColour(wxColour(200, 200, 200));
1631 treeViewGroup->Add(m_treeShowFileExtensions, 0, wxALL, 5);
1632
1633 // Tree Sort by
1634 wxBoxSizer *treeSortBySizer = new wxBoxSizer(wxHORIZONTAL);
1635 wxStaticText *treeSortByLabel = new wxStaticText(panel, wxID_ANY, "Sort files by:");
1636 treeSortByLabel->SetForegroundColour(wxColour(200, 200, 200));
1637 treeSortBySizer->Add(treeSortByLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1638
1639 wxArrayString sortOptions;
1640 sortOptions.Add("Name");
1641 sortOptions.Add("Date");
1642 sortOptions.Add("Size");
1643 sortOptions.Add("Type");
1644 m_treeSortFilesBy = new wxChoice(panel, ID_TREE_SORT_FILES_BY, wxDefaultPosition, wxDefaultSize, sortOptions);
1645 treeSortBySizer->Add(m_treeSortFilesBy, 1, wxEXPAND);
1646 treeViewGroup->Add(treeSortBySizer, 0, wxEXPAND | wxALL, 5);
1647
1648 // Tree Item Size
1649 wxBoxSizer *treeItemSizeSizer = new wxBoxSizer(wxHORIZONTAL);
1650 wxStaticText *treeItemSizeLabel = new wxStaticText(panel, wxID_ANY, "Item size:");
1651 treeItemSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
1652 treeItemSizeSizer->Add(treeItemSizeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1653
1654 wxArrayString treeItemSizeOptions;
1655 treeItemSizeOptions.Add("Small (Compact)");
1656 treeItemSizeOptions.Add("Medium (Standard)");
1657 treeItemSizeOptions.Add("Large (Spacious)");
1658 m_treeItemSize = new wxChoice(panel, ID_TREE_ITEM_SIZE, wxDefaultPosition, wxDefaultSize, treeItemSizeOptions);
1659 treeItemSizeSizer->Add(m_treeItemSize, 1, wxEXPAND);
1660 treeViewGroup->Add(treeItemSizeSizer, 0, wxEXPAND | wxALL, 5);
1661
1662 panelSizer->Add(treeViewGroup, 0, wxEXPAND | wxALL, 5);
1663
1664 // Grid View Settings group
1665 wxStaticBoxSizer *gridViewGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Grid View");
1666
1667 m_gridShowHiddenFiles = new wxCheckBox(panel, ID_GRID_SHOW_HIDDEN_FILES, "Show hidden files");
1668 m_gridShowHiddenFiles->SetForegroundColour(wxColour(200, 200, 200));
1669 gridViewGroup->Add(m_gridShowHiddenFiles, 0, wxALL, 5);
1670
1671 m_gridShowFileExtensions = new wxCheckBox(panel, ID_GRID_SHOW_EXTENSIONS, "Show file extensions");
1672 m_gridShowFileExtensions->SetForegroundColour(wxColour(200, 200, 200));
1673 gridViewGroup->Add(m_gridShowFileExtensions, 0, wxALL, 5);
1674
1675 // Grid Sort by
1676 wxBoxSizer *gridSortBySizer = new wxBoxSizer(wxHORIZONTAL);
1677 wxStaticText *gridSortByLabel = new wxStaticText(panel, wxID_ANY, "Sort files by:");
1678 gridSortByLabel->SetForegroundColour(wxColour(200, 200, 200));
1679 gridSortBySizer->Add(gridSortByLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1680
1681 m_gridSortFilesBy = new wxChoice(panel, ID_GRID_SORT_FILES_BY, wxDefaultPosition, wxDefaultSize, sortOptions);
1682 gridSortBySizer->Add(m_gridSortFilesBy, 1, wxEXPAND);
1683 gridViewGroup->Add(gridSortBySizer, 0, wxEXPAND | wxALL, 5);
1684
1685 // Icon Size
1686 wxBoxSizer *iconSizeSizer = new wxBoxSizer(wxHORIZONTAL);
1687 wxStaticText *iconSizeLabel = new wxStaticText(panel, wxID_ANY, "Icon size:");
1688 iconSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
1689 iconSizeSizer->Add(iconSizeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1690
1691 wxArrayString iconSizeOptions;
1692 iconSizeOptions.Add("Small (48x48)");
1693 iconSizeOptions.Add("Medium (80x80)");
1694 iconSizeOptions.Add("Large (128x128)");
1695 m_gridIconSize = new wxChoice(panel, ID_GRID_ICON_SIZE, wxDefaultPosition, wxDefaultSize, iconSizeOptions);
1696 iconSizeSizer->Add(m_gridIconSize, 1, wxEXPAND);
1697 gridViewGroup->Add(iconSizeSizer, 0, wxEXPAND | wxALL, 5);
1698
1699 panelSizer->Add(gridViewGroup, 0, wxEXPAND | wxALL, 5);
1700 panelSizer->AddStretchSpacer();
1701
1702 panel->SetSizer(panelSizer);
1703 return panel;
1704}
1705
1707 // Global side panel settings (currently empty - reserved for future global settings)
1708 wxPanel *panel = new wxPanel(parent, wxID_ANY);
1709 panel->SetBackgroundColour(wxColour(50, 50, 50));
1710 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
1711
1712 wxStaticText *infoText = new wxStaticText(panel, wxID_ANY,
1713 "Global settings for all side panels.\n\n"
1714 "Configure individual panels:\n"
1715 " • Left Panel - Settings for the left side panel\n"
1716 " • Right Panel - Settings for the right side panel\n"
1717 " • Bottom Panel - Settings for the bottom panel");
1718 infoText->SetForegroundColour(wxColour(180, 180, 180));
1719 panelSizer->Add(infoText, 0, wxALL, 10);
1720
1721 panelSizer->AddStretchSpacer();
1722
1723 panel->SetSizer(panelSizer);
1724 return panel;
1725}
1726
1728 // Placeholder panel for "Tabs" submenu (navigation node)
1729 wxPanel *panel = new wxPanel(parent, wxID_ANY);
1730 panel->SetBackgroundColour(wxColour(50, 50, 50));
1731 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
1732
1733 wxStaticText *infoText = new wxStaticText(panel, wxID_ANY,
1734 "Tab-specific settings.\n\n"
1735 "Configure individual tabs:\n"
1736 " • File Explorer Tab - Settings for file browsing\n"
1737 " • Log Tab - Settings for log display\n"
1738 " • Scene Hierarchy Tab - Settings for scene hierarchy display");
1739 infoText->SetForegroundColour(wxColour(180, 180, 180));
1740 panelSizer->Add(infoText, 0, wxALL, 10);
1741
1742 panelSizer->AddStretchSpacer();
1743
1744 panel->SetSizer(panelSizer);
1745 return panel;
1746}
1747
1749 wxPanel *panel = new wxPanel(parent, wxID_ANY);
1750 panel->SetBackgroundColour(wxColour(50, 50, 50));
1751 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
1752
1753 // Panel Layout group
1754 wxStaticBoxSizer *layoutGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Panel Layout");
1755
1756 // Default panel width
1757 wxBoxSizer *widthSizer = new wxBoxSizer(wxHORIZONTAL);
1758
1759 m_leftPanelWidthEnabled = new wxCheckBox(panel, ID_LEFT_PANEL_WIDTH_ENABLED, "Default panel width (pixels):");
1760 m_leftPanelWidthEnabled->SetForegroundColour(wxColour(200, 200, 200));
1761 m_leftPanelWidthEnabled->SetValue(true);
1763 widthSizer->Add(m_leftPanelWidthEnabled, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1764
1766 new wxSpinCtrl(panel, wxID_ANY, "250", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 100, 800, 250);
1767 widthSizer->Add(m_leftPanelWidth, 0, wxALIGN_CENTER_VERTICAL);
1768 layoutGroup->Add(widthSizer, 0, wxEXPAND | wxALL, 5);
1769
1770 // Minimum panel width
1771 wxBoxSizer *minWidthSizer = new wxBoxSizer(wxHORIZONTAL);
1772
1774 new wxCheckBox(panel, ID_LEFT_PANEL_MIN_WIDTH_ENABLED, "Minimum panel width (pixels):");
1775 m_leftPanelMinWidthEnabled->SetForegroundColour(wxColour(200, 200, 200));
1776 m_leftPanelMinWidthEnabled->SetValue(true);
1778 minWidthSizer->Add(m_leftPanelMinWidthEnabled, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1779
1781 new wxSpinCtrl(panel, wxID_ANY, "150", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 50, 500, 150);
1782 minWidthSizer->Add(m_leftPanelMinWidth, 0, wxALIGN_CENTER_VERTICAL);
1783 layoutGroup->Add(minWidthSizer, 0, wxEXPAND | wxALL, 5);
1784
1785 // Show panel on startup
1786 wxBoxSizer *startupSizer = new wxBoxSizer(wxHORIZONTAL);
1787 wxStaticText *startupLabel = new wxStaticText(panel, wxID_ANY, "On startup:");
1788 startupLabel->SetForegroundColour(wxColour(200, 200, 200));
1789 startupSizer->Add(startupLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1790
1791 wxArrayString startupOptions;
1792 startupOptions.Add("Show panel");
1793 startupOptions.Add("Hide panel");
1794 startupOptions.Add("Remember last state");
1795 m_leftPanelStartup = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, startupOptions);
1796 m_leftPanelStartup->SetSelection(0);
1797 startupSizer->Add(m_leftPanelStartup, 1, wxEXPAND);
1798 layoutGroup->Add(startupSizer, 0, wxEXPAND | wxALL, 5);
1799
1800 panelSizer->Add(layoutGroup, 0, wxEXPAND | wxALL, 5);
1801
1802 // Tab Bar group
1803 wxStaticBoxSizer *tabBarGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Tab Bar");
1804
1805 m_leftPanelShowTabCloseButtons = new wxCheckBox(panel, wxID_ANY, "Show close buttons on tabs");
1806 m_leftPanelShowTabCloseButtons->SetForegroundColour(wxColour(200, 200, 200));
1807 m_leftPanelShowTabCloseButtons->SetValue(true);
1808 tabBarGroup->Add(m_leftPanelShowTabCloseButtons, 0, wxALL, 5);
1809
1810 panelSizer->Add(tabBarGroup, 0, wxEXPAND | wxALL, 5);
1811
1812 // Behavior group
1813 wxStaticBoxSizer *behaviorGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Behavior");
1814
1815 m_leftPanelRememberLastTab = new wxCheckBox(panel, wxID_ANY, "Remember last active tab between sessions");
1816 m_leftPanelRememberLastTab->SetForegroundColour(wxColour(200, 200, 200));
1817 m_leftPanelRememberLastTab->SetValue(true);
1818 behaviorGroup->Add(m_leftPanelRememberLastTab, 0, wxALL, 5);
1819
1820 m_leftPanelAllowCollapse = new wxCheckBox(panel, wxID_ANY, "Allow panel collapse (drag splitter to hide)");
1821 m_leftPanelAllowCollapse->SetForegroundColour(wxColour(200, 200, 200));
1822 m_leftPanelAllowCollapse->SetValue(true);
1823 behaviorGroup->Add(m_leftPanelAllowCollapse, 0, wxALL, 5);
1824
1825 panelSizer->Add(behaviorGroup, 0, wxEXPAND | wxALL, 5);
1826 panelSizer->AddStretchSpacer();
1827
1828 panel->SetSizer(panelSizer);
1829 return panel;
1830}
1831
1833 wxPanel *panel = new wxPanel(parent, wxID_ANY);
1834 panel->SetBackgroundColour(wxColour(50, 50, 50));
1835 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
1836
1837 // Panel Layout group
1838 wxStaticBoxSizer *layoutGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Panel Layout");
1839
1840 // Default panel width
1841 wxBoxSizer *widthSizer = new wxBoxSizer(wxHORIZONTAL);
1842
1843 m_rightPanelWidthEnabled = new wxCheckBox(panel, ID_RIGHT_PANEL_WIDTH_ENABLED, "Default panel width (pixels):");
1844 m_rightPanelWidthEnabled->SetForegroundColour(wxColour(200, 200, 200));
1845 m_rightPanelWidthEnabled->SetValue(true);
1847 widthSizer->Add(m_rightPanelWidthEnabled, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1848
1850 new wxSpinCtrl(panel, wxID_ANY, "250", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 100, 800, 250);
1851 widthSizer->Add(m_rightPanelWidth, 0, wxALIGN_CENTER_VERTICAL);
1852 layoutGroup->Add(widthSizer, 0, wxEXPAND | wxALL, 5);
1853
1854 // Minimum panel width
1855 wxBoxSizer *minWidthSizer = new wxBoxSizer(wxHORIZONTAL);
1856
1858 new wxCheckBox(panel, ID_RIGHT_PANEL_MIN_WIDTH_ENABLED, "Minimum panel width (pixels):");
1859 m_rightPanelMinWidthEnabled->SetForegroundColour(wxColour(200, 200, 200));
1860 m_rightPanelMinWidthEnabled->SetValue(true);
1862 minWidthSizer->Add(m_rightPanelMinWidthEnabled, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1863
1865 new wxSpinCtrl(panel, wxID_ANY, "150", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 50, 500, 150);
1866 minWidthSizer->Add(m_rightPanelMinWidth, 0, wxALIGN_CENTER_VERTICAL);
1867 layoutGroup->Add(minWidthSizer, 0, wxEXPAND | wxALL, 5);
1868
1869 // Show panel on startup
1870 wxBoxSizer *startupSizer = new wxBoxSizer(wxHORIZONTAL);
1871 wxStaticText *startupLabel = new wxStaticText(panel, wxID_ANY, "On startup:");
1872 startupLabel->SetForegroundColour(wxColour(200, 200, 200));
1873 startupSizer->Add(startupLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1874
1875 wxArrayString startupOptions;
1876 startupOptions.Add("Show panel");
1877 startupOptions.Add("Hide panel");
1878 startupOptions.Add("Remember last state");
1879 m_rightPanelStartup = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, startupOptions);
1880 m_rightPanelStartup->SetSelection(0);
1881 startupSizer->Add(m_rightPanelStartup, 1, wxEXPAND);
1882 layoutGroup->Add(startupSizer, 0, wxEXPAND | wxALL, 5);
1883
1884 panelSizer->Add(layoutGroup, 0, wxEXPAND | wxALL, 5);
1885
1886 // Tab Bar group
1887 wxStaticBoxSizer *tabBarGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Tab Bar");
1888
1889 m_rightPanelShowTabCloseButtons = new wxCheckBox(panel, wxID_ANY, "Show close buttons on tabs");
1890 m_rightPanelShowTabCloseButtons->SetForegroundColour(wxColour(200, 200, 200));
1891 m_rightPanelShowTabCloseButtons->SetValue(true);
1892 tabBarGroup->Add(m_rightPanelShowTabCloseButtons, 0, wxALL, 5);
1893
1894 panelSizer->Add(tabBarGroup, 0, wxEXPAND | wxALL, 5);
1895
1896 // Behavior group
1897 wxStaticBoxSizer *behaviorGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Behavior");
1898
1899 m_rightPanelRememberLastTab = new wxCheckBox(panel, wxID_ANY, "Remember last active tab between sessions");
1900 m_rightPanelRememberLastTab->SetForegroundColour(wxColour(200, 200, 200));
1901 m_rightPanelRememberLastTab->SetValue(true);
1902 behaviorGroup->Add(m_rightPanelRememberLastTab, 0, wxALL, 5);
1903
1904 m_rightPanelAllowCollapse = new wxCheckBox(panel, wxID_ANY, "Allow panel collapse (drag splitter to hide)");
1905 m_rightPanelAllowCollapse->SetForegroundColour(wxColour(200, 200, 200));
1906 m_rightPanelAllowCollapse->SetValue(true);
1907 behaviorGroup->Add(m_rightPanelAllowCollapse, 0, wxALL, 5);
1908
1909 panelSizer->Add(behaviorGroup, 0, wxEXPAND | wxALL, 5);
1910 panelSizer->AddStretchSpacer();
1911
1912 panel->SetSizer(panelSizer);
1913 return panel;
1914}
1915
1917 wxPanel *panel = new wxPanel(parent, wxID_ANY);
1918 panel->SetBackgroundColour(wxColour(50, 50, 50));
1919
1920 wxScrolledWindow *scrolled = new wxScrolledWindow(panel, wxID_ANY);
1921 scrolled->SetScrollRate(5, 5);
1922 scrolled->SetBackgroundColour(wxColour(50, 50, 50));
1923
1924 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
1925 wxBoxSizer *scrolledSizer = new wxBoxSizer(wxVERTICAL);
1926
1927 // ===== DISPLAY SETTINGS =====
1928 wxStaticBoxSizer *displayGroup = new wxStaticBoxSizer(wxVERTICAL, scrolled, "Display Settings");
1929
1930 m_hierarchyShowSearchBar = new wxCheckBox(scrolled, wxID_ANY, "Show search bar");
1931 m_hierarchyShowSearchBar->SetForegroundColour(wxColour(200, 200, 200));
1932 displayGroup->Add(m_hierarchyShowSearchBar, 0, wxALL, 5);
1933
1934 m_hierarchyShowNodeIcons = new wxCheckBox(scrolled, wxID_ANY, "Show node icons");
1935 m_hierarchyShowNodeIcons->SetForegroundColour(wxColour(200, 200, 200));
1936 displayGroup->Add(m_hierarchyShowNodeIcons, 0, wxALL, 5);
1937
1938 m_hierarchyShowTreeLines = new wxCheckBox(scrolled, wxID_ANY, "Show tree connecting lines");
1939 m_hierarchyShowTreeLines->SetForegroundColour(wxColour(200, 200, 200));
1940 displayGroup->Add(m_hierarchyShowTreeLines, 0, wxALL, 5);
1941
1942 // Tree indentation
1943 wxBoxSizer *indentSizer = new wxBoxSizer(wxHORIZONTAL);
1944 wxStaticText *indentLabel = new wxStaticText(scrolled, wxID_ANY, "Tree indentation (pixels):");
1945 indentLabel->SetForegroundColour(wxColour(200, 200, 200));
1946 indentSizer->Add(indentLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1948 new wxSpinCtrl(scrolled, wxID_ANY, "16", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 10, 30, 16);
1949 indentSizer->Add(m_hierarchyTreeIndentationSize, 0, wxALIGN_CENTER_VERTICAL);
1950 displayGroup->Add(indentSizer, 0, wxEXPAND | wxALL, 5);
1951
1952 // Icon size
1953 wxBoxSizer *iconSizeSizer = new wxBoxSizer(wxHORIZONTAL);
1954 wxStaticText *iconSizeLabel = new wxStaticText(scrolled, wxID_ANY, "Icon size:");
1955 iconSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
1956 iconSizeSizer->Add(iconSizeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1957 wxArrayString iconSizeChoices;
1958 iconSizeChoices.Add("Small (16px)");
1959 iconSizeChoices.Add("Medium (20px)");
1960 iconSizeChoices.Add("Large (24px)");
1961 m_hierarchyIconSize = new wxChoice(scrolled, wxID_ANY, wxDefaultPosition, wxSize(120, -1), iconSizeChoices);
1962 m_hierarchyIconSize->SetSelection(0); // Default to Small
1963 iconSizeSizer->Add(m_hierarchyIconSize, 0, wxALIGN_CENTER_VERTICAL);
1964 displayGroup->Add(iconSizeSizer, 0, wxEXPAND | wxALL, 5);
1965
1966 // Font size
1967 wxBoxSizer *fontSizeSizer = new wxBoxSizer(wxHORIZONTAL);
1968 wxStaticText *fontSizeLabel = new wxStaticText(scrolled, wxID_ANY, "Font size:");
1969 fontSizeLabel->SetForegroundColour(wxColour(200, 200, 200));
1970 fontSizeSizer->Add(fontSizeLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
1972 new wxSpinCtrl(scrolled, wxID_ANY, "9", wxDefaultPosition, wxSize(120, -1), wxSP_ARROW_KEYS, 8, 14, 9);
1973 fontSizeSizer->Add(m_hierarchyFontSize, 0, wxALIGN_CENTER_VERTICAL);
1974 displayGroup->Add(fontSizeSizer, 0, wxEXPAND | wxALL, 5);
1975
1976 scrolledSizer->Add(displayGroup, 0, wxEXPAND | wxALL, 5);
1977
1978 // NOTE: Color Settings removed - GTK controls the selection colors, custom colors don't work
1979
1980 // ===== BEHAVIOR SETTINGS =====
1981 wxStaticBoxSizer *behaviorGroup = new wxStaticBoxSizer(wxVERTICAL, scrolled, "Behavior Settings");
1982
1983 m_hierarchyAutoExpandOnLoad = new wxCheckBox(scrolled, wxID_ANY, "Auto-expand tree when loading");
1984 m_hierarchyAutoExpandOnLoad->SetForegroundColour(wxColour(200, 200, 200));
1985 behaviorGroup->Add(m_hierarchyAutoExpandOnLoad, 0, wxALL, 5);
1986
1988 new wxCheckBox(scrolled, wxID_ANY, "Sync selection with main canvas (also auto-scrolls)");
1989 m_hierarchySyncWithCanvas->SetForegroundColour(wxColour(200, 200, 200));
1990 behaviorGroup->Add(m_hierarchySyncWithCanvas, 0, wxALL, 5);
1991
1992 m_hierarchyLiveSearch = new wxCheckBox(scrolled, wxID_ANY, "Live search (search as you type)");
1993 m_hierarchyLiveSearch->SetForegroundColour(wxColour(200, 200, 200));
1994 behaviorGroup->Add(m_hierarchyLiveSearch, 0, wxALL, 5);
1995
1996 // Double-click action
1997 wxBoxSizer *doubleClickSizer = new wxBoxSizer(wxHORIZONTAL);
1998 wxStaticText *doubleClickLabel = new wxStaticText(scrolled, wxID_ANY, "Double-click action:");
1999 doubleClickLabel->SetForegroundColour(wxColour(200, 200, 200));
2000 doubleClickSizer->Add(doubleClickLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
2001 wxArrayString doubleClickOptions;
2002 doubleClickOptions.Add("Expand/Collapse");
2003 doubleClickOptions.Add("Rename");
2004 doubleClickOptions.Add("Center in Canvas");
2006 new wxChoice(scrolled, wxID_ANY, wxDefaultPosition, wxSize(150, -1), doubleClickOptions);
2007 m_hierarchyDoubleClickAction->SetSelection(0);
2008 doubleClickSizer->Add(m_hierarchyDoubleClickAction, 0, wxALIGN_CENTER_VERTICAL);
2009 behaviorGroup->Add(doubleClickSizer, 0, wxEXPAND | wxALL, 5);
2010
2011 // Ctrl+Click action
2012 wxBoxSizer *ctrlClickSizer = new wxBoxSizer(wxHORIZONTAL);
2013 wxStaticText *ctrlClickLabel = new wxStaticText(scrolled, wxID_ANY, "Ctrl+Click action:");
2014 ctrlClickLabel->SetForegroundColour(wxColour(200, 200, 200));
2015 ctrlClickSizer->Add(ctrlClickLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
2016 wxArrayString ctrlClickOptions;
2017 ctrlClickOptions.Add("Expand/Collapse");
2018 ctrlClickOptions.Add("Rename");
2019 ctrlClickOptions.Add("Center in Canvas");
2020 m_hierarchyCtrlClickAction = new wxChoice(scrolled, wxID_ANY, wxDefaultPosition, wxSize(150, -1), ctrlClickOptions);
2021 m_hierarchyCtrlClickAction->SetSelection(2); // Default: Center in Canvas
2022 ctrlClickSizer->Add(m_hierarchyCtrlClickAction, 0, wxALIGN_CENTER_VERTICAL);
2023 behaviorGroup->Add(ctrlClickSizer, 0, wxEXPAND | wxALL, 5);
2024
2025 scrolledSizer->Add(behaviorGroup, 0, wxEXPAND | wxALL, 5);
2026
2027 // ===== CONTEXT MENU SETTINGS =====
2028 wxStaticBoxSizer *contextMenuGroup = new wxStaticBoxSizer(wxVERTICAL, scrolled, "Context Menu Options");
2029
2030 m_hierarchyShowAddChild = new wxCheckBox(scrolled, wxID_ANY, "Show \"Add Child\" option");
2031 m_hierarchyShowAddChild->SetForegroundColour(wxColour(200, 200, 200));
2032 contextMenuGroup->Add(m_hierarchyShowAddChild, 0, wxALL, 5);
2033
2034 m_hierarchyShowDelete = new wxCheckBox(scrolled, wxID_ANY, "Show \"Delete\" option");
2035 m_hierarchyShowDelete->SetForegroundColour(wxColour(200, 200, 200));
2036 contextMenuGroup->Add(m_hierarchyShowDelete, 0, wxALL, 5);
2037
2038 m_hierarchyShowRename = new wxCheckBox(scrolled, wxID_ANY, "Show \"Rename\" option");
2039 m_hierarchyShowRename->SetForegroundColour(wxColour(200, 200, 200));
2040 contextMenuGroup->Add(m_hierarchyShowRename, 0, wxALL, 5);
2041
2042 m_hierarchyShowDuplicate = new wxCheckBox(scrolled, wxID_ANY, "Show \"Duplicate\" option");
2043 m_hierarchyShowDuplicate->SetForegroundColour(wxColour(200, 200, 200));
2044 contextMenuGroup->Add(m_hierarchyShowDuplicate, 0, wxALL, 5);
2045
2046 scrolledSizer->Add(contextMenuGroup, 0, wxEXPAND | wxALL, 5);
2047
2048 // ===== PERFORMANCE SETTINGS =====
2049 wxStaticBoxSizer *perfGroup = new wxStaticBoxSizer(wxVERTICAL, scrolled, "Performance Settings");
2050
2051 m_hierarchyRememberExpandedNodes = new wxCheckBox(scrolled, wxID_ANY, "Remember expanded nodes between sessions");
2052 m_hierarchyRememberExpandedNodes->SetForegroundColour(wxColour(200, 200, 200));
2053 perfGroup->Add(m_hierarchyRememberExpandedNodes, 0, wxALL, 5);
2054
2055 scrolledSizer->Add(perfGroup, 0, wxEXPAND | wxALL, 5);
2056
2057 // Add stretch spacer at end
2058 scrolledSizer->AddStretchSpacer();
2059
2060 scrolled->SetSizer(scrolledSizer);
2061 panelSizer->Add(scrolled, 1, wxEXPAND);
2062 panel->SetSizer(panelSizer);
2063
2064 return panel;
2065}
2066
2068 wxPanel *panel = new wxPanel(parent, wxID_ANY);
2069 panel->SetBackgroundColour(wxColour(50, 50, 50));
2070 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
2071
2072 // Display Settings group
2073 wxStaticBoxSizer *displayGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Display Settings");
2074
2075 // Default Level Filter
2076 wxBoxSizer *levelSizer = new wxBoxSizer(wxHORIZONTAL);
2077 wxStaticText *levelLabel = new wxStaticText(panel, wxID_ANY, "Default level filter:");
2078 levelLabel->SetForegroundColour(wxColour(200, 200, 200));
2079 levelSizer->Add(levelLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
2080
2081 wxArrayString levelOptions;
2082 levelOptions.Add("All");
2083 levelOptions.Add("Trace");
2084 levelOptions.Add("Info");
2085 levelOptions.Add("Warning");
2086 levelOptions.Add("Error");
2087 levelOptions.Add("Critical");
2088 m_logDefaultLevelFilter = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, levelOptions);
2089 levelSizer->Add(m_logDefaultLevelFilter, 1, wxEXPAND);
2090 displayGroup->Add(levelSizer, 0, wxEXPAND | wxALL, 5);
2091
2092 // Font Size
2093 wxBoxSizer *fontSizer = new wxBoxSizer(wxHORIZONTAL);
2094 wxStaticText *fontLabel = new wxStaticText(panel, wxID_ANY, "Font size:");
2095 fontLabel->SetForegroundColour(wxColour(200, 200, 200));
2096 fontSizer->Add(fontLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
2097
2098 wxArrayString fontOptions;
2099 fontOptions.Add("Small");
2100 fontOptions.Add("Medium");
2101 fontOptions.Add("Large");
2102 m_logFontSize = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, fontOptions);
2103 fontSizer->Add(m_logFontSize, 1, wxEXPAND);
2104 displayGroup->Add(fontSizer, 0, wxEXPAND | wxALL, 5);
2105
2106 panelSizer->Add(displayGroup, 0, wxEXPAND | wxALL, 5);
2107
2108 // Behavior Settings group
2109 wxStaticBoxSizer *behaviorGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Behavior Settings");
2110
2111 // Auto-scroll enabled
2112 m_logAutoScrollEnabled = new wxCheckBox(panel, wxID_ANY, "Auto-scroll to newest logs");
2113 m_logAutoScrollEnabled->SetForegroundColour(wxColour(200, 200, 200));
2114 behaviorGroup->Add(m_logAutoScrollEnabled, 0, wxALL, 5);
2115
2116 // Max log entries
2117 wxBoxSizer *maxEntriesSizer = new wxBoxSizer(wxHORIZONTAL);
2118 wxStaticText *maxEntriesLabel = new wxStaticText(panel, wxID_ANY, "Max log entries:");
2119 maxEntriesLabel->SetForegroundColour(wxColour(200, 200, 200));
2120 maxEntriesSizer->Add(maxEntriesLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
2121
2123 new wxSpinCtrl(panel, wxID_ANY, "2000", wxDefaultPosition, wxSize(150, -1), wxSP_ARROW_KEYS, 100, 50000, 2000);
2124 maxEntriesSizer->Add(m_logMaxEntries, 0, wxALIGN_CENTER_VERTICAL);
2125
2126 wxStaticText *maxEntriesHint = new wxStaticText(panel, wxID_ANY, "(100 - 50000)");
2127 maxEntriesHint->SetForegroundColour(wxColour(150, 150, 150));
2128 maxEntriesSizer->Add(maxEntriesHint, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
2129
2130 behaviorGroup->Add(maxEntriesSizer, 0, wxEXPAND | wxALL, 5);
2131
2132 panelSizer->Add(behaviorGroup, 0, wxEXPAND | wxALL, 5);
2133
2134 // Color Settings group
2135 wxStaticBoxSizer *colorSettingsGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Color Settings");
2136
2137 // Enable GUI colors
2138 m_logEnableGuiColors = new wxCheckBox(panel, wxID_ANY, "Enable colored text in LogTab");
2139 m_logEnableGuiColors->SetForegroundColour(wxColour(200, 200, 200));
2140 m_logEnableGuiColors->SetToolTip("Show log entries with colored text based on log level");
2141 colorSettingsGroup->Add(m_logEnableGuiColors, 0, wxALL, 5);
2142
2143 // Enable console colors
2144 m_logEnableConsoleColors = new wxCheckBox(panel, wxID_ANY, "Enable ANSI colors in console output");
2145 m_logEnableConsoleColors->SetForegroundColour(wxColour(200, 200, 200));
2146 m_logEnableConsoleColors->SetToolTip("Enable colored output in terminal/console (via spdlog)");
2147 colorSettingsGroup->Add(m_logEnableConsoleColors, 0, wxALL, 5);
2148
2149 panelSizer->Add(colorSettingsGroup, 0, wxEXPAND | wxALL, 5);
2150
2151 // Level Colors group
2152 wxStaticBoxSizer *colorsGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Level Colors");
2153
2154 // Helper lambda to create a color picker row
2155 auto createColorRow = [&](const wxString &label, wxColourPickerCtrl *&picker, const wxColour &defaultColor) {
2156 wxBoxSizer *rowSizer = new wxBoxSizer(wxHORIZONTAL);
2157 wxStaticText *labelText = new wxStaticText(panel, wxID_ANY, label);
2158 labelText->SetForegroundColour(wxColour(200, 200, 200));
2159 labelText->SetMinSize(wxSize(80, -1));
2160 rowSizer->Add(labelText, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
2161
2162 picker = new wxColourPickerCtrl(panel, wxID_ANY, defaultColor, wxDefaultPosition, wxSize(60, 25));
2163 rowSizer->Add(picker, 0, wxALIGN_CENTER_VERTICAL);
2164
2165 colorsGroup->Add(rowSizer, 0, wxEXPAND | wxALL, 5);
2166 };
2167
2168 createColorRow("Trace:", m_logTraceColor, wxColour(128, 128, 128));
2169 createColorRow("Info:", m_logInfoColor, wxColour(100, 200, 100));
2170 createColorRow("Warning:", m_logWarningColor, wxColour(230, 180, 50));
2171 createColorRow("Error:", m_logErrorColor, wxColour(230, 80, 80));
2172 createColorRow("Critical:", m_logCriticalColor, wxColour(255, 50, 50));
2173
2174 panelSizer->Add(colorsGroup, 0, wxEXPAND | wxALL, 5);
2175 panelSizer->AddStretchSpacer();
2176
2177 panel->SetSizer(panelSizer);
2178 return panel;
2179}
2180
2182 wxPanel *panel = new wxPanel(parent, wxID_ANY);
2183 panel->SetBackgroundColour(wxColour(50, 50, 50));
2184 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
2185
2186 // File Loading group
2187 wxStaticBoxSizer *fileGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "File Loading");
2188
2189 m_autoLoadLastFile = new wxCheckBox(panel, ID_AUTO_LOAD_LAST_FILE, "Auto-load last opened file on startup");
2190 m_autoLoadLastFile->SetForegroundColour(wxColour(200, 200, 200));
2191 fileGroup->Add(m_autoLoadLastFile, 0, wxALL, 5);
2192
2193 m_showParseWarnings = new wxCheckBox(panel, ID_SHOW_PARSE_WARNINGS, "Show parsing warnings");
2194 m_showParseWarnings->SetForegroundColour(wxColour(200, 200, 200));
2195 fileGroup->Add(m_showParseWarnings, 0, wxALL, 5);
2196
2197 // File encoding
2198 wxBoxSizer *encodingSizer = new wxBoxSizer(wxHORIZONTAL);
2199 wxStaticText *encodingLabel = new wxStaticText(panel, wxID_ANY, "Default file encoding:");
2200 encodingLabel->SetForegroundColour(wxColour(200, 200, 200));
2201 encodingSizer->Add(encodingLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
2202
2203 wxArrayString encodings;
2204 encodings.Add("UTF-8");
2205 encodings.Add("ASCII");
2206 encodings.Add("ISO-8859-1");
2207 m_fileEncoding = new wxChoice(panel, ID_FILE_ENCODING, wxDefaultPosition, wxDefaultSize, encodings);
2208 encodingSizer->Add(m_fileEncoding, 1, wxEXPAND);
2209 fileGroup->Add(encodingSizer, 0, wxEXPAND | wxALL, 5);
2210
2211 panelSizer->Add(fileGroup, 0, wxEXPAND | wxALL, 5);
2212
2213 // Parser Configuration group
2214 wxStaticBoxSizer *parserGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Parser Configuration");
2215
2216 wxStaticText *parserNote = new wxStaticText(
2217 panel, wxID_ANY, "For advanced parser settings including XML profiles,\nuse the parser configuration dialog:");
2218 parserNote->SetForegroundColour(wxColour(180, 180, 180));
2219 parserGroup->Add(parserNote, 0, wxALL, 5);
2220
2221 m_configureParserButton = new wxButton(panel, ID_CONFIGURE_PARSER, "Configure Parser...");
2222 parserGroup->Add(m_configureParserButton, 0, wxALL | wxALIGN_CENTER, 5);
2223
2224 panelSizer->Add(parserGroup, 0, wxEXPAND | wxALL, 5);
2225 panelSizer->AddStretchSpacer();
2226
2227 panel->SetSizer(panelSizer);
2228 return panel;
2229}
2230
2232 wxPanel *panel = new wxPanel(parent, wxID_ANY);
2233 panel->SetBackgroundColour(wxColour(50, 50, 50));
2234 wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL);
2235
2236 // === Rendering Settings ===
2237 wxStaticBoxSizer *renderingGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Rendering (wxWidgets-Supported)");
2238
2239 m_enableVSync = new wxCheckBox(panel, ID_ENABLE_VSYNC, "Enable VSync");
2240 m_enableVSync->SetForegroundColour(wxColour(200, 200, 200));
2241 m_enableVSync->SetToolTip("Vertical sync for smoother rendering (OpenGL contexts only)");
2242 renderingGroup->Add(m_enableVSync, 0, wxALL, 5);
2243
2244 m_hardwareAcceleration = new wxCheckBox(panel, ID_HARDWARE_ACCELERATION, "Hardware Acceleration (GPU)");
2245 m_hardwareAcceleration->SetForegroundColour(wxColour(200, 200, 200));
2246 m_hardwareAcceleration->SetToolTip("Use GPU for rendering (OpenGL contexts only, requires restart)");
2247 renderingGroup->Add(m_hardwareAcceleration, 0, wxALL, 5);
2248
2249 m_enableDoubleBuffering = new wxCheckBox(panel, ID_ENABLE_DOUBLE_BUFFERING, "Double Buffering");
2250 m_enableDoubleBuffering->SetForegroundColour(wxColour(200, 200, 200));
2251 m_enableDoubleBuffering->SetToolTip("Reduce flicker using window styles (wxBUFFER_VIRTUAL_AREA)");
2252 renderingGroup->Add(m_enableDoubleBuffering, 0, wxALL, 5);
2253
2254 m_enableAntiAliasing = new wxCheckBox(panel, ID_ENABLE_ANTI_ALIASING, "Graphics Anti-Aliasing");
2255 m_enableAntiAliasing->SetForegroundColour(wxColour(200, 200, 200));
2256 m_enableAntiAliasing->SetToolTip("Smooth edges using wxGraphicsContext");
2257 renderingGroup->Add(m_enableAntiAliasing, 0, wxALL, 5);
2258
2259 m_enableTextAntiAliasing = new wxCheckBox(panel, ID_ENABLE_TEXT_AA, "Text Anti-Aliasing");
2260 m_enableTextAntiAliasing->SetForegroundColour(wxColour(200, 200, 200));
2261 m_enableTextAntiAliasing->SetToolTip("Smooth text using font flags");
2262 renderingGroup->Add(m_enableTextAntiAliasing, 0, wxALL, 5);
2263
2264 m_enablePartialRedraws = new wxCheckBox(panel, ID_ENABLE_PARTIAL_REDRAWS, "Partial Redraws");
2265 m_enablePartialRedraws->SetForegroundColour(wxColour(200, 200, 200));
2266 m_enablePartialRedraws->SetToolTip("Only redraw changed areas (wxNO_FULL_REPAINT_ON_RESIZE)");
2267 renderingGroup->Add(m_enablePartialRedraws, 0, wxALL, 5);
2268
2269 m_enableBackgroundErase = new wxCheckBox(panel, ID_ENABLE_BACKGROUND_ERASE, "Background Erase");
2270 m_enableBackgroundErase->SetForegroundColour(wxColour(200, 200, 200));
2271 m_enableBackgroundErase->SetToolTip("Erase background before redraw (disable for better performance)");
2272 renderingGroup->Add(m_enableBackgroundErase, 0, wxALL, 5);
2273
2274 // FPS limit
2275 wxBoxSizer *fpsSizer = new wxBoxSizer(wxHORIZONTAL);
2276 wxStaticText *fpsLabel = new wxStaticText(panel, wxID_ANY, "Frame Rate Limit:");
2277 fpsLabel->SetForegroundColour(wxColour(200, 200, 200));
2278 fpsSizer->Add(fpsLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
2279
2280 wxArrayString fpsOptions;
2281 fpsOptions.Add("30 FPS");
2282 fpsOptions.Add("60 FPS");
2283 fpsOptions.Add("120 FPS");
2284 fpsOptions.Add("Unlimited");
2285 m_fpsLimit = new wxChoice(panel, ID_FPS_LIMIT, wxDefaultPosition, wxSize(150, -1), fpsOptions);
2286 m_fpsLimit->SetToolTip("Limit frame rate using wxTimer");
2287 fpsSizer->Add(m_fpsLimit, 0);
2288 renderingGroup->Add(fpsSizer, 0, wxEXPAND | wxALL, 5);
2289
2290 panelSizer->Add(renderingGroup, 0, wxEXPAND | wxALL, 10);
2291
2292 // === Viewport Culling (for Large Trees) ===
2293 wxStaticBoxSizer *cullingGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Viewport Culling (for Large Trees)");
2294
2295 m_enableViewportCulling = new wxCheckBox(panel, wxID_ANY, "Enable Viewport Culling");
2296 m_enableViewportCulling->SetForegroundColour(wxColour(200, 200, 200));
2297 m_enableViewportCulling->SetToolTip(
2298 "Only render nodes visible in viewport - major performance boost for large trees");
2299 cullingGroup->Add(m_enableViewportCulling, 0, wxALL, 5);
2300
2301 // Culling margin slider
2302 wxBoxSizer *marginSizer = new wxBoxSizer(wxHORIZONTAL);
2303 wxStaticText *marginLabel = new wxStaticText(panel, wxID_ANY, "Culling Margin:");
2304 marginLabel->SetForegroundColour(wxColour(200, 200, 200));
2305 marginSizer->Add(marginLabel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
2306
2307 m_viewportCullingMargin = new wxSpinCtrl(panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(100, -1),
2308 wxSP_ARROW_KEYS, 100, 1000, 500);
2309 m_viewportCullingMargin->SetToolTip(
2310 "Safety margin in pixels - higher values prevent edge flickering but render more off-screen nodes");
2311 marginSizer->Add(m_viewportCullingMargin, 0);
2312
2313 wxStaticText *marginUnit = new wxStaticText(panel, wxID_ANY, " pixels");
2314 marginUnit->SetForegroundColour(wxColour(180, 180, 180));
2315 marginSizer->Add(marginUnit, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 5);
2316
2317 cullingGroup->Add(marginSizer, 0, wxEXPAND | wxALL, 5);
2318
2319 // Culling info
2320 wxStaticText *cullingInfo =
2321 new wxStaticText(panel, wxID_ANY,
2322 "Viewport culling dramatically improves performance with large trees (600+ nodes)\n"
2323 "by only rendering nodes visible in the current view. The margin prevents\n"
2324 "flickering when nodes are at viewport edges.");
2325 cullingInfo->SetForegroundColour(wxColour(150, 150, 150));
2326 cullingGroup->Add(cullingInfo, 0, wxALL, 5);
2327
2328 panelSizer->Add(cullingGroup, 0, wxEXPAND | wxALL, 10);
2329
2330 // === UI Responsiveness ===
2331 wxStaticBoxSizer *uiGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "UI Responsiveness");
2332
2333 m_enableIdleProcessing = new wxCheckBox(panel, ID_ENABLE_IDLE_PROCESSING, "Enable Idle Event Processing");
2334 m_enableIdleProcessing->SetForegroundColour(wxColour(200, 200, 200));
2335 m_enableIdleProcessing->SetToolTip("Process background tasks using wxIdleEvent");
2336 uiGroup->Add(m_enableIdleProcessing, 0, wxALL, 5);
2337
2338 panelSizer->Add(uiGroup, 0, wxEXPAND | wxALL, 10);
2339
2340 // Performance note
2341 wxStaticBoxSizer *noteGroup = new wxStaticBoxSizer(wxVERTICAL, panel, "Note");
2342 wxStaticText *noteText =
2343 new wxStaticText(panel, wxID_ANY,
2344 "These settings use wxWidgets native APIs for performance tuning.\n"
2345 "Some settings (VSync, Hardware Acceleration) apply only to OpenGL contexts.\n"
2346 "Changes may require an application restart to take full effect.");
2347 noteText->SetForegroundColour(wxColour(180, 180, 180));
2348 noteGroup->Add(noteText, 0, wxALL, 5);
2349 panelSizer->Add(noteGroup, 0, wxEXPAND | wxALL, 10);
2350
2351 panelSizer->AddStretchSpacer();
2352
2353 panel->SetSizer(panelSizer);
2354 return panel;
2355}
2356
2357void PreferencesDialog::ShowPanel(wxPanel *panel) {
2358 if (!panel)
2359 return;
2360
2361 // Hide all panels
2362 m_windowPanel->Hide();
2363 m_mainPanelPanel->Hide();
2365 m_bottomPanelPanel->Hide();
2366 m_fileExplorerPanel->Hide();
2367 m_logTabPanel->Hide();
2368 m_sidePanelPanel->Hide();
2369 m_leftPanelPanel->Hide();
2370 m_rightPanelPanel->Hide();
2371 m_tabsSubPanel->Hide();
2372 m_sceneHierarchyPanel->Hide();
2373 m_parserPanel->Hide();
2374 m_performancePanel->Hide();
2375
2376 // Show selected panel
2377 panel->Show();
2378
2379 // Update layout
2380 m_settingsPanel->Layout();
2381 m_settingsPanel->FitInside();
2382 m_settingsPanel->Refresh();
2383}
2384
2385bool PreferencesDialog::SelectSection(const wxString &sectionName) {
2386 if (!m_sectionTree)
2387 return false;
2388
2389 // Helper lambda to recursively find and select a tree item by name
2390 std::function<bool(wxTreeItemId)> findAndSelect = [&](wxTreeItemId item) -> bool {
2391 if (!item.IsOk())
2392 return false;
2393
2394 if (m_sectionTree->GetItemText(item) == sectionName) {
2395 m_sectionTree->SelectItem(item);
2396 m_sectionTree->EnsureVisible(item);
2397
2398 // Also show the corresponding panel
2399 SectionTreeItemData *data = dynamic_cast<SectionTreeItemData *>(m_sectionTree->GetItemData(item));
2400 if (data && data->GetPanel()) {
2401 ShowPanel(data->GetPanel());
2402 }
2403 return true;
2404 }
2405
2406 // Check children
2407 wxTreeItemIdValue cookie;
2408 wxTreeItemId child = m_sectionTree->GetFirstChild(item, cookie);
2409 while (child.IsOk()) {
2410 if (findAndSelect(child))
2411 return true;
2412 child = m_sectionTree->GetNextChild(item, cookie);
2413 }
2414 return false;
2415 };
2416
2417 // Start from root
2418 wxTreeItemId rootId = m_sectionTree->GetRootItem();
2419 return findAndSelect(rootId);
2420}
2421
2423 using namespace EmberForge;
2424 auto &prefs = AppPreferencesManager::GetInstance().GetPreferences();
2425
2426 // Window settings
2427 m_themeChoice->SetSelection(static_cast<int>(prefs.GetWindowSettings().theme));
2428 wxColour accentColor(prefs.GetWindowSettings().accentColor.r, prefs.GetWindowSettings().accentColor.g,
2429 prefs.GetWindowSettings().accentColor.b);
2430 m_accentColorPicker->SetColour(accentColor);
2431 m_startupModeChoice->SetSelection(static_cast<int>(prefs.GetWindowSettings().startupMode));
2432
2433 // File menu hotkeys
2434 m_newProjectHotkeyTextCtrl->SetValue(wxString(prefs.GetWindowSettings().newProjectHotkey));
2435 m_openProjectHotkeyTextCtrl->SetValue(wxString(prefs.GetWindowSettings().openProjectHotkey));
2436 m_openFileHotkeyTextCtrl->SetValue(wxString(prefs.GetWindowSettings().openFileHotkey));
2437 m_saveHotkeyTextCtrl->SetValue(wxString(prefs.GetWindowSettings().saveHotkey));
2438 m_saveAsHotkeyTextCtrl->SetValue(wxString(prefs.GetWindowSettings().saveAsHotkey));
2439
2440 // View menu hotkeys
2441 m_maximizeHotkeyTextCtrl->SetValue(wxString(prefs.GetWindowSettings().maximizeHotkey));
2442 m_resetUIHotkeyTextCtrl->SetValue(wxString(prefs.GetWindowSettings().resetUIHotkey));
2443
2444 // Settings menu hotkeys
2445 m_preferencesHotkeyTextCtrl->SetValue(wxString(prefs.GetWindowSettings().preferencesHotkey));
2446 m_parserConfigHotkeyTextCtrl->SetValue(wxString(prefs.GetWindowSettings().parserConfigHotkey));
2447
2448 // Window appearance
2449 m_showStatusBar->SetValue(prefs.GetWindowSettings().showStatusBar);
2450 m_showPanelCaptions->SetValue(prefs.GetWindowSettings().showPanelCaptions);
2451 m_alwaysOnTop->SetValue(prefs.GetWindowSettings().alwaysOnTop);
2452
2453 // Window constraints
2454 m_minWindowWidth->SetValue(prefs.GetWindowSettings().minWindowWidth);
2455 m_minWindowHeight->SetValue(prefs.GetWindowSettings().minWindowHeight);
2456 bool maxUnlimited =
2457 (prefs.GetWindowSettings().maxWindowWidth == -1 || prefs.GetWindowSettings().maxWindowHeight == -1);
2458 m_maxWindowUnlimited->SetValue(maxUnlimited);
2459 m_maxWindowWidth->SetValue(prefs.GetWindowSettings().maxWindowWidth);
2460 m_maxWindowHeight->SetValue(prefs.GetWindowSettings().maxWindowHeight);
2461 m_maxWindowWidth->Enable(!maxUnlimited);
2462 m_maxWindowHeight->Enable(!maxUnlimited);
2463
2464 m_enforceAspectRatio->SetValue(prefs.GetWindowSettings().enforceAspectRatio);
2465 // Parse aspect ratio from float
2466 float ratio = prefs.GetWindowSettings().aspectRatio;
2467 // Common ratios: 16:9 = 1.777..., 4:3 = 1.333..., 21:9 = 2.333...
2468 int width = 16, height = 9;
2469 if (std::abs(ratio - 16.0f / 9.0f) < 0.01f) {
2470 width = 16;
2471 height = 9;
2472 } else if (std::abs(ratio - 4.0f / 3.0f) < 0.01f) {
2473 width = 4;
2474 height = 3;
2475 } else if (std::abs(ratio - 21.0f / 9.0f) < 0.01f) {
2476 width = 21;
2477 height = 9;
2478 }
2479 m_aspectRatioWidth->SetValue(wxString::Format("%d", width));
2480 m_aspectRatioHeight->SetValue(wxString::Format("%d", height));
2481
2482 // Main panel settings
2483 int zoomPercent = static_cast<int>(prefs.GetMainPanelSettings().defaultZoomLevel * 100);
2484 m_defaultZoomSlider->SetValue(zoomPercent);
2485 m_zoomLabel->SetLabel(wxString::Format("%d%%", zoomPercent));
2486 m_showGrid->SetValue(prefs.GetMainPanelSettings().showGrid);
2487 m_gridSize->SetValue(prefs.GetMainPanelSettings().gridSize);
2488 wxColour gridBg(prefs.GetMainPanelSettings().gridBackgroundColor.r,
2489 prefs.GetMainPanelSettings().gridBackgroundColor.g,
2490 prefs.GetMainPanelSettings().gridBackgroundColor.b);
2491 m_gridBackgroundPicker->SetColour(gridBg);
2492 wxColour gridLineColor(prefs.GetMainPanelSettings().gridLineColor.r, prefs.GetMainPanelSettings().gridLineColor.g,
2493 prefs.GetMainPanelSettings().gridLineColor.b);
2494 m_gridLineColorPicker->SetColour(gridLineColor);
2495 wxColour canvasBg(prefs.GetMainPanelSettings().canvasBackgroundColor.r,
2496 prefs.GetMainPanelSettings().canvasBackgroundColor.g,
2497 prefs.GetMainPanelSettings().canvasBackgroundColor.b);
2498 m_canvasBackgroundPicker->SetColour(canvasBg);
2499 wxColour connectionLineColor(prefs.GetMainPanelSettings().connectionLineColor.r,
2500 prefs.GetMainPanelSettings().connectionLineColor.g,
2501 prefs.GetMainPanelSettings().connectionLineColor.b);
2502 m_connectionLineColorPicker->SetColour(connectionLineColor);
2503 m_highlightPathToSelected->SetValue(prefs.GetMainPanelSettings().highlightPathToSelected);
2504 wxColour pathHighlightColor(prefs.GetMainPanelSettings().pathHighlightColor.r,
2505 prefs.GetMainPanelSettings().pathHighlightColor.g,
2506 prefs.GetMainPanelSettings().pathHighlightColor.b);
2507 m_pathHighlightColorPicker->SetColour(pathHighlightColor);
2508 wxColour idleNodeBg(prefs.GetMainPanelSettings().idleNodeBgColor.r, prefs.GetMainPanelSettings().idleNodeBgColor.g,
2509 prefs.GetMainPanelSettings().idleNodeBgColor.b);
2510 m_idleNodeBgColorPicker->SetColour(idleNodeBg);
2511 wxColour idleNodeBorder(prefs.GetMainPanelSettings().idleNodeBorderColor.r,
2512 prefs.GetMainPanelSettings().idleNodeBorderColor.g,
2513 prefs.GetMainPanelSettings().idleNodeBorderColor.b);
2514 m_idleNodeBorderColorPicker->SetColour(idleNodeBorder);
2515 wxColour idleNodeText(prefs.GetMainPanelSettings().idleNodeTextColor.r,
2516 prefs.GetMainPanelSettings().idleNodeTextColor.g,
2517 prefs.GetMainPanelSettings().idleNodeTextColor.b);
2518 m_idleNodeTextColorPicker->SetColour(idleNodeText);
2519 int selectedTint = static_cast<int>(prefs.GetMainPanelSettings().selectedNodeBgTint * 100);
2520 m_selectedNodeBgTint->SetValue(selectedTint);
2521 m_selectedNodeBgTintLabel->SetLabel(wxString::Format("%d%%", selectedTint));
2522 int hoveredTint = static_cast<int>(prefs.GetMainPanelSettings().hoveredNodeBgTint * 100);
2523 m_hoveredNodeBgTint->SetValue(hoveredTint);
2524 m_hoveredNodeBgTintLabel->SetLabel(wxString::Format("%d%%", hoveredTint));
2525 wxColour selectedNode(prefs.GetMainPanelSettings().selectedNodeColor.r,
2526 prefs.GetMainPanelSettings().selectedNodeColor.g,
2527 prefs.GetMainPanelSettings().selectedNodeColor.b);
2528 m_selectedNodeColorPicker->SetColour(selectedNode);
2529 wxColour hoveredNode(prefs.GetMainPanelSettings().hoveredNodeColor.r,
2530 prefs.GetMainPanelSettings().hoveredNodeColor.g,
2531 prefs.GetMainPanelSettings().hoveredNodeColor.b);
2532 m_hoveredNodeColorPicker->SetColour(hoveredNode);
2533 wxColour selectedNodeText(prefs.GetMainPanelSettings().selectedNodeTextColor.r,
2534 prefs.GetMainPanelSettings().selectedNodeTextColor.g,
2535 prefs.GetMainPanelSettings().selectedNodeTextColor.b);
2536 m_selectedNodeTextColorPicker->SetColour(selectedNodeText);
2537 wxColour hoveredNodeText(prefs.GetMainPanelSettings().hoveredNodeTextColor.r,
2538 prefs.GetMainPanelSettings().hoveredNodeTextColor.g,
2539 prefs.GetMainPanelSettings().hoveredNodeTextColor.b);
2540 m_hoveredNodeTextColorPicker->SetColour(hoveredNodeText);
2541 wxColour selectedNodeInfo(prefs.GetMainPanelSettings().selectedNodeInfoColor.r,
2542 prefs.GetMainPanelSettings().selectedNodeInfoColor.g,
2543 prefs.GetMainPanelSettings().selectedNodeInfoColor.b);
2544 m_selectedNodeInfoColorPicker->SetColour(selectedNodeInfo);
2545 wxColour hoveredNodeInfo(prefs.GetMainPanelSettings().hoveredNodeInfoColor.r,
2546 prefs.GetMainPanelSettings().hoveredNodeInfoColor.g,
2547 prefs.GetMainPanelSettings().hoveredNodeInfoColor.b);
2548 m_hoveredNodeInfoColorPicker->SetColour(hoveredNodeInfo);
2549
2550 // Scene management
2551 bool scenesUnlimited = (prefs.GetMainPanelSettings().maxScenes == -1);
2552 m_maxScenesUnlimited->SetValue(scenesUnlimited);
2553 m_maxScenes->SetValue(prefs.GetMainPanelSettings().maxScenes > 0 ? prefs.GetMainPanelSettings().maxScenes : 10);
2554 m_maxScenes->Enable(!scenesUnlimited);
2555
2556 m_closeConfirmation->SetSelection(static_cast<int>(prefs.GetMainPanelSettings().closeConfirmation));
2557
2558 m_nextSceneHotkeyTextCtrl->SetValue(wxString(prefs.GetMainPanelSettings().nextSceneHotkey));
2559 m_previousSceneHotkeyTextCtrl->SetValue(wxString(prefs.GetMainPanelSettings().previousSceneHotkey));
2560
2561 // Behavior tree view settings
2562 const auto &btViewSettings = prefs.GetBehaviorTreeViewSettings();
2563
2564 // Convert zoom step size from float (0.0-1.0) to percentage (1-50)
2565 int zoomStepPercent = static_cast<int>(btViewSettings.zoomStepSize * 100);
2566 m_zoomStepSize->SetValue(zoomStepPercent);
2567 m_zoomStepSizeLabel->SetLabel(wxString::Format("%d%%", zoomStepPercent));
2568
2569 int wheelSensitivity = static_cast<int>(btViewSettings.mouseWheelSensitivity * 100);
2570 m_mouseWheelSensitivity->SetValue(wheelSensitivity);
2571 m_mouseWheelSensitivityLabel->SetLabel(wxString::Format("%.1fx", btViewSettings.mouseWheelSensitivity));
2572
2573 m_zoomFollowsCursor->SetValue(btViewSettings.zoomFollowsCursor);
2574 m_resetViewHotkeyTextCtrl->SetValue(wxString(btViewSettings.resetViewHotkey));
2575
2576 int panSensitivity = static_cast<int>(btViewSettings.panSensitivity * 100);
2577 m_panSensitivity->SetValue(panSensitivity);
2578 m_panSensitivityLabel->SetLabel(wxString::Format("%.1fx", btViewSettings.panSensitivity));
2579
2580 m_panKeyTextCtrl->SetValue(wxString(btViewSettings.panKey));
2581 m_enableSmoothPanning->SetValue(btViewSettings.enableSmoothPanning);
2582 m_panSmoothness->SetValue(static_cast<int>(btViewSettings.panSmoothness));
2583 m_panSmoothnessLabel->SetLabel(wxString::Format("%d%%", static_cast<int>(btViewSettings.panSmoothness)));
2584 m_panStepSize->SetValue(static_cast<int>(btViewSettings.panStepSize));
2585 m_panStepSizeLabel->SetLabel(wxString::Format("%dpx", static_cast<int>(btViewSettings.panStepSize)));
2586 m_centerOnNodeHotkeyTextCtrl->SetValue(wxString(btViewSettings.centerOnNodeHotkey));
2587 m_deleteNodeHotkeyTextCtrl->SetValue(wxString(btViewSettings.deleteNodeHotkey));
2588 m_panUpHotkeyTextCtrl->SetValue(wxString(btViewSettings.panUpHotkey));
2589 m_panDownHotkeyTextCtrl->SetValue(wxString(btViewSettings.panDownHotkey));
2590 m_panLeftHotkeyTextCtrl->SetValue(wxString(btViewSettings.panLeftHotkey));
2591 m_panRightHotkeyTextCtrl->SetValue(wxString(btViewSettings.panRightHotkey));
2592
2593 // Debug text settings - Coordinate System Info
2595 m_showCoordinateInfo->SetValue(btViewSettings.showCoordinateInfo);
2597 m_coordinateInfoFontSize->SetValue(btViewSettings.coordinateInfoFontSize);
2599 m_coordinateInfoColorPicker->SetColour(wxColour(btViewSettings.coordinateInfoColor.r,
2600 btViewSettings.coordinateInfoColor.g,
2601 btViewSettings.coordinateInfoColor.b));
2603 m_coordinateInfoAnchor->SetSelection(static_cast<int>(btViewSettings.coordinateInfoAnchor));
2605 m_coordinateInfoX->SetValue(btViewSettings.coordinateInfoX);
2607 m_coordinateInfoY->SetValue(btViewSettings.coordinateInfoY);
2608
2609 // Debug text settings - Selected Node Info
2611 m_showSelectedNodeInfo->SetValue(btViewSettings.showSelectedNodeInfo);
2613 m_selectedNodeInfoFontSize->SetValue(btViewSettings.selectedNodeInfoFontSize);
2615 m_selectedNodeDebugInfoColorPicker->SetColour(wxColour(btViewSettings.selectedNodeInfoColor.r,
2616 btViewSettings.selectedNodeInfoColor.g,
2617 btViewSettings.selectedNodeInfoColor.b));
2619 m_selectedNodeInfoAnchor->SetSelection(static_cast<int>(btViewSettings.selectedNodeInfoAnchor));
2621 m_selectedNodeInfoX->SetValue(btViewSettings.selectedNodeInfoX);
2623 m_selectedNodeInfoY->SetValue(btViewSettings.selectedNodeInfoY);
2624
2625 // Debug text settings - Tree Statistics Info
2626 if (m_showTreeInfo)
2627 m_showTreeInfo->SetValue(btViewSettings.showTreeInfo);
2629 m_treeInfoFontSize->SetValue(btViewSettings.treeInfoFontSize);
2631 m_treeInfoColorPicker->SetColour(
2632 wxColour(btViewSettings.treeInfoColor.r, btViewSettings.treeInfoColor.g, btViewSettings.treeInfoColor.b));
2633 if (m_treeInfoAnchor)
2634 m_treeInfoAnchor->SetSelection(static_cast<int>(btViewSettings.treeInfoAnchor));
2635 if (m_treeInfoX)
2636 m_treeInfoX->SetValue(btViewSettings.treeInfoX);
2637 if (m_treeInfoY)
2638 m_treeInfoY->SetValue(btViewSettings.treeInfoY);
2639
2640 // Debug text settings - FPS Display
2641 if (m_showFPS)
2642 m_showFPS->SetValue(btViewSettings.showFPS);
2643 if (m_fpsFontSize)
2644 m_fpsFontSize->SetValue(btViewSettings.fpsFontSize);
2645 if (m_fpsColorPicker)
2646 m_fpsColorPicker->SetColour(
2647 wxColour(btViewSettings.fpsColor.r, btViewSettings.fpsColor.g, btViewSettings.fpsColor.b));
2648 if (m_fpsAnchor)
2649 m_fpsAnchor->SetSelection(static_cast<int>(btViewSettings.fpsAnchor));
2650 if (m_fpsX)
2651 m_fpsX->SetValue(btViewSettings.fpsX);
2652 if (m_fpsY)
2653 m_fpsY->SetValue(btViewSettings.fpsY);
2654
2655 // Debug text settings - Controls Help Text
2657 m_showControlsHelp->SetValue(btViewSettings.showControlsHelp);
2659 m_controlsHelpFontSize->SetValue(btViewSettings.controlsHelpFontSize);
2661 m_controlsHelpColorPicker->SetColour(wxColour(btViewSettings.controlsHelpColor.r,
2662 btViewSettings.controlsHelpColor.g,
2663 btViewSettings.controlsHelpColor.b));
2665 m_controlsHelpAnchor->SetSelection(static_cast<int>(btViewSettings.controlsHelpAnchor));
2666 if (m_controlsHelpX)
2667 m_controlsHelpX->SetValue(btViewSettings.controlsHelpX);
2668 if (m_controlsHelpY)
2669 m_controlsHelpY->SetValue(btViewSettings.controlsHelpY);
2670
2671 // Bottom panel container settings
2672 const auto &bottomSettings = prefs.GetBottomPanelSettings();
2673 m_bottomPanelHeight->SetValue(bottomSettings.defaultPanelHeight);
2674 m_bottomPanelHeightEnabled->SetValue(bottomSettings.defaultPanelHeightEnabled);
2675 m_bottomPanelHeight->Enable(bottomSettings.defaultPanelHeightEnabled);
2676 m_bottomPanelMinHeight->SetValue(bottomSettings.minimumPanelHeight);
2677 m_bottomPanelMinHeightEnabled->SetValue(bottomSettings.minimumPanelHeightEnabled);
2678 m_bottomPanelMinHeight->Enable(bottomSettings.minimumPanelHeightEnabled);
2679 m_bottomPanelStartup->SetSelection(static_cast<int>(bottomSettings.panelStartupState));
2680 m_showTabCloseButtons->SetValue(bottomSettings.showTabCloseButtons);
2681 m_rememberLastTab->SetValue(bottomSettings.rememberLastTab);
2682 m_allowPanelCollapse->SetValue(bottomSettings.allowPanelCollapse);
2683
2684 // File Explorer tab general settings
2685 m_showBreadcrumb->SetValue(bottomSettings.showBreadcrumb);
2686 m_showHistory->SetValue(bottomSettings.showHistory);
2687
2688 // Start Path Mode
2689 int startPathModeIndex = static_cast<int>(bottomSettings.startPathMode);
2690 m_startPathMode->SetSelection(startPathModeIndex);
2691 m_customStartPath->SetValue(wxString(bottomSettings.customStartPath));
2692 bool enableCustomPath = (startPathModeIndex == 1); // CustomPath (second option)
2693 m_customStartPath->Enable(enableCustomPath);
2694 m_browseStartPath->Enable(enableCustomPath);
2695
2696 // Tree View settings
2697 m_treeShowHiddenFiles->SetValue(bottomSettings.treeView.showHiddenFiles);
2698 m_treeShowFileExtensions->SetValue(bottomSettings.treeView.showFileExtensions);
2699 m_treeSortFilesBy->SetSelection(static_cast<int>(bottomSettings.treeView.sortFilesBy));
2700
2701 // Tree Item Size
2702 int treeItemSizeIndex = 1; // Default to Medium
2703 switch (bottomSettings.treeView.itemSize) {
2705 treeItemSizeIndex = 0;
2706 break;
2708 treeItemSizeIndex = 1;
2709 break;
2711 treeItemSizeIndex = 2;
2712 break;
2713 }
2714 m_treeItemSize->SetSelection(treeItemSizeIndex);
2715
2716 // Grid View settings
2717 m_gridShowHiddenFiles->SetValue(bottomSettings.gridView.showHiddenFiles);
2718 m_gridShowFileExtensions->SetValue(bottomSettings.gridView.showFileExtensions);
2719 m_gridSortFilesBy->SetSelection(static_cast<int>(bottomSettings.gridView.sortFilesBy));
2720
2721 // Icon Size
2722 int iconSizeIndex = 1; // Default to Medium
2723 switch (bottomSettings.gridView.iconSize) {
2725 iconSizeIndex = 0;
2726 break;
2728 iconSizeIndex = 1;
2729 break;
2731 iconSizeIndex = 2;
2732 break;
2733 }
2734 m_gridIconSize->SetSelection(iconSizeIndex);
2735
2736 // Log Tab settings
2737 m_logDefaultLevelFilter->SetSelection(bottomSettings.logTab.defaultLevelFilter);
2738 m_logAutoScrollEnabled->SetValue(bottomSettings.logTab.autoScrollEnabled);
2739 m_logMaxEntries->SetValue(bottomSettings.logTab.maxLogEntries);
2740 m_logEnableGuiColors->SetValue(bottomSettings.logTab.enableGuiColors);
2741 m_logEnableConsoleColors->SetValue(bottomSettings.logTab.enableConsoleColors);
2742
2743 int logFontSizeIndex = 1; // Default to Medium
2744 switch (bottomSettings.logTab.fontSize) {
2746 logFontSizeIndex = 0;
2747 break;
2749 logFontSizeIndex = 1;
2750 break;
2752 logFontSizeIndex = 2;
2753 break;
2754 }
2755 m_logFontSize->SetSelection(logFontSizeIndex);
2756
2757 // Log level colors
2758 m_logTraceColor->SetColour(wxColour(bottomSettings.logTab.traceColor.r, bottomSettings.logTab.traceColor.g,
2759 bottomSettings.logTab.traceColor.b));
2760 m_logInfoColor->SetColour(wxColour(bottomSettings.logTab.infoColor.r, bottomSettings.logTab.infoColor.g,
2761 bottomSettings.logTab.infoColor.b));
2762 m_logWarningColor->SetColour(wxColour(bottomSettings.logTab.warningColor.r, bottomSettings.logTab.warningColor.g,
2763 bottomSettings.logTab.warningColor.b));
2764 m_logErrorColor->SetColour(wxColour(bottomSettings.logTab.errorColor.r, bottomSettings.logTab.errorColor.g,
2765 bottomSettings.logTab.errorColor.b));
2766 m_logCriticalColor->SetColour(wxColour(bottomSettings.logTab.criticalColor.r, bottomSettings.logTab.criticalColor.g,
2767 bottomSettings.logTab.criticalColor.b));
2768
2769 // Left Panel Settings
2770 const auto &leftSettings = prefs.GetLeftPanelSettings();
2771 m_leftPanelWidthEnabled->SetValue(leftSettings.defaultPanelWidthEnabled);
2772 m_leftPanelWidth->SetValue(leftSettings.defaultPanelWidth);
2773 m_leftPanelWidth->Enable(leftSettings.defaultPanelWidthEnabled);
2774 m_leftPanelMinWidthEnabled->SetValue(leftSettings.minimumPanelWidthEnabled);
2775 m_leftPanelMinWidth->SetValue(leftSettings.minimumPanelWidth);
2776 m_leftPanelMinWidth->Enable(leftSettings.minimumPanelWidthEnabled);
2777
2778 int leftPanelStartupIndex = 0;
2779 switch (leftSettings.panelStartupState) {
2781 leftPanelStartupIndex = 0;
2782 break;
2784 leftPanelStartupIndex = 1;
2785 break;
2787 leftPanelStartupIndex = 2;
2788 break;
2789 }
2790 m_leftPanelStartup->SetSelection(leftPanelStartupIndex);
2791
2792 m_leftPanelShowTabCloseButtons->SetValue(leftSettings.showTabCloseButtons);
2793 m_leftPanelRememberLastTab->SetValue(leftSettings.rememberLastTab);
2794 m_leftPanelAllowCollapse->SetValue(leftSettings.allowPanelCollapse);
2795
2796 // Right Panel Settings
2797 const auto &rightSettings = prefs.GetRightPanelSettings();
2798 m_rightPanelWidthEnabled->SetValue(rightSettings.defaultPanelWidthEnabled);
2799 m_rightPanelWidth->SetValue(rightSettings.defaultPanelWidth);
2800 m_rightPanelWidth->Enable(rightSettings.defaultPanelWidthEnabled);
2801 m_rightPanelMinWidthEnabled->SetValue(rightSettings.minimumPanelWidthEnabled);
2802 m_rightPanelMinWidth->SetValue(rightSettings.minimumPanelWidth);
2803 m_rightPanelMinWidth->Enable(rightSettings.minimumPanelWidthEnabled);
2804
2805 int rightPanelStartupIndex = 0;
2806 switch (rightSettings.panelStartupState) {
2808 rightPanelStartupIndex = 0;
2809 break;
2811 rightPanelStartupIndex = 1;
2812 break;
2814 rightPanelStartupIndex = 2;
2815 break;
2816 }
2817 m_rightPanelStartup->SetSelection(rightPanelStartupIndex);
2818
2819 m_rightPanelShowTabCloseButtons->SetValue(rightSettings.showTabCloseButtons);
2820 m_rightPanelRememberLastTab->SetValue(rightSettings.rememberLastTab);
2821 m_rightPanelAllowCollapse->SetValue(rightSettings.allowPanelCollapse);
2822
2823 // Side panel - Scene Hierarchy Tab settings (from left panel)
2824 const auto &sceneHierarchy = leftSettings.sceneHierarchy;
2825 // Display settings
2826 m_hierarchyShowSearchBar->SetValue(sceneHierarchy.showSearchBar);
2827 m_hierarchyShowNodeIcons->SetValue(sceneHierarchy.showNodeIcons);
2828 m_hierarchyShowTreeLines->SetValue(sceneHierarchy.showTreeLines);
2829 m_hierarchyTreeIndentationSize->SetValue(sceneHierarchy.treeIndentationSize);
2830 // Convert icon size pixels to choice index: 16->0 (Small), 20->1 (Medium), 24->2 (Large)
2831 int hierarchyIconSizeIdx = 0;
2832 if (sceneHierarchy.iconSize == 20)
2833 hierarchyIconSizeIdx = 1;
2834 else if (sceneHierarchy.iconSize == 24)
2835 hierarchyIconSizeIdx = 2;
2836 m_hierarchyIconSize->SetSelection(hierarchyIconSizeIdx);
2837 m_hierarchyFontSize->SetValue(sceneHierarchy.fontSize);
2838 // NOTE: Color controls removed - GTK controls selection colors
2839 // Behavior
2840 m_hierarchyAutoExpandOnLoad->SetValue(sceneHierarchy.autoExpandOnLoad);
2841 m_hierarchySyncWithCanvas->SetValue(sceneHierarchy.syncSelectionWithCanvas);
2842 m_hierarchyLiveSearch->SetValue(sceneHierarchy.liveSearch);
2843 m_hierarchyDoubleClickAction->SetSelection(static_cast<int>(sceneHierarchy.doubleClickAction));
2844 m_hierarchyCtrlClickAction->SetSelection(static_cast<int>(sceneHierarchy.ctrlClickAction));
2845 // Context menu
2846 m_hierarchyShowAddChild->SetValue(sceneHierarchy.showAddChildOption);
2847 m_hierarchyShowDelete->SetValue(sceneHierarchy.showDeleteOption);
2848 m_hierarchyShowRename->SetValue(sceneHierarchy.showRenameOption);
2849 m_hierarchyShowDuplicate->SetValue(sceneHierarchy.showDuplicateOption);
2850 // Performance
2851 m_hierarchyRememberExpandedNodes->SetValue(sceneHierarchy.rememberExpandedNodes);
2852
2853 // Parser settings
2854 m_autoLoadLastFile->SetValue(prefs.GetParserSettings().autoLoadLastFile);
2855 m_showParseWarnings->SetValue(prefs.GetParserSettings().showParseWarnings);
2856
2857 // Find encoding in list
2858 wxString encoding = prefs.GetParserSettings().defaultFileEncoding;
2859 int encodingIdx = m_fileEncoding->FindString(encoding);
2860 if (encodingIdx != wxNOT_FOUND) {
2861 m_fileEncoding->SetSelection(encodingIdx);
2862 } else {
2863 m_fileEncoding->SetSelection(0); // Default to UTF-8
2864 }
2865
2866 // Performance settings
2867 m_enableVSync->SetValue(prefs.GetPerformanceSettings().enableVSync);
2868 m_hardwareAcceleration->SetValue(prefs.GetPerformanceSettings().hardwareAcceleration);
2869 m_enableDoubleBuffering->SetValue(prefs.GetPerformanceSettings().enableDoubleBuffering);
2870 m_enableAntiAliasing->SetValue(prefs.GetPerformanceSettings().enableAntiAliasing);
2871 m_enableTextAntiAliasing->SetValue(prefs.GetPerformanceSettings().enableTextAntiAliasing);
2872 m_enablePartialRedraws->SetValue(prefs.GetPerformanceSettings().enablePartialRedraws);
2873 m_enableBackgroundErase->SetValue(prefs.GetPerformanceSettings().enableBackgroundErase);
2874 m_enableViewportCulling->SetValue(prefs.GetPerformanceSettings().enableViewportCulling);
2875 m_viewportCullingMargin->SetValue(prefs.GetPerformanceSettings().viewportCullingMargin);
2876 m_fpsLimit->SetSelection(static_cast<int>(prefs.GetPerformanceSettings().fpsLimit));
2877 m_enableIdleProcessing->SetValue(prefs.GetPerformanceSettings().enableIdleProcessing);
2878}
2879
2881 using namespace EmberForge;
2882 auto &prefs = AppPreferencesManager::GetInstance().GetPreferences();
2883
2884 // Window settings
2885 prefs.GetWindowSettings().theme = static_cast<AppPreferences::ThemeMode>(m_themeChoice->GetSelection());
2886 wxColour accentColor = m_accentColorPicker->GetColour();
2887 prefs.GetWindowSettings().accentColor =
2888 EmberCore::Color(accentColor.Red(), accentColor.Green(), accentColor.Blue());
2889 prefs.GetWindowSettings().startupMode =
2890 static_cast<AppPreferences::StartupMode>(m_startupModeChoice->GetSelection());
2891
2892 // File menu hotkeys
2893 prefs.GetWindowSettings().newProjectHotkey = m_newProjectHotkeyTextCtrl->GetValue().ToStdString();
2894 prefs.GetWindowSettings().openProjectHotkey = m_openProjectHotkeyTextCtrl->GetValue().ToStdString();
2895 prefs.GetWindowSettings().openFileHotkey = m_openFileHotkeyTextCtrl->GetValue().ToStdString();
2896 prefs.GetWindowSettings().saveHotkey = m_saveHotkeyTextCtrl->GetValue().ToStdString();
2897 prefs.GetWindowSettings().saveAsHotkey = m_saveAsHotkeyTextCtrl->GetValue().ToStdString();
2898
2899 // View menu hotkeys
2900 prefs.GetWindowSettings().maximizeHotkey = m_maximizeHotkeyTextCtrl->GetValue().ToStdString();
2901 prefs.GetWindowSettings().resetUIHotkey = m_resetUIHotkeyTextCtrl->GetValue().ToStdString();
2902
2903 // Settings menu hotkeys
2904 prefs.GetWindowSettings().preferencesHotkey = m_preferencesHotkeyTextCtrl->GetValue().ToStdString();
2905 prefs.GetWindowSettings().parserConfigHotkey = m_parserConfigHotkeyTextCtrl->GetValue().ToStdString();
2906
2907 // Window appearance
2908 prefs.GetWindowSettings().showStatusBar = m_showStatusBar->GetValue();
2909 prefs.GetWindowSettings().showPanelCaptions = m_showPanelCaptions->GetValue();
2910 prefs.GetWindowSettings().alwaysOnTop = m_alwaysOnTop->GetValue();
2911
2912 // Window constraints
2913 prefs.GetWindowSettings().minWindowWidth = m_minWindowWidth->GetValue();
2914 prefs.GetWindowSettings().minWindowHeight = m_minWindowHeight->GetValue();
2915 if (m_maxWindowUnlimited->GetValue()) {
2916 prefs.GetWindowSettings().maxWindowWidth = -1;
2917 prefs.GetWindowSettings().maxWindowHeight = -1;
2918 } else {
2919 prefs.GetWindowSettings().maxWindowWidth = m_maxWindowWidth->GetValue();
2920 prefs.GetWindowSettings().maxWindowHeight = m_maxWindowHeight->GetValue();
2921 }
2922 prefs.GetWindowSettings().enforceAspectRatio = m_enforceAspectRatio->GetValue();
2923
2924 // Parse aspect ratio from text fields
2925 long widthVal = 16, heightVal = 9;
2926 m_aspectRatioWidth->GetValue().ToLong(&widthVal);
2927 m_aspectRatioHeight->GetValue().ToLong(&heightVal);
2928 if (heightVal > 0) {
2929 prefs.GetWindowSettings().aspectRatio = static_cast<float>(widthVal) / static_cast<float>(heightVal);
2930 }
2931
2932 // Main panel settings
2933 prefs.GetMainPanelSettings().defaultZoomLevel = m_defaultZoomSlider->GetValue() / 100.0f;
2934 prefs.GetMainPanelSettings().showGrid = m_showGrid->GetValue();
2935 prefs.GetMainPanelSettings().gridSize = m_gridSize->GetValue();
2936 wxColour gridBg = m_gridBackgroundPicker->GetColour();
2937 prefs.GetMainPanelSettings().gridBackgroundColor = EmberCore::Color(gridBg.Red(), gridBg.Green(), gridBg.Blue());
2938 wxColour gridLineColor = m_gridLineColorPicker->GetColour();
2939 prefs.GetMainPanelSettings().gridLineColor =
2940 EmberCore::Color(gridLineColor.Red(), gridLineColor.Green(), gridLineColor.Blue());
2941 wxColour canvasBg = m_canvasBackgroundPicker->GetColour();
2942 prefs.GetMainPanelSettings().canvasBackgroundColor =
2943 EmberCore::Color(canvasBg.Red(), canvasBg.Green(), canvasBg.Blue());
2944 wxColour connectionLineColor = m_connectionLineColorPicker->GetColour();
2945 prefs.GetMainPanelSettings().connectionLineColor =
2946 EmberCore::Color(connectionLineColor.Red(), connectionLineColor.Green(), connectionLineColor.Blue());
2947 prefs.GetMainPanelSettings().highlightPathToSelected = m_highlightPathToSelected->GetValue();
2948 wxColour pathHighlightColor = m_pathHighlightColorPicker->GetColour();
2949 prefs.GetMainPanelSettings().pathHighlightColor =
2950 EmberCore::Color(pathHighlightColor.Red(), pathHighlightColor.Green(), pathHighlightColor.Blue());
2951 wxColour idleNodeBg = m_idleNodeBgColorPicker->GetColour();
2952 prefs.GetMainPanelSettings().idleNodeBgColor =
2953 EmberCore::Color(idleNodeBg.Red(), idleNodeBg.Green(), idleNodeBg.Blue());
2954 wxColour idleNodeBorder = m_idleNodeBorderColorPicker->GetColour();
2955 prefs.GetMainPanelSettings().idleNodeBorderColor =
2956 EmberCore::Color(idleNodeBorder.Red(), idleNodeBorder.Green(), idleNodeBorder.Blue());
2957 wxColour idleNodeText = m_idleNodeTextColorPicker->GetColour();
2958 prefs.GetMainPanelSettings().idleNodeTextColor =
2959 EmberCore::Color(idleNodeText.Red(), idleNodeText.Green(), idleNodeText.Blue());
2960 prefs.GetMainPanelSettings().selectedNodeBgTint = m_selectedNodeBgTint->GetValue() / 100.0f;
2961 prefs.GetMainPanelSettings().hoveredNodeBgTint = m_hoveredNodeBgTint->GetValue() / 100.0f;
2962 wxColour selectedNode = m_selectedNodeColorPicker->GetColour();
2963 prefs.GetMainPanelSettings().selectedNodeColor =
2964 EmberCore::Color(selectedNode.Red(), selectedNode.Green(), selectedNode.Blue());
2965 wxColour hoveredNode = m_hoveredNodeColorPicker->GetColour();
2966 prefs.GetMainPanelSettings().hoveredNodeColor =
2967 EmberCore::Color(hoveredNode.Red(), hoveredNode.Green(), hoveredNode.Blue());
2968 wxColour selectedNodeText = m_selectedNodeTextColorPicker->GetColour();
2969 prefs.GetMainPanelSettings().selectedNodeTextColor =
2970 EmberCore::Color(selectedNodeText.Red(), selectedNodeText.Green(), selectedNodeText.Blue());
2971 wxColour hoveredNodeText = m_hoveredNodeTextColorPicker->GetColour();
2972 prefs.GetMainPanelSettings().hoveredNodeTextColor =
2973 EmberCore::Color(hoveredNodeText.Red(), hoveredNodeText.Green(), hoveredNodeText.Blue());
2974 wxColour selectedNodeInfo = m_selectedNodeInfoColorPicker->GetColour();
2975 prefs.GetMainPanelSettings().selectedNodeInfoColor =
2976 EmberCore::Color(selectedNodeInfo.Red(), selectedNodeInfo.Green(), selectedNodeInfo.Blue());
2977 wxColour hoveredNodeInfo = m_hoveredNodeInfoColorPicker->GetColour();
2978 prefs.GetMainPanelSettings().hoveredNodeInfoColor =
2979 EmberCore::Color(hoveredNodeInfo.Red(), hoveredNodeInfo.Green(), hoveredNodeInfo.Blue());
2980
2981 // Scene management
2982 if (m_maxScenesUnlimited->GetValue()) {
2983 prefs.GetMainPanelSettings().maxScenes = -1;
2984 } else {
2985 prefs.GetMainPanelSettings().maxScenes = m_maxScenes->GetValue();
2986 }
2987
2988 prefs.GetMainPanelSettings().closeConfirmation =
2989 static_cast<AppPreferences::CloseConfirmationMode>(m_closeConfirmation->GetSelection());
2990
2991 prefs.GetMainPanelSettings().nextSceneHotkey = m_nextSceneHotkeyTextCtrl->GetValue().ToStdString();
2992 prefs.GetMainPanelSettings().previousSceneHotkey = m_previousSceneHotkeyTextCtrl->GetValue().ToStdString();
2993
2994 // Behavior tree view settings
2995 auto &btViewSettings = prefs.GetBehaviorTreeViewSettings();
2996
2997 // Convert zoom step size from percentage (1-50) to float (0.01-0.5)
2998 btViewSettings.zoomStepSize = m_zoomStepSize->GetValue() / 100.0f;
2999
3000 btViewSettings.mouseWheelSensitivity = m_mouseWheelSensitivity->GetValue() / 100.0f;
3001 btViewSettings.zoomFollowsCursor = m_zoomFollowsCursor->GetValue();
3002 btViewSettings.resetViewHotkey = m_resetViewHotkeyTextCtrl->GetValue().ToStdString();
3003 btViewSettings.panSensitivity = m_panSensitivity->GetValue() / 100.0f;
3004 btViewSettings.panKey = m_panKeyTextCtrl->GetValue().ToStdString();
3005 btViewSettings.enableSmoothPanning = m_enableSmoothPanning->GetValue();
3006 btViewSettings.panSmoothness = static_cast<float>(m_panSmoothness->GetValue());
3007 btViewSettings.panStepSize = static_cast<float>(m_panStepSize->GetValue());
3008 btViewSettings.centerOnNodeHotkey = m_centerOnNodeHotkeyTextCtrl->GetValue().ToStdString();
3009 btViewSettings.deleteNodeHotkey = m_deleteNodeHotkeyTextCtrl->GetValue().ToStdString();
3010 btViewSettings.panUpHotkey = m_panUpHotkeyTextCtrl->GetValue().ToStdString();
3011 btViewSettings.panDownHotkey = m_panDownHotkeyTextCtrl->GetValue().ToStdString();
3012 btViewSettings.panLeftHotkey = m_panLeftHotkeyTextCtrl->GetValue().ToStdString();
3013 btViewSettings.panRightHotkey = m_panRightHotkeyTextCtrl->GetValue().ToStdString();
3014
3015 // Debug text settings - Coordinate System Info
3017 btViewSettings.showCoordinateInfo = m_showCoordinateInfo->GetValue();
3019 btViewSettings.coordinateInfoFontSize = m_coordinateInfoFontSize->GetValue();
3021 wxColour coordColor = m_coordinateInfoColorPicker->GetColour();
3022 btViewSettings.coordinateInfoColor = EmberCore::Color(coordColor.Red(), coordColor.Green(), coordColor.Blue());
3023 }
3025 btViewSettings.coordinateInfoAnchor =
3028 btViewSettings.coordinateInfoX = m_coordinateInfoX->GetValue();
3030 btViewSettings.coordinateInfoY = m_coordinateInfoY->GetValue();
3031
3032 // Debug text settings - Selected Node Info
3034 btViewSettings.showSelectedNodeInfo = m_showSelectedNodeInfo->GetValue();
3036 btViewSettings.selectedNodeInfoFontSize = m_selectedNodeInfoFontSize->GetValue();
3038 wxColour selColor = m_selectedNodeDebugInfoColorPicker->GetColour();
3039 btViewSettings.selectedNodeInfoColor = EmberCore::Color(selColor.Red(), selColor.Green(), selColor.Blue());
3040 }
3042 btViewSettings.selectedNodeInfoAnchor =
3045 btViewSettings.selectedNodeInfoX = m_selectedNodeInfoX->GetValue();
3047 btViewSettings.selectedNodeInfoY = m_selectedNodeInfoY->GetValue();
3048
3049 // Debug text settings - Tree Statistics Info
3050 if (m_showTreeInfo)
3051 btViewSettings.showTreeInfo = m_showTreeInfo->GetValue();
3053 btViewSettings.treeInfoFontSize = m_treeInfoFontSize->GetValue();
3055 wxColour treeColor = m_treeInfoColorPicker->GetColour();
3056 btViewSettings.treeInfoColor = EmberCore::Color(treeColor.Red(), treeColor.Green(), treeColor.Blue());
3057 }
3058 if (m_treeInfoAnchor)
3059 btViewSettings.treeInfoAnchor =
3060 static_cast<EmberForge::AppPreferences::TextAnchor>(m_treeInfoAnchor->GetSelection());
3061 if (m_treeInfoX)
3062 btViewSettings.treeInfoX = m_treeInfoX->GetValue();
3063 if (m_treeInfoY)
3064 btViewSettings.treeInfoY = m_treeInfoY->GetValue();
3065
3066 // Debug text settings - FPS Display
3067 if (m_showFPS)
3068 btViewSettings.showFPS = m_showFPS->GetValue();
3069 if (m_fpsFontSize)
3070 btViewSettings.fpsFontSize = m_fpsFontSize->GetValue();
3071 if (m_fpsColorPicker) {
3072 wxColour fpsColor = m_fpsColorPicker->GetColour();
3073 btViewSettings.fpsColor = EmberCore::Color(fpsColor.Red(), fpsColor.Green(), fpsColor.Blue());
3074 }
3075 if (m_fpsAnchor)
3076 btViewSettings.fpsAnchor = static_cast<EmberForge::AppPreferences::TextAnchor>(m_fpsAnchor->GetSelection());
3077 if (m_fpsX)
3078 btViewSettings.fpsX = m_fpsX->GetValue();
3079 if (m_fpsY)
3080 btViewSettings.fpsY = m_fpsY->GetValue();
3081
3082 // Debug text settings - Controls Help Text
3084 btViewSettings.showControlsHelp = m_showControlsHelp->GetValue();
3086 btViewSettings.controlsHelpFontSize = m_controlsHelpFontSize->GetValue();
3088 wxColour ctrlColor = m_controlsHelpColorPicker->GetColour();
3089 btViewSettings.controlsHelpColor = EmberCore::Color(ctrlColor.Red(), ctrlColor.Green(), ctrlColor.Blue());
3090 }
3092 btViewSettings.controlsHelpAnchor =
3094 if (m_controlsHelpX)
3095 btViewSettings.controlsHelpX = m_controlsHelpX->GetValue();
3096 if (m_controlsHelpY)
3097 btViewSettings.controlsHelpY = m_controlsHelpY->GetValue();
3098
3099 // Bottom panel container settings
3100 auto &bottomSettings = prefs.GetBottomPanelSettings();
3101 bottomSettings.defaultPanelHeight = m_bottomPanelHeight->GetValue();
3102 bottomSettings.defaultPanelHeightEnabled = m_bottomPanelHeightEnabled->GetValue();
3103 bottomSettings.minimumPanelHeight = m_bottomPanelMinHeight->GetValue();
3104 bottomSettings.minimumPanelHeightEnabled = m_bottomPanelMinHeightEnabled->GetValue();
3105 bottomSettings.panelStartupState =
3106 static_cast<AppPreferences::PanelStartupState>(m_bottomPanelStartup->GetSelection());
3107 bottomSettings.showTabCloseButtons = m_showTabCloseButtons->GetValue();
3108 bottomSettings.rememberLastTab = m_rememberLastTab->GetValue();
3109 bottomSettings.allowPanelCollapse = m_allowPanelCollapse->GetValue();
3110
3111 // File Explorer tab general settings
3112 bottomSettings.showBreadcrumb = m_showBreadcrumb->GetValue();
3113 bottomSettings.showHistory = m_showHistory->GetValue();
3114
3115 // Start Path Mode
3116 bottomSettings.startPathMode = static_cast<AppPreferences::StartPathMode>(m_startPathMode->GetSelection());
3117 bottomSettings.customStartPath = m_customStartPath->GetValue().ToStdString();
3118
3119 // Tree View settings
3120 bottomSettings.treeView.showHiddenFiles = m_treeShowHiddenFiles->GetValue();
3121 bottomSettings.treeView.showFileExtensions = m_treeShowFileExtensions->GetValue();
3122 bottomSettings.treeView.sortFilesBy = static_cast<AppPreferences::SortBy>(m_treeSortFilesBy->GetSelection());
3123
3124 // Tree Item Size
3125 int treeItemSizeSelection = m_treeItemSize->GetSelection();
3126 switch (treeItemSizeSelection) {
3127 case 0:
3128 bottomSettings.treeView.itemSize = AppPreferences::TreeItemSize::Small;
3129 break;
3130 case 1:
3131 bottomSettings.treeView.itemSize = AppPreferences::TreeItemSize::Medium;
3132 break;
3133 case 2:
3134 bottomSettings.treeView.itemSize = AppPreferences::TreeItemSize::Large;
3135 break;
3136 default:
3137 bottomSettings.treeView.itemSize = AppPreferences::TreeItemSize::Small;
3138 break;
3139 }
3140
3141 // Grid View settings
3142 bottomSettings.gridView.showHiddenFiles = m_gridShowHiddenFiles->GetValue();
3143 bottomSettings.gridView.showFileExtensions = m_gridShowFileExtensions->GetValue();
3144 bottomSettings.gridView.sortFilesBy = static_cast<AppPreferences::SortBy>(m_gridSortFilesBy->GetSelection());
3145
3146 // Icon Size
3147 int iconSizeSelection = m_gridIconSize->GetSelection();
3148 switch (iconSizeSelection) {
3149 case 0:
3150 bottomSettings.gridView.iconSize = AppPreferences::IconSize::Small;
3151 break;
3152 case 1:
3153 bottomSettings.gridView.iconSize = AppPreferences::IconSize::Medium;
3154 break;
3155 case 2:
3156 bottomSettings.gridView.iconSize = AppPreferences::IconSize::Large;
3157 break;
3158 default:
3159 bottomSettings.gridView.iconSize = AppPreferences::IconSize::Medium;
3160 break;
3161 }
3162
3163 // Log Tab settings
3164 bottomSettings.logTab.defaultLevelFilter = m_logDefaultLevelFilter->GetSelection();
3165 bottomSettings.logTab.autoScrollEnabled = m_logAutoScrollEnabled->GetValue();
3166 bottomSettings.logTab.maxLogEntries = m_logMaxEntries->GetValue();
3167 bottomSettings.logTab.enableGuiColors = m_logEnableGuiColors->GetValue();
3168 bottomSettings.logTab.enableConsoleColors = m_logEnableConsoleColors->GetValue();
3169
3170 int logFontSizeSelection = m_logFontSize->GetSelection();
3171 switch (logFontSizeSelection) {
3172 case 0:
3173 bottomSettings.logTab.fontSize = AppPreferences::LogFontSize::Small;
3174 break;
3175 case 1:
3176 bottomSettings.logTab.fontSize = AppPreferences::LogFontSize::Medium;
3177 break;
3178 case 2:
3179 bottomSettings.logTab.fontSize = AppPreferences::LogFontSize::Large;
3180 break;
3181 default:
3182 bottomSettings.logTab.fontSize = AppPreferences::LogFontSize::Medium;
3183 break;
3184 }
3185
3186 // Log level colors
3187 wxColour traceCol = m_logTraceColor->GetColour();
3188 bottomSettings.logTab.traceColor = {traceCol.Red(), traceCol.Green(), traceCol.Blue()};
3189 wxColour infoCol = m_logInfoColor->GetColour();
3190 bottomSettings.logTab.infoColor = {infoCol.Red(), infoCol.Green(), infoCol.Blue()};
3191 wxColour warningCol = m_logWarningColor->GetColour();
3192 bottomSettings.logTab.warningColor = {warningCol.Red(), warningCol.Green(), warningCol.Blue()};
3193 wxColour errorCol = m_logErrorColor->GetColour();
3194 bottomSettings.logTab.errorColor = {errorCol.Red(), errorCol.Green(), errorCol.Blue()};
3195 wxColour criticalCol = m_logCriticalColor->GetColour();
3196 bottomSettings.logTab.criticalColor = {criticalCol.Red(), criticalCol.Green(), criticalCol.Blue()};
3197
3198 // Left Panel Settings
3199 auto &leftSettings = prefs.GetLeftPanelSettings();
3200 leftSettings.defaultPanelWidthEnabled = m_leftPanelWidthEnabled->GetValue();
3201 leftSettings.defaultPanelWidth = m_leftPanelWidth->GetValue();
3202 leftSettings.minimumPanelWidthEnabled = m_leftPanelMinWidthEnabled->GetValue();
3203 leftSettings.minimumPanelWidth = m_leftPanelMinWidth->GetValue();
3204
3205 int leftPanelStartupSelection = m_leftPanelStartup->GetSelection();
3207 switch (leftPanelStartupSelection) {
3208 case 0:
3209 leftStartupState = AppPreferences::PanelStartupState::Show;
3210 break;
3211 case 1:
3212 leftStartupState = AppPreferences::PanelStartupState::Hide;
3213 break;
3214 case 2:
3216 break;
3217 default:
3218 leftStartupState = AppPreferences::PanelStartupState::Show;
3219 break;
3220 }
3221 leftSettings.panelStartupState = leftStartupState;
3222
3223 leftSettings.showTabCloseButtons = m_leftPanelShowTabCloseButtons->GetValue();
3224 leftSettings.rememberLastTab = m_leftPanelRememberLastTab->GetValue();
3225 leftSettings.allowPanelCollapse = m_leftPanelAllowCollapse->GetValue();
3226
3227 // Right Panel Settings
3228 auto &rightSettings = prefs.GetRightPanelSettings();
3229 rightSettings.defaultPanelWidthEnabled = m_rightPanelWidthEnabled->GetValue();
3230 rightSettings.defaultPanelWidth = m_rightPanelWidth->GetValue();
3231 rightSettings.minimumPanelWidthEnabled = m_rightPanelMinWidthEnabled->GetValue();
3232 rightSettings.minimumPanelWidth = m_rightPanelMinWidth->GetValue();
3233
3234 int rightPanelStartupSelection = m_rightPanelStartup->GetSelection();
3236 switch (rightPanelStartupSelection) {
3237 case 0:
3238 rightStartupState = AppPreferences::PanelStartupState::Show;
3239 break;
3240 case 1:
3241 rightStartupState = AppPreferences::PanelStartupState::Hide;
3242 break;
3243 case 2:
3245 break;
3246 default:
3247 rightStartupState = AppPreferences::PanelStartupState::Show;
3248 break;
3249 }
3250 rightSettings.panelStartupState = rightStartupState;
3251
3252 rightSettings.showTabCloseButtons = m_rightPanelShowTabCloseButtons->GetValue();
3253 rightSettings.rememberLastTab = m_rightPanelRememberLastTab->GetValue();
3254 rightSettings.allowPanelCollapse = m_rightPanelAllowCollapse->GetValue();
3255
3256 // Side panel - Scene Hierarchy Tab settings (apply to left panel where it lives by default)
3257 auto &sceneHierarchy = leftSettings.sceneHierarchy;
3258 // Display settings
3259 sceneHierarchy.showSearchBar = m_hierarchyShowSearchBar->GetValue();
3260 sceneHierarchy.showNodeIcons = m_hierarchyShowNodeIcons->GetValue();
3261 sceneHierarchy.showTreeLines = m_hierarchyShowTreeLines->GetValue();
3262 sceneHierarchy.treeIndentationSize = m_hierarchyTreeIndentationSize->GetValue();
3263 // Convert choice index to icon size pixels: 0->16 (Small), 1->20 (Medium), 2->24 (Large)
3264 int hierarchyIconSizeIdx = m_hierarchyIconSize->GetSelection();
3265 sceneHierarchy.iconSize = (hierarchyIconSizeIdx == 0) ? 16 : (hierarchyIconSizeIdx == 1) ? 20 : 24;
3266 sceneHierarchy.fontSize = m_hierarchyFontSize->GetValue();
3267 // NOTE: Color settings removed - GTK controls selection colors
3268 // Behavior
3269 sceneHierarchy.autoExpandOnLoad = m_hierarchyAutoExpandOnLoad->GetValue();
3270 sceneHierarchy.syncSelectionWithCanvas = m_hierarchySyncWithCanvas->GetValue();
3271 sceneHierarchy.liveSearch = m_hierarchyLiveSearch->GetValue();
3272 sceneHierarchy.doubleClickAction = static_cast<AppPreferences::SceneHierarchyTabSettings::ClickAction>(
3273 m_hierarchyDoubleClickAction->GetSelection());
3274 sceneHierarchy.ctrlClickAction =
3276 // Context menu
3277 sceneHierarchy.showAddChildOption = m_hierarchyShowAddChild->GetValue();
3278 sceneHierarchy.showDeleteOption = m_hierarchyShowDelete->GetValue();
3279 sceneHierarchy.showRenameOption = m_hierarchyShowRename->GetValue();
3280 sceneHierarchy.showDuplicateOption = m_hierarchyShowDuplicate->GetValue();
3281 // Performance
3282 sceneHierarchy.rememberExpandedNodes = m_hierarchyRememberExpandedNodes->GetValue();
3283
3284 // Parser settings
3285 prefs.GetParserSettings().autoLoadLastFile = m_autoLoadLastFile->GetValue();
3286 prefs.GetParserSettings().showParseWarnings = m_showParseWarnings->GetValue();
3287 prefs.GetParserSettings().defaultFileEncoding = m_fileEncoding->GetStringSelection().ToStdString();
3288
3289 // Performance settings
3290 prefs.GetPerformanceSettings().enableVSync = m_enableVSync->GetValue();
3291 prefs.GetPerformanceSettings().hardwareAcceleration = m_hardwareAcceleration->GetValue();
3292 prefs.GetPerformanceSettings().enableDoubleBuffering = m_enableDoubleBuffering->GetValue();
3293 prefs.GetPerformanceSettings().enableAntiAliasing = m_enableAntiAliasing->GetValue();
3294 prefs.GetPerformanceSettings().enableTextAntiAliasing = m_enableTextAntiAliasing->GetValue();
3295 prefs.GetPerformanceSettings().enablePartialRedraws = m_enablePartialRedraws->GetValue();
3296 prefs.GetPerformanceSettings().enableBackgroundErase = m_enableBackgroundErase->GetValue();
3297 prefs.GetPerformanceSettings().enableViewportCulling = m_enableViewportCulling->GetValue();
3298 prefs.GetPerformanceSettings().viewportCullingMargin = m_viewportCullingMargin->GetValue();
3299 prefs.GetPerformanceSettings().fpsLimit = static_cast<AppPreferences::FPSLimit>(m_fpsLimit->GetSelection());
3300 prefs.GetPerformanceSettings().enableIdleProcessing = m_enableIdleProcessing->GetValue();
3301
3302 // Save to file
3304 if (prefs.SaveToFile(configPath)) {
3305 LOG_INFO("Preferences", "Settings saved successfully");
3306 } else {
3307 LOG_ERROR("Preferences", "Failed to save settings");
3308 wxMessageBox("Failed to save preferences to file.", "Error", wxOK | wxICON_ERROR, this);
3309 }
3310}
3311
3313 using namespace EmberForge;
3314 AppPreferences defaultPrefs;
3315
3316 // Load defaults into controls
3317 auto &winSettings = defaultPrefs.GetWindowSettings();
3318 m_themeChoice->SetSelection(static_cast<int>(winSettings.theme));
3319 wxColour accentColor(winSettings.accentColor.r, winSettings.accentColor.g, winSettings.accentColor.b);
3320 m_accentColorPicker->SetColour(accentColor);
3321 m_startupModeChoice->SetSelection(static_cast<int>(winSettings.startupMode));
3322
3323 // File menu hotkeys defaults
3324 m_newProjectHotkeyTextCtrl->SetValue(wxString(winSettings.newProjectHotkey));
3325 m_openProjectHotkeyTextCtrl->SetValue(wxString(winSettings.openProjectHotkey));
3326 m_openFileHotkeyTextCtrl->SetValue(wxString(winSettings.openFileHotkey));
3327 m_saveHotkeyTextCtrl->SetValue(wxString(winSettings.saveHotkey));
3328 m_saveAsHotkeyTextCtrl->SetValue(wxString(winSettings.saveAsHotkey));
3329
3330 // View menu hotkeys defaults
3331 m_maximizeHotkeyTextCtrl->SetValue(wxString(winSettings.maximizeHotkey));
3332 m_resetUIHotkeyTextCtrl->SetValue(wxString(winSettings.resetUIHotkey));
3333
3334 // Settings menu hotkeys defaults
3335 m_preferencesHotkeyTextCtrl->SetValue(wxString(winSettings.preferencesHotkey));
3336 m_parserConfigHotkeyTextCtrl->SetValue(wxString(winSettings.parserConfigHotkey));
3337
3338 // Window appearance defaults
3339 m_showStatusBar->SetValue(winSettings.showStatusBar);
3340 m_showPanelCaptions->SetValue(winSettings.showPanelCaptions);
3341 m_alwaysOnTop->SetValue(winSettings.alwaysOnTop);
3342
3343 // Window constraints defaults
3344 m_minWindowWidth->SetValue(winSettings.minWindowWidth);
3345 m_minWindowHeight->SetValue(winSettings.minWindowHeight);
3346 bool maxUnlimited = (winSettings.maxWindowWidth == -1);
3347 m_maxWindowUnlimited->SetValue(maxUnlimited);
3348 m_maxWindowWidth->SetValue(winSettings.maxWindowWidth);
3349 m_maxWindowHeight->SetValue(winSettings.maxWindowHeight);
3350 m_maxWindowWidth->Enable(!maxUnlimited);
3351 m_maxWindowHeight->Enable(!maxUnlimited);
3352
3353 m_enforceAspectRatio->SetValue(winSettings.enforceAspectRatio);
3354 int width = 16, height = 9;
3355 float ratio = winSettings.aspectRatio;
3356 if (std::abs(ratio - 16.0f / 9.0f) < 0.01f) {
3357 width = 16;
3358 height = 9;
3359 } else if (std::abs(ratio - 4.0f / 3.0f) < 0.01f) {
3360 width = 4;
3361 height = 3;
3362 } else if (std::abs(ratio - 21.0f / 9.0f) < 0.01f) {
3363 width = 21;
3364 height = 9;
3365 }
3366 m_aspectRatioWidth->SetValue(wxString::Format("%d", width));
3367 m_aspectRatioHeight->SetValue(wxString::Format("%d", height));
3368
3369 auto &mainSettings = defaultPrefs.GetMainPanelSettings();
3370 int zoomPercent = static_cast<int>(mainSettings.defaultZoomLevel * 100);
3371 m_defaultZoomSlider->SetValue(zoomPercent);
3372 m_zoomLabel->SetLabel(wxString::Format("%d%%", zoomPercent));
3373 m_showGrid->SetValue(mainSettings.showGrid);
3374 m_gridSize->SetValue(mainSettings.gridSize);
3375 wxColour gridBg(mainSettings.gridBackgroundColor.r, mainSettings.gridBackgroundColor.g,
3376 mainSettings.gridBackgroundColor.b);
3377 m_gridBackgroundPicker->SetColour(gridBg);
3378 wxColour gridLineColor(mainSettings.gridLineColor.r, mainSettings.gridLineColor.g, mainSettings.gridLineColor.b);
3379 m_gridLineColorPicker->SetColour(gridLineColor);
3380 wxColour canvasBg(mainSettings.canvasBackgroundColor.r, mainSettings.canvasBackgroundColor.g,
3381 mainSettings.canvasBackgroundColor.b);
3382 m_canvasBackgroundPicker->SetColour(canvasBg);
3383 wxColour connectionLineColor(mainSettings.connectionLineColor.r, mainSettings.connectionLineColor.g,
3384 mainSettings.connectionLineColor.b);
3385 m_connectionLineColorPicker->SetColour(connectionLineColor);
3386 m_highlightPathToSelected->SetValue(mainSettings.highlightPathToSelected);
3387 wxColour pathHighlightColor(mainSettings.pathHighlightColor.r, mainSettings.pathHighlightColor.g,
3388 mainSettings.pathHighlightColor.b);
3389 m_pathHighlightColorPicker->SetColour(pathHighlightColor);
3390 wxColour idleNodeBg(mainSettings.idleNodeBgColor.r, mainSettings.idleNodeBgColor.g, mainSettings.idleNodeBgColor.b);
3391 m_idleNodeBgColorPicker->SetColour(idleNodeBg);
3392 wxColour idleNodeBorder(mainSettings.idleNodeBorderColor.r, mainSettings.idleNodeBorderColor.g,
3393 mainSettings.idleNodeBorderColor.b);
3394 m_idleNodeBorderColorPicker->SetColour(idleNodeBorder);
3395 wxColour idleNodeText(mainSettings.idleNodeTextColor.r, mainSettings.idleNodeTextColor.g,
3396 mainSettings.idleNodeTextColor.b);
3397 m_idleNodeTextColorPicker->SetColour(idleNodeText);
3398 int selectedTint = static_cast<int>(mainSettings.selectedNodeBgTint * 100);
3399 m_selectedNodeBgTint->SetValue(selectedTint);
3400 m_selectedNodeBgTintLabel->SetLabel(wxString::Format("%d%%", selectedTint));
3401 int hoveredTint = static_cast<int>(mainSettings.hoveredNodeBgTint * 100);
3402 m_hoveredNodeBgTint->SetValue(hoveredTint);
3403 m_hoveredNodeBgTintLabel->SetLabel(wxString::Format("%d%%", hoveredTint));
3404 wxColour selectedNode(mainSettings.selectedNodeColor.r, mainSettings.selectedNodeColor.g,
3405 mainSettings.selectedNodeColor.b);
3406 m_selectedNodeColorPicker->SetColour(selectedNode);
3407 wxColour hoveredNode(mainSettings.hoveredNodeColor.r, mainSettings.hoveredNodeColor.g,
3408 mainSettings.hoveredNodeColor.b);
3409 m_hoveredNodeColorPicker->SetColour(hoveredNode);
3410 wxColour selectedNodeText(mainSettings.selectedNodeTextColor.r, mainSettings.selectedNodeTextColor.g,
3411 mainSettings.selectedNodeTextColor.b);
3412 m_selectedNodeTextColorPicker->SetColour(selectedNodeText);
3413 wxColour hoveredNodeText(mainSettings.hoveredNodeTextColor.r, mainSettings.hoveredNodeTextColor.g,
3414 mainSettings.hoveredNodeTextColor.b);
3415 m_hoveredNodeTextColorPicker->SetColour(hoveredNodeText);
3416 wxColour selectedNodeInfo(mainSettings.selectedNodeInfoColor.r, mainSettings.selectedNodeInfoColor.g,
3417 mainSettings.selectedNodeInfoColor.b);
3418 m_selectedNodeInfoColorPicker->SetColour(selectedNodeInfo);
3419 wxColour hoveredNodeInfo(mainSettings.hoveredNodeInfoColor.r, mainSettings.hoveredNodeInfoColor.g,
3420 mainSettings.hoveredNodeInfoColor.b);
3421 m_hoveredNodeInfoColorPicker->SetColour(hoveredNodeInfo);
3422
3423 // Scene management defaults
3424 bool scenesUnlimited = (mainSettings.maxScenes == -1);
3425 m_maxScenesUnlimited->SetValue(scenesUnlimited);
3426 m_maxScenes->SetValue(mainSettings.maxScenes > 0 ? mainSettings.maxScenes : 10);
3427 m_maxScenes->Enable(!scenesUnlimited);
3428
3429 m_closeConfirmation->SetSelection(static_cast<int>(mainSettings.closeConfirmation));
3430
3431 m_nextSceneHotkeyTextCtrl->SetValue(wxString(mainSettings.nextSceneHotkey));
3432 m_previousSceneHotkeyTextCtrl->SetValue(wxString(mainSettings.previousSceneHotkey));
3433
3434 // Behavior tree view defaults
3435 auto &btViewSettings = defaultPrefs.GetBehaviorTreeViewSettings();
3436 int zoomStepPercent = static_cast<int>(btViewSettings.zoomStepSize * 100);
3437 m_zoomStepSize->SetValue(zoomStepPercent);
3438 m_zoomStepSizeLabel->SetLabel(wxString::Format("%d%%", zoomStepPercent));
3439 int wheelSensitivity = static_cast<int>(btViewSettings.mouseWheelSensitivity * 100);
3440 m_mouseWheelSensitivity->SetValue(wheelSensitivity);
3441 m_mouseWheelSensitivityLabel->SetLabel(wxString::Format("%.1fx", btViewSettings.mouseWheelSensitivity));
3442 m_zoomFollowsCursor->SetValue(btViewSettings.zoomFollowsCursor);
3443 m_resetViewHotkeyTextCtrl->SetValue(wxString(btViewSettings.resetViewHotkey));
3444 int panSensitivity = static_cast<int>(btViewSettings.panSensitivity * 100);
3445 m_panSensitivity->SetValue(panSensitivity);
3446 m_panSensitivityLabel->SetLabel(wxString::Format("%.1fx", btViewSettings.panSensitivity));
3447 m_panKeyTextCtrl->SetValue(wxString(btViewSettings.panKey));
3448 m_enableSmoothPanning->SetValue(btViewSettings.enableSmoothPanning);
3449 m_panSmoothness->SetValue(static_cast<int>(btViewSettings.panSmoothness));
3450 m_panSmoothnessLabel->SetLabel(wxString::Format("%d%%", static_cast<int>(btViewSettings.panSmoothness)));
3451 m_centerOnNodeHotkeyTextCtrl->SetValue(wxString(btViewSettings.centerOnNodeHotkey));
3452 m_deleteNodeHotkeyTextCtrl->SetValue(wxString(btViewSettings.deleteNodeHotkey));
3453 m_panUpHotkeyTextCtrl->SetValue(wxString(btViewSettings.panUpHotkey));
3454 m_panDownHotkeyTextCtrl->SetValue(wxString(btViewSettings.panDownHotkey));
3455 m_panLeftHotkeyTextCtrl->SetValue(wxString(btViewSettings.panLeftHotkey));
3456 m_panRightHotkeyTextCtrl->SetValue(wxString(btViewSettings.panRightHotkey));
3457
3458 auto &bottomSettings = defaultPrefs.GetBottomPanelSettings();
3459 // Bottom panel container settings
3460 m_bottomPanelHeight->SetValue(bottomSettings.defaultPanelHeight);
3461 m_bottomPanelHeightEnabled->SetValue(bottomSettings.defaultPanelHeightEnabled);
3462 m_bottomPanelHeight->Enable(bottomSettings.defaultPanelHeightEnabled);
3463 m_bottomPanelMinHeight->SetValue(bottomSettings.minimumPanelHeight);
3464 m_bottomPanelMinHeightEnabled->SetValue(bottomSettings.minimumPanelHeightEnabled);
3465 m_bottomPanelMinHeight->Enable(bottomSettings.minimumPanelHeightEnabled);
3466 m_bottomPanelStartup->SetSelection(static_cast<int>(bottomSettings.panelStartupState));
3467 m_showTabCloseButtons->SetValue(bottomSettings.showTabCloseButtons);
3468 m_rememberLastTab->SetValue(bottomSettings.rememberLastTab);
3469 m_allowPanelCollapse->SetValue(bottomSettings.allowPanelCollapse);
3470
3471 // File Explorer tab general settings
3472 m_showBreadcrumb->SetValue(bottomSettings.showBreadcrumb);
3473 m_showHistory->SetValue(bottomSettings.showHistory);
3474
3475 // Start Path Mode
3476 int defStartPathModeIndex = static_cast<int>(bottomSettings.startPathMode);
3477 m_startPathMode->SetSelection(defStartPathModeIndex);
3478 m_customStartPath->SetValue(wxString(bottomSettings.customStartPath));
3479 bool defEnableCustomPath = (defStartPathModeIndex == 1); // CustomPath (second option)
3480 m_customStartPath->Enable(defEnableCustomPath);
3481 m_browseStartPath->Enable(defEnableCustomPath);
3482
3483 // Tree View settings
3484 m_treeShowHiddenFiles->SetValue(bottomSettings.treeView.showHiddenFiles);
3485 m_treeShowFileExtensions->SetValue(bottomSettings.treeView.showFileExtensions);
3486 m_treeSortFilesBy->SetSelection(static_cast<int>(bottomSettings.treeView.sortFilesBy));
3487
3488 // Tree Item Size
3489 int defTreeItemSizeIndex = 1; // Default to Medium
3490 switch (bottomSettings.treeView.itemSize) {
3492 defTreeItemSizeIndex = 0;
3493 break;
3495 defTreeItemSizeIndex = 1;
3496 break;
3498 defTreeItemSizeIndex = 2;
3499 break;
3500 }
3501 m_treeItemSize->SetSelection(defTreeItemSizeIndex);
3502
3503 // Grid View settings
3504 m_gridShowHiddenFiles->SetValue(bottomSettings.gridView.showHiddenFiles);
3505 m_gridShowFileExtensions->SetValue(bottomSettings.gridView.showFileExtensions);
3506 m_gridSortFilesBy->SetSelection(static_cast<int>(bottomSettings.gridView.sortFilesBy));
3507
3508 // Icon Size
3509 int defIconSizeIndex = 1; // Default to Medium
3510 switch (bottomSettings.gridView.iconSize) {
3512 defIconSizeIndex = 0;
3513 break;
3515 defIconSizeIndex = 1;
3516 break;
3518 defIconSizeIndex = 2;
3519 break;
3520 }
3521 m_gridIconSize->SetSelection(defIconSizeIndex);
3522
3523 // Log Tab settings
3524 m_logDefaultLevelFilter->SetSelection(bottomSettings.logTab.defaultLevelFilter);
3525 m_logAutoScrollEnabled->SetValue(bottomSettings.logTab.autoScrollEnabled);
3526 m_logMaxEntries->SetValue(bottomSettings.logTab.maxLogEntries);
3527 m_logEnableGuiColors->SetValue(bottomSettings.logTab.enableGuiColors);
3528 m_logEnableConsoleColors->SetValue(bottomSettings.logTab.enableConsoleColors);
3529
3530 int defLogFontSizeIndex = 1; // Default to Medium
3531 switch (bottomSettings.logTab.fontSize) {
3533 defLogFontSizeIndex = 0;
3534 break;
3536 defLogFontSizeIndex = 1;
3537 break;
3539 defLogFontSizeIndex = 2;
3540 break;
3541 }
3542 m_logFontSize->SetSelection(defLogFontSizeIndex);
3543
3544 // Log level colors (defaults)
3545 m_logTraceColor->SetColour(wxColour(bottomSettings.logTab.traceColor.r, bottomSettings.logTab.traceColor.g,
3546 bottomSettings.logTab.traceColor.b));
3547 m_logInfoColor->SetColour(wxColour(bottomSettings.logTab.infoColor.r, bottomSettings.logTab.infoColor.g,
3548 bottomSettings.logTab.infoColor.b));
3549 m_logWarningColor->SetColour(wxColour(bottomSettings.logTab.warningColor.r, bottomSettings.logTab.warningColor.g,
3550 bottomSettings.logTab.warningColor.b));
3551 m_logErrorColor->SetColour(wxColour(bottomSettings.logTab.errorColor.r, bottomSettings.logTab.errorColor.g,
3552 bottomSettings.logTab.errorColor.b));
3553 m_logCriticalColor->SetColour(wxColour(bottomSettings.logTab.criticalColor.r, bottomSettings.logTab.criticalColor.g,
3554 bottomSettings.logTab.criticalColor.b));
3555
3556 // Left Panel Settings (defaults)
3557 const auto &defLeftSettings = defaultPrefs.GetLeftPanelSettings();
3558 m_leftPanelWidthEnabled->SetValue(defLeftSettings.defaultPanelWidthEnabled);
3559 m_leftPanelWidth->SetValue(defLeftSettings.defaultPanelWidth);
3560 m_leftPanelWidth->Enable(defLeftSettings.defaultPanelWidthEnabled);
3561 m_leftPanelMinWidthEnabled->SetValue(defLeftSettings.minimumPanelWidthEnabled);
3562 m_leftPanelMinWidth->SetValue(defLeftSettings.minimumPanelWidth);
3563 m_leftPanelMinWidth->Enable(defLeftSettings.minimumPanelWidthEnabled);
3564
3565 int defLeftPanelStartupIndex = 0;
3566 switch (defLeftSettings.panelStartupState) {
3568 defLeftPanelStartupIndex = 0;
3569 break;
3571 defLeftPanelStartupIndex = 1;
3572 break;
3574 defLeftPanelStartupIndex = 2;
3575 break;
3576 }
3577 m_leftPanelStartup->SetSelection(defLeftPanelStartupIndex);
3578
3579 m_leftPanelShowTabCloseButtons->SetValue(defLeftSettings.showTabCloseButtons);
3580 m_leftPanelRememberLastTab->SetValue(defLeftSettings.rememberLastTab);
3581 m_leftPanelAllowCollapse->SetValue(defLeftSettings.allowPanelCollapse);
3582
3583 // Right Panel Settings (defaults)
3584 const auto &defRightSettings = defaultPrefs.GetRightPanelSettings();
3585 m_rightPanelWidthEnabled->SetValue(defRightSettings.defaultPanelWidthEnabled);
3586 m_rightPanelWidth->SetValue(defRightSettings.defaultPanelWidth);
3587 m_rightPanelWidth->Enable(defRightSettings.defaultPanelWidthEnabled);
3588 m_rightPanelMinWidthEnabled->SetValue(defRightSettings.minimumPanelWidthEnabled);
3589 m_rightPanelMinWidth->SetValue(defRightSettings.minimumPanelWidth);
3590 m_rightPanelMinWidth->Enable(defRightSettings.minimumPanelWidthEnabled);
3591
3592 int defRightPanelStartupIndex = 0;
3593 switch (defRightSettings.panelStartupState) {
3595 defRightPanelStartupIndex = 0;
3596 break;
3598 defRightPanelStartupIndex = 1;
3599 break;
3601 defRightPanelStartupIndex = 2;
3602 break;
3603 }
3604 m_rightPanelStartup->SetSelection(defRightPanelStartupIndex);
3605
3606 m_rightPanelShowTabCloseButtons->SetValue(defRightSettings.showTabCloseButtons);
3607 m_rightPanelRememberLastTab->SetValue(defRightSettings.rememberLastTab);
3608 m_rightPanelAllowCollapse->SetValue(defRightSettings.allowPanelCollapse);
3609
3610 // Side panel - Scene Hierarchy Tab settings (from left panel)
3611 const auto &defSceneHierarchy = defLeftSettings.sceneHierarchy;
3612 // Display settings
3613 m_hierarchyShowSearchBar->SetValue(defSceneHierarchy.showSearchBar);
3614 m_hierarchyShowNodeIcons->SetValue(defSceneHierarchy.showNodeIcons);
3615 m_hierarchyShowTreeLines->SetValue(defSceneHierarchy.showTreeLines);
3616 m_hierarchyTreeIndentationSize->SetValue(defSceneHierarchy.treeIndentationSize);
3617 // Convert icon size pixels to choice index: 16->0 (Small), 20->1 (Medium), 24->2 (Large)
3618 int defHierarchyIconSizeIdx = 0;
3619 if (defSceneHierarchy.iconSize == 20)
3620 defHierarchyIconSizeIdx = 1;
3621 else if (defSceneHierarchy.iconSize == 24)
3622 defHierarchyIconSizeIdx = 2;
3623 m_hierarchyIconSize->SetSelection(defHierarchyIconSizeIdx);
3624 m_hierarchyFontSize->SetValue(defSceneHierarchy.fontSize);
3625 // NOTE: Color settings removed - GTK controls selection colors
3626 // Behavior
3627 m_hierarchyAutoExpandOnLoad->SetValue(defSceneHierarchy.autoExpandOnLoad);
3628 m_hierarchySyncWithCanvas->SetValue(defSceneHierarchy.syncSelectionWithCanvas);
3629 m_hierarchyLiveSearch->SetValue(defSceneHierarchy.liveSearch);
3630 m_hierarchyDoubleClickAction->SetSelection(static_cast<int>(defSceneHierarchy.doubleClickAction));
3631 m_hierarchyCtrlClickAction->SetSelection(static_cast<int>(defSceneHierarchy.ctrlClickAction));
3632 // Context menu
3633 m_hierarchyShowAddChild->SetValue(defSceneHierarchy.showAddChildOption);
3634 m_hierarchyShowDelete->SetValue(defSceneHierarchy.showDeleteOption);
3635 m_hierarchyShowRename->SetValue(defSceneHierarchy.showRenameOption);
3636 m_hierarchyShowDuplicate->SetValue(defSceneHierarchy.showDuplicateOption);
3637 // Performance
3638 m_hierarchyRememberExpandedNodes->SetValue(defSceneHierarchy.rememberExpandedNodes);
3639
3640 auto &parserSettings = defaultPrefs.GetParserSettings();
3641 m_autoLoadLastFile->SetValue(parserSettings.autoLoadLastFile);
3642 m_showParseWarnings->SetValue(parserSettings.showParseWarnings);
3643 m_fileEncoding->SetSelection(0); // UTF-8
3644
3645 auto &perfSettings = defaultPrefs.GetPerformanceSettings();
3646 m_enableVSync->SetValue(perfSettings.enableVSync);
3647 m_hardwareAcceleration->SetValue(perfSettings.hardwareAcceleration);
3648 m_enableDoubleBuffering->SetValue(perfSettings.enableDoubleBuffering);
3649 m_enableAntiAliasing->SetValue(perfSettings.enableAntiAliasing);
3650 m_enableTextAntiAliasing->SetValue(perfSettings.enableTextAntiAliasing);
3651 m_enablePartialRedraws->SetValue(perfSettings.enablePartialRedraws);
3652 m_enableBackgroundErase->SetValue(perfSettings.enableBackgroundErase);
3653 m_enableViewportCulling->SetValue(perfSettings.enableViewportCulling);
3654 m_viewportCullingMargin->SetValue(perfSettings.viewportCullingMargin);
3655 m_fpsLimit->SetSelection(static_cast<int>(perfSettings.fpsLimit));
3656 m_enableIdleProcessing->SetValue(perfSettings.enableIdleProcessing);
3657
3658 LOG_INFO("Preferences", "Settings restored to defaults (not saved yet)");
3659}
3660
3662 wxTreeItemId itemId = event.GetItem();
3663 if (!itemId.IsOk())
3664 return;
3665
3666 SectionTreeItemData *data = dynamic_cast<SectionTreeItemData *>(m_sectionTree->GetItemData(itemId));
3667 if (data && data->GetPanel()) {
3668 ShowPanel(data->GetPanel());
3669 }
3670}
3671
3672void PreferencesDialog::OnZoomSliderChanged(wxCommandEvent &event) {
3673 // Update labels depending on which slider triggered the event
3674 if (event.GetId() == ID_DEFAULT_ZOOM) {
3675 int zoomPercent = m_defaultZoomSlider->GetValue();
3676 m_zoomLabel->SetLabel(wxString::Format("%d%%", zoomPercent));
3677 } else if (event.GetId() == ID_ZOOM_STEP_SIZE) {
3678 int zoomStepPercent = m_zoomStepSize->GetValue();
3679 m_zoomStepSizeLabel->SetLabel(wxString::Format("%d%%", zoomStepPercent));
3680 } else if (event.GetId() == ID_SELECTED_NODE_BG_TINT) {
3681 int tintPercent = m_selectedNodeBgTint->GetValue();
3682 m_selectedNodeBgTintLabel->SetLabel(wxString::Format("%d%%", tintPercent));
3683 } else if (event.GetId() == ID_HOVERED_NODE_BG_TINT) {
3684 int tintPercent = m_hoveredNodeBgTint->GetValue();
3685 m_hoveredNodeBgTintLabel->SetLabel(wxString::Format("%d%%", tintPercent));
3686 }
3687}
3688
3690 // Update mouse wheel sensitivity label
3691 int value = m_mouseWheelSensitivity->GetValue();
3692 float sensitivity = value / 100.0f;
3693 m_mouseWheelSensitivityLabel->SetLabel(wxString::Format("%.1fx", sensitivity));
3694}
3695
3697 // Update pan sensitivity label
3698 int value = m_panSensitivity->GetValue();
3699 float sensitivity = value / 100.0f;
3700 m_panSensitivityLabel->SetLabel(wxString::Format("%.1fx", sensitivity));
3701}
3702
3704 // Update pan smoothness label
3705 int value = m_panSmoothness->GetValue();
3706 m_panSmoothnessLabel->SetLabel(wxString::Format("%d%%", value));
3707}
3708
3709void PreferencesDialog::OnPanStepSizeChanged(wxCommandEvent &event) {
3710 // Update pan step size label
3711 int value = m_panStepSize->GetValue();
3712 m_panStepSizeLabel->SetLabel(wxString::Format("%dpx", value));
3713}
3714
3715void PreferencesDialog::OnSliderMouseWheel(wxMouseEvent &event) {
3716 // Only allow mouse wheel events if the slider has focus (was clicked on)
3717 // This prevents sliders from intercepting scroll events meant for the page
3718 wxWindow *eventWindow = dynamic_cast<wxWindow *>(event.GetEventObject());
3719 if (eventWindow && eventWindow->HasFocus()) {
3720 // Allow the slider to handle the mouse wheel event
3721 event.Skip();
3722 }
3723 // If slider doesn't have focus, don't skip - this blocks the event
3724 // and allows it to propagate to the parent scroll window
3725}
3726
3727void PreferencesDialog::OnDialogMouseDown(wxMouseEvent &event) {
3728 // Only process if we're in capture mode (for hotkey capture)
3729 if (!m_capturingTextCtrl) {
3730 event.Skip();
3731 return;
3732 }
3733
3734 // Only capture if the text shows we're in capture mode
3735 wxString currentValue = m_capturingTextCtrl->GetValue();
3736 if (currentValue != "Press a key...") {
3737 // Capture mode ended
3738 if (HasCapture()) {
3739 ReleaseMouse();
3740 }
3741 m_capturingTextCtrl = nullptr;
3742 // Remove focus to stop capturing
3743 if (m_okButton) {
3744 m_okButton->SetFocus();
3745 }
3746 event.Skip();
3747 return;
3748 }
3749
3750 // Determine which mouse button was pressed
3751 wxString buttonName;
3752 wxString warningMessage;
3753
3754 if (event.LeftDown()) {
3755 buttonName = "Left Mouse Button";
3756 // Check if this is the pan key control
3758 warningMessage = "Warning: Left Mouse Button is the default for node selection.\n\n"
3759 "Setting it as the pan button will disable click-to-select functionality.\n\n"
3760 "Are you sure you want to use Left Mouse Button for panning?";
3761 }
3762 } else if (event.MiddleDown()) {
3763 buttonName = "Middle Mouse Button";
3764 } else if (event.RightDown()) {
3765 buttonName = "Right Mouse Button";
3766 // Check if this is the pan key control
3768 warningMessage = "Warning: Right Mouse Button is reserved for context menus.\n\n"
3769 "Setting it as the pan button may interfere with future context menu functionality.\n\n"
3770 "Are you sure you want to use Right Mouse Button for panning?";
3771 }
3772 }
3773
3774 if (!buttonName.IsEmpty()) {
3775 // Release mouse capture before showing message box
3776 // (modal dialogs don't work well with active mouse capture)
3777 if (HasCapture()) {
3778 ReleaseMouse();
3779 }
3780
3781 // Show warning if applicable
3782 if (!warningMessage.IsEmpty()) {
3783 int response = wxMessageBox(warningMessage, "Panning Button Warning", wxYES_NO | wxICON_WARNING, this);
3784 if (response != wxYES) {
3785 // User declined, reset capture state and clear the field
3786 m_capturingTextCtrl->SetValue("");
3787 m_capturingTextCtrl = nullptr;
3788 // Remove focus to stop capturing
3789 if (m_okButton) {
3790 m_okButton->SetFocus();
3791 }
3792 return;
3793 }
3794 }
3795
3796 // Set the value and clear capture state
3797 m_capturingTextCtrl->SetValue(buttonName);
3798 m_capturingTextCtrl = nullptr;
3799
3800 // Remove focus to stop capturing
3801 if (m_okButton) {
3802 m_okButton->SetFocus();
3803 }
3804 }
3805
3806 // Don't skip the event to prevent it from propagating further
3807}
3808
3810 // Enable/disable max window size controls based on checkbox
3811 bool unlimited = m_maxWindowUnlimited->GetValue();
3812 m_maxWindowWidth->Enable(!unlimited);
3813 m_maxWindowHeight->Enable(!unlimited);
3814}
3815
3817 // Enable/disable max scenes control based on checkbox
3818 bool unlimited = m_maxScenesUnlimited->GetValue();
3819 m_maxScenes->Enable(!unlimited);
3820}
3821
3823 // Enable/disable default panel height control based on checkbox
3824 bool enabled = m_bottomPanelHeightEnabled->GetValue();
3825 m_bottomPanelHeight->Enable(enabled);
3826}
3827
3829 // Enable/disable minimum panel height control based on checkbox
3830 bool enabled = m_bottomPanelMinHeightEnabled->GetValue();
3831 m_bottomPanelMinHeight->Enable(enabled);
3832}
3833
3835 // Enable/disable default panel width control based on checkbox
3836 bool enabled = m_leftPanelWidthEnabled->GetValue();
3837 m_leftPanelWidth->Enable(enabled);
3838}
3839
3841 // Enable/disable minimum panel width control based on checkbox
3842 bool enabled = m_leftPanelMinWidthEnabled->GetValue();
3843 m_leftPanelMinWidth->Enable(enabled);
3844}
3845
3847 // Enable/disable default panel width control based on checkbox
3848 bool enabled = m_rightPanelWidthEnabled->GetValue();
3849 m_rightPanelWidth->Enable(enabled);
3850}
3851
3853 // Enable/disable minimum panel width control based on checkbox
3854 bool enabled = m_rightPanelMinWidthEnabled->GetValue();
3855 m_rightPanelMinWidth->Enable(enabled);
3856}
3857
3859 wxButton *button = dynamic_cast<wxButton *>(event.GetEventObject());
3860 if (!button)
3861 return;
3862
3863 // Determine which hotkey is being captured
3864 wxTextCtrl *textCtrl = nullptr;
3865 // File menu hotkeys
3866 if (button == m_newProjectHotkeyCaptureButton) {
3867 textCtrl = m_newProjectHotkeyTextCtrl;
3868 } else if (button == m_openProjectHotkeyCaptureButton) {
3869 textCtrl = m_openProjectHotkeyTextCtrl;
3870 } else if (button == m_openFileHotkeyCaptureButton) {
3871 textCtrl = m_openFileHotkeyTextCtrl;
3872 } else if (button == m_saveHotkeyCaptureButton) {
3873 textCtrl = m_saveHotkeyTextCtrl;
3874 } else if (button == m_saveAsHotkeyCaptureButton) {
3875 textCtrl = m_saveAsHotkeyTextCtrl;
3876 // View menu hotkeys
3877 } else if (button == m_maximizeHotkeyCaptureButton) {
3878 textCtrl = m_maximizeHotkeyTextCtrl;
3879 } else if (button == m_resetUIHotkeyCaptureButton) {
3880 textCtrl = m_resetUIHotkeyTextCtrl;
3881 // Settings menu hotkeys
3882 } else if (button == m_preferencesHotkeyCaptureButton) {
3883 textCtrl = m_preferencesHotkeyTextCtrl;
3884 } else if (button == m_parserConfigHotkeyCaptureButton) {
3886 // Main panel hotkeys
3887 } else if (button == m_nextSceneHotkeyCaptureButton) {
3888 textCtrl = m_nextSceneHotkeyTextCtrl;
3889 } else if (button == m_previousSceneHotkeyCaptureButton) {
3891 } else if (button == m_resetViewHotkeyCaptureButton) {
3892 textCtrl = m_resetViewHotkeyTextCtrl;
3893 } else if (button == m_panKeyCaptureButton) {
3894 textCtrl = m_panKeyTextCtrl;
3895 } else if (button == m_centerOnNodeHotkeyCaptureButton) {
3897 } else if (button == m_deleteNodeHotkeyCaptureButton) {
3898 textCtrl = m_deleteNodeHotkeyTextCtrl;
3899 } else if (button == m_panUpHotkeyCaptureButton) {
3900 textCtrl = m_panUpHotkeyTextCtrl;
3901 } else if (button == m_panDownHotkeyCaptureButton) {
3902 textCtrl = m_panDownHotkeyTextCtrl;
3903 } else if (button == m_panLeftHotkeyCaptureButton) {
3904 textCtrl = m_panLeftHotkeyTextCtrl;
3905 } else if (button == m_panRightHotkeyCaptureButton) {
3906 textCtrl = m_panRightHotkeyTextCtrl;
3907 }
3908
3909 if (textCtrl) {
3910 textCtrl->SetValue("Press a key...");
3911 textCtrl->SetFocus();
3912
3913 // Set the capturing control and capture mouse at dialog level
3914 m_capturingTextCtrl = textCtrl;
3915 if (!HasCapture()) {
3916 CaptureMouse();
3917 }
3918 }
3919}
3920
3922 wxTextCtrl *textCtrl = dynamic_cast<wxTextCtrl *>(event.GetEventObject());
3923 if (!textCtrl) {
3924 event.Skip();
3925 return;
3926 }
3927
3928 // Only process if this is the text control we're capturing for
3929 // (prevents issues if focus somehow moves to a different control)
3930 if (m_capturingTextCtrl && m_capturingTextCtrl != textCtrl) {
3931 event.Skip();
3932 return;
3933 }
3934
3935 int keyCode = event.GetKeyCode();
3936
3937 // Handle Escape key specially - cancel capture mode without changing value
3938 if (keyCode == WXK_ESCAPE && textCtrl->GetValue() == "Press a key...") {
3939 textCtrl->SetValue(""); // Clear the field
3940 if (HasCapture()) {
3941 ReleaseMouse();
3942 }
3943 m_capturingTextCtrl = nullptr;
3944 // Remove focus to stop capturing
3945 if (m_okButton) {
3946 m_okButton->SetFocus();
3947 }
3948 return;
3949 }
3950
3951 wxString hotkeyStr;
3952
3953 // Build modifier string
3954 if (event.ControlDown())
3955 hotkeyStr += "Ctrl+";
3956 if (event.AltDown())
3957 hotkeyStr += "Alt+";
3958 if (event.ShiftDown())
3959 hotkeyStr += "Shift+";
3960
3961 // Add key name
3962 if (keyCode >= WXK_F1 && keyCode <= WXK_F12) {
3963 hotkeyStr += wxString::Format("F%d", keyCode - WXK_F1 + 1);
3964 } else if (keyCode >= 'A' && keyCode <= 'Z') {
3965 hotkeyStr += wxChar(keyCode);
3966 } else if (keyCode >= '0' && keyCode <= '9') {
3967 hotkeyStr += wxChar(keyCode);
3968 } else {
3969 // Map special keys
3970 switch (keyCode) {
3971 case WXK_ESCAPE:
3972 hotkeyStr += "Esc";
3973 break;
3974 case WXK_SPACE:
3975 hotkeyStr += "Space";
3976 break;
3977 case WXK_RETURN:
3978 hotkeyStr += "Enter";
3979 break;
3980 case WXK_TAB:
3981 hotkeyStr += "Tab";
3982 break;
3983 case WXK_BACK:
3984 hotkeyStr += "Backspace";
3985 break;
3986 case WXK_DELETE:
3987 hotkeyStr += "Delete";
3988 break;
3989 case WXK_INSERT:
3990 hotkeyStr += "Insert";
3991 break;
3992 case WXK_HOME:
3993 hotkeyStr += "Home";
3994 break;
3995 case WXK_END:
3996 hotkeyStr += "End";
3997 break;
3998 case WXK_PAGEUP:
3999 hotkeyStr += "PageUp";
4000 break;
4001 case WXK_PAGEDOWN:
4002 hotkeyStr += "PageDown";
4003 break;
4004 case WXK_LEFT:
4005 hotkeyStr += "Left";
4006 break;
4007 case WXK_RIGHT:
4008 hotkeyStr += "Right";
4009 break;
4010 case WXK_UP:
4011 hotkeyStr += "Up";
4012 break;
4013 case WXK_DOWN:
4014 hotkeyStr += "Down";
4015 break;
4016 default:
4017 textCtrl->SetValue("Unsupported key");
4018 if (HasCapture()) {
4019 ReleaseMouse();
4020 }
4021 m_capturingTextCtrl = nullptr;
4022 // Remove focus to stop capturing
4023 if (m_okButton) {
4024 m_okButton->SetFocus();
4025 }
4026 return;
4027 }
4028 }
4029
4030 textCtrl->SetValue(hotkeyStr);
4031
4032 // Release the mouse capture after successfully capturing a key
4033 if (HasCapture()) {
4034 ReleaseMouse();
4035 }
4036 m_capturingTextCtrl = nullptr;
4037
4038 // Remove focus from the text control to stop capturing further keys
4039 // Transfer focus to the OK button (or any other safe control)
4040 if (m_okButton) {
4041 m_okButton->SetFocus();
4042 }
4043}
4044
4045void PreferencesDialog::OnOK(wxCommandEvent &event) {
4046 // Release mouse capture if active
4047 if (HasCapture()) {
4048 ReleaseMouse();
4049 }
4050 m_capturingTextCtrl = nullptr;
4051
4052 ApplySettings();
4053 EndModal(wxID_OK);
4054}
4055
4056void PreferencesDialog::OnCancel(wxCommandEvent &event) {
4057 // Release mouse capture if active
4058 if (HasCapture()) {
4059 ReleaseMouse();
4060 }
4061 m_capturingTextCtrl = nullptr;
4062
4063 EndModal(wxID_CANCEL);
4064}
4065
4066void PreferencesDialog::OnApply(wxCommandEvent &event) {
4067 ApplySettings();
4068
4069 // Notify parent frame to refresh UI with new settings
4070 MainFrame *mainFrame = dynamic_cast<MainFrame *>(GetParent());
4071 if (mainFrame) {
4072 mainFrame->RefreshPreferences();
4073 }
4074}
4075
4076void PreferencesDialog::OnRestoreDefaults(wxCommandEvent &event) {
4077 int result = wxMessageBox("This will restore all settings to their default values. Continue?", "Restore Defaults",
4078 wxYES_NO | wxICON_QUESTION, this);
4079 if (result == wxYES) {
4081 }
4082}
4083
4084void PreferencesDialog::OnConfigureParser(wxCommandEvent &event) {
4085 ParserConfigDialog dialog(this);
4086 dialog.ShowModal();
4087}
4088
4090 // Enable/disable custom path controls based on selection
4092 int selection = m_startPathMode->GetSelection();
4093 bool enableCustomPath = (selection == 1); // "Custom Path" is the second option
4094 m_customStartPath->Enable(enableCustomPath);
4095 m_browseStartPath->Enable(enableCustomPath);
4096 }
4097}
4098
4099void PreferencesDialog::OnBrowseStartPath(wxCommandEvent &event) {
4100 wxDirDialog dialog(this, "Choose Start Directory", m_customStartPath->GetValue(),
4101 wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
4102
4103 if (dialog.ShowModal() == wxID_OK) {
4104 m_customStartPath->SetValue(dialog.GetPath());
4105 }
4106}
BehaviorTreeProjectDialog::OnProjectNameChanged BehaviorTreeProjectDialog::OnRemoveFiles wxEND_EVENT_TABLE() BehaviorTreeProjectDialog
#define LOG_ERROR(category, message)
Definition Logger.h:116
#define LOG_INFO(category, message)
Definition Logger.h:114
MainFrame::OnExit MainFrame::OnNewProject MainFrame::OnCloseProject MainFrame::OnToggleMaximize MainFrame::OnPreviousScene MainFrame::OnPreferences MainFrame::OnEditorTool EVT_BUTTON(ID_MonitorTool, MainFrame::OnMonitorTool) EVT_PAINT(MainFrame
Definition MainFrame.cpp:63
ParserConfigDialog::OnProfileSelected ParserConfigDialog::OnCloneProfile ParserConfigDialog::OnImportProfile ParserConfigDialog::OnSetActiveProfile ParserConfigDialog::OnRemoveControlType ParserConfigDialog::OnRemoveDecoratorType ParserConfigDialog::OnRemoveActionType EVT_CHECKBOX(ID_TOGGLE_CUSTOM_VALIDATION, ParserConfigDialog::OnToggleCustomValidation) EVT_TIMER(ID_PULSE_TIMER
wxBEGIN_EVENT_TABLE(PreferencesDialog, wxDialog) EVT_BUTTON(wxID_OK
static AppPreferencesManager & GetInstance()
Application preferences configuration.
PerformanceSettings & GetPerformanceSettings()
BehaviorTreeViewSettings & GetBehaviorTreeViewSettings()
StartupMode
Startup mode enumeration.
FPSLimit
Frame rate limit options.
PanelStartupState
Panel startup state options.
LeftPanelSettings & GetLeftPanelSettings()
SortBy
File sorting criteria.
CloseConfirmationMode
Close confirmation behavior for scenes.
MainPanelSettings & GetMainPanelSettings()
RightPanelSettings & GetRightPanelSettings()
TextAnchor
Text anchor position for debug info overlay.
BottomPanelSettings & GetBottomPanelSettings()
ParserSettings & GetParserSettings()
ThemeMode
Theme mode enumeration.
StartPathMode
Default start path behavior.
WindowSettings & GetWindowSettings()
static EmberCore::String GetDefaultConfigPath()
Main application window for EmberForge.
Definition MainFrame.h:65
void RefreshPreferences()
Comprehensive dialog for managing parser configuration profiles.
Preferences dialog for configuring EmberForge application settings.
wxTextCtrl * m_customStartPath
wxSlider * m_hoveredNodeBgTint
wxCheckBox * m_treeShowHiddenFiles
wxCheckBox * m_rightPanelShowTabCloseButtons
wxButton * m_preferencesHotkeyCaptureButton
wxPanel * CreateParserSettings(wxWindow *parent)
wxCheckBox * m_allowPanelCollapse
wxCheckBox * m_zoomFollowsCursor
wxSpinCtrl * m_coordinateInfoX
wxColourPickerCtrl * m_coordinateInfoColorPicker
wxChoice * m_startupModeChoice
wxCheckBox * m_rightPanelWidthEnabled
wxCheckBox * m_showPanelCaptions
wxCheckBox * m_leftPanelRememberLastTab
void OnCancel(wxCommandEvent &event)
wxBoxSizer * m_settingsSizer
wxCheckBox * m_logAutoScrollEnabled
wxCheckBox * m_leftPanelWidthEnabled
wxColourPickerCtrl * m_hoveredNodeTextColorPicker
wxColourPickerCtrl * m_treeInfoColorPicker
void OnLeftPanelMinWidthEnabledChanged(wxCommandEvent &event)
wxTextCtrl * m_panUpHotkeyTextCtrl
wxChoice * m_rightPanelStartup
wxPanel * CreateRightPanelSettings(wxWindow *parent)
wxSpinCtrl * m_minWindowHeight
wxColourPickerCtrl * m_logErrorColor
wxButton * m_previousSceneHotkeyCaptureButton
wxSpinCtrl * m_bottomPanelMinHeight
wxChoice * m_selectedNodeInfoAnchor
wxCheckBox * m_enableAntiAliasing
wxCheckBox * m_bottomPanelMinHeightEnabled
wxPanel * CreateLogTabSettings(wxWindow *parent)
void OnPanSensitivityChanged(wxCommandEvent &event)
wxTextCtrl * m_aspectRatioHeight
void OnApply(wxCommandEvent &event)
wxStaticText * m_hoveredNodeBgTintLabel
wxColourPickerCtrl * m_canvasBackgroundPicker
wxCheckBox * m_showTreeInfo
wxCheckBox * m_logEnableGuiColors
wxButton * m_panRightHotkeyCaptureButton
void OnDialogMouseDown(wxMouseEvent &event)
wxSpinCtrl * m_rightPanelMinWidth
wxButton * m_centerOnNodeHotkeyCaptureButton
wxCheckBox * m_autoLoadLastFile
wxTextCtrl * m_preferencesHotkeyTextCtrl
wxButton * m_maximizeHotkeyCaptureButton
wxButton * m_nextSceneHotkeyCaptureButton
wxCheckBox * m_leftPanelMinWidthEnabled
wxColourPickerCtrl * m_controlsHelpColorPicker
wxSpinCtrl * m_controlsHelpFontSize
void OnBrowseStartPath(wxCommandEvent &event)
wxStaticText * m_panSmoothnessLabel
wxCheckBox * m_showControlsHelp
wxCheckBox * m_showSelectedNodeInfo
void OnPanSmoothnessChanged(wxCommandEvent &event)
wxColourPickerCtrl * m_logInfoColor
wxColourPickerCtrl * m_gridBackgroundPicker
wxTextCtrl * m_centerOnNodeHotkeyTextCtrl
void ShowPanel(wxPanel *panel)
wxCheckBox * m_showHistory
wxTextCtrl * m_previousSceneHotkeyTextCtrl
wxStaticText * m_selectedNodeBgTintLabel
wxChoice * m_controlsHelpAnchor
wxColourPickerCtrl * m_logTraceColor
wxColourPickerCtrl * m_idleNodeTextColorPicker
wxButton * m_resetViewHotkeyCaptureButton
wxColourPickerCtrl * m_hoveredNodeColorPicker
wxCheckBox * m_showCoordinateInfo
wxCheckBox * m_maxScenesUnlimited
wxSpinCtrl * m_hierarchyTreeIndentationSize
wxCheckBox * m_hardwareAcceleration
wxSpinCtrl * m_coordinateInfoFontSize
wxColourPickerCtrl * m_idleNodeBorderColorPicker
wxButton * m_newProjectHotkeyCaptureButton
wxCheckBox * m_alwaysOnTop
void OnPanStepSizeChanged(wxCommandEvent &event)
wxButton * m_panLeftHotkeyCaptureButton
void OnMaxScenesUnlimitedChanged(wxCommandEvent &event)
wxSpinCtrl * m_controlsHelpX
wxButton * m_panUpHotkeyCaptureButton
wxButton * m_configureParserButton
PreferencesDialog(wxWindow *parent)
wxCheckBox * m_rightPanelMinWidthEnabled
wxChoice * m_coordinateInfoAnchor
wxSpinCtrl * m_selectedNodeInfoY
wxSpinCtrl * m_maxWindowWidth
wxSpinCtrl * m_selectedNodeInfoX
wxButton * m_panKeyCaptureButton
wxColourPickerCtrl * m_pathHighlightColorPicker
wxTextCtrl * m_parserConfigHotkeyTextCtrl
wxTextCtrl * m_maximizeHotkeyTextCtrl
wxCheckBox * m_leftPanelShowTabCloseButtons
wxCheckBox * m_hierarchyShowDuplicate
wxCheckBox * m_hierarchyShowDelete
wxSpinCtrl * m_selectedNodeInfoFontSize
wxStaticText * m_zoomStepSizeLabel
wxCheckBox * m_hierarchySyncWithCanvas
wxCheckBox * m_enforceAspectRatio
wxStaticText * m_mouseWheelSensitivityLabel
wxCheckBox * m_hierarchyLiveSearch
wxCheckBox * m_treeShowFileExtensions
wxCheckBox * m_enableIdleProcessing
void OnMaxWindowUnlimitedChanged(wxCommandEvent &event)
wxPanel * CreateTabsSubSettings(wxWindow *parent)
void OnStartPathModeChanged(wxCommandEvent &event)
wxCheckBox * m_highlightPathToSelected
wxTextCtrl * m_panDownHotkeyTextCtrl
wxCheckBox * m_showParseWarnings
wxCheckBox * m_bottomPanelHeightEnabled
wxChoice * m_hierarchyIconSize
wxSlider * m_mouseWheelSensitivity
wxButton * m_parserConfigHotkeyCaptureButton
void OnHotkeyTextKeyDown(wxKeyEvent &event)
wxColourPickerCtrl * m_logCriticalColor
void OnHotkeyCaptureClicked(wxCommandEvent &event)
void OnSectionSelected(wxTreeEvent &event)
wxCheckBox * m_hierarchyShowTreeLines
wxColourPickerCtrl * m_hoveredNodeInfoColorPicker
wxCheckBox * m_enableTextAntiAliasing
wxCheckBox * m_enableVSync
wxStaticText * m_panStepSizeLabel
wxSpinCtrl * m_rightPanelWidth
wxButton * m_resetUIHotkeyCaptureButton
wxPanel * m_sceneHierarchyPanel
void OnOK(wxCommandEvent &event)
wxButton * m_openFileHotkeyCaptureButton
wxColourPickerCtrl * m_fpsColorPicker
wxCheckBox * m_logEnableConsoleColors
wxPanel * CreatePerformanceSettings(wxWindow *parent)
wxSlider * m_selectedNodeBgTint
wxTextCtrl * m_panLeftHotkeyTextCtrl
wxButton * m_deleteNodeHotkeyCaptureButton
wxTextCtrl * m_openProjectHotkeyTextCtrl
wxCheckBox * m_hierarchyShowNodeIcons
void OnRightPanelMinWidthEnabledChanged(wxCommandEvent &event)
wxCheckBox * m_hierarchyAutoExpandOnLoad
wxPanel * CreateBehaviorTreeViewSettings(wxWindow *parent)
wxChoice * m_hierarchyDoubleClickAction
wxTextCtrl * m_saveAsHotkeyTextCtrl
wxCheckBox * m_leftPanelAllowCollapse
wxTextCtrl * m_panKeyTextCtrl
wxCheckBox * m_enableDoubleBuffering
wxCheckBox * m_maxWindowUnlimited
bool SelectSection(const wxString &sectionName)
Select a section in the preferences tree by name.
wxColourPickerCtrl * m_selectedNodeInfoColorPicker
wxPanel * CreateMainPanelSettings(wxWindow *parent)
wxCheckBox * m_enableBackgroundErase
void OnBottomPanelHeightEnabledChanged(wxCommandEvent &event)
wxChoice * m_hierarchyCtrlClickAction
wxPanel * CreateBottomPanelSettings(wxWindow *parent)
wxStaticText * m_panSensitivityLabel
wxSpinCtrl * m_leftPanelMinWidth
wxPanel * CreateSidePanelSettings(wxWindow *parent)
wxCheckBox * m_gridShowFileExtensions
wxPanel * m_behaviorTreeViewPanel
wxColourPickerCtrl * m_accentColorPicker
wxTextCtrl * m_capturingTextCtrl
wxChoice * m_closeConfirmation
wxTextCtrl * m_resetViewHotkeyTextCtrl
wxColourPickerCtrl * m_selectedNodeDebugInfoColorPicker
wxColourPickerCtrl * m_selectedNodeTextColorPicker
wxScrolledWindow * m_settingsPanel
wxButton * m_openProjectHotkeyCaptureButton
wxSpinCtrl * m_coordinateInfoY
void OnLeftPanelWidthEnabledChanged(wxCommandEvent &event)
wxCheckBox * m_showTabCloseButtons
wxTextCtrl * m_resetUIHotkeyTextCtrl
wxCheckBox * m_hierarchyShowSearchBar
wxButton * m_panDownHotkeyCaptureButton
wxColourPickerCtrl * m_selectedNodeColorPicker
wxButton * m_restoreDefaultsButton
wxButton * m_saveAsHotkeyCaptureButton
wxTextCtrl * m_nextSceneHotkeyTextCtrl
wxCheckBox * m_gridShowHiddenFiles
wxSpinCtrl * m_minWindowWidth
wxTextCtrl * m_panRightHotkeyTextCtrl
wxChoice * m_bottomPanelStartup
wxSpinCtrl * m_fpsFontSize
wxTextCtrl * m_saveHotkeyTextCtrl
void OnZoomSliderChanged(wxCommandEvent &event)
void OnBottomPanelMinHeightEnabledChanged(wxCommandEvent &event)
wxSpinCtrl * m_maxWindowHeight
wxSplitterWindow * m_splitter
wxSpinCtrl * m_viewportCullingMargin
wxSpinCtrl * m_controlsHelpY
wxSpinCtrl * m_leftPanelWidth
wxTextCtrl * m_newProjectHotkeyTextCtrl
wxSlider * m_defaultZoomSlider
wxColourPickerCtrl * m_idleNodeBgColorPicker
wxColourPickerCtrl * m_logWarningColor
wxButton * m_saveHotkeyCaptureButton
wxCheckBox * m_showStatusBar
wxTextCtrl * m_aspectRatioWidth
wxPanel * CreateFileExplorerTabSettings(wxWindow *parent)
wxChoice * m_leftPanelStartup
wxTreeCtrl * m_sectionTree
wxTextCtrl * m_openFileHotkeyTextCtrl
wxSpinCtrl * m_hierarchyFontSize
wxCheckBox * m_hierarchyShowRename
void OnConfigureParser(wxCommandEvent &event)
wxCheckBox * m_enableSmoothPanning
wxPanel * CreateSceneHierarchyTabSettings(wxWindow *parent)
wxCheckBox * m_rightPanelAllowCollapse
wxColourPickerCtrl * m_gridLineColorPicker
wxCheckBox * m_hierarchyShowAddChild
wxTextCtrl * m_deleteNodeHotkeyTextCtrl
wxCheckBox * m_rightPanelRememberLastTab
wxStaticText * m_zoomLabel
wxSpinCtrl * m_treeInfoFontSize
wxCheckBox * m_showBreadcrumb
void OnRightPanelWidthEnabledChanged(wxCommandEvent &event)
void OnMouseWheelSensitivityChanged(wxCommandEvent &event)
wxCheckBox * m_rememberLastTab
wxCheckBox * m_hierarchyRememberExpandedNodes
void OnRestoreDefaults(wxCommandEvent &event)
wxCheckBox * m_enableViewportCulling
wxSpinCtrl * m_bottomPanelHeight
wxCheckBox * m_enablePartialRedraws
wxPanel * CreateLeftPanelSettings(wxWindow *parent)
wxSpinCtrl * m_logMaxEntries
wxColourPickerCtrl * m_connectionLineColorPicker
void OnSliderMouseWheel(wxMouseEvent &event)
wxPanel * CreateWindowSettings(wxWindow *parent)
wxChoice * m_logDefaultLevelFilter
std::string String
Framework-agnostic string type.
Definition String.h:14
RGBA color with 8-bit components.
Definition Color.h:10