10 Panel::
Panel(wxWindow *parent, const wxString &name,
long style)
11 : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, style), main_sizer_(
nullptr), name_(name),
12 title_(name), panel_type_(
"Panel"), is_initialized_(false), is_active_(false), has_unsaved_changes_(false) {
13 background_color_ = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
14 foreground_color_ = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
15 panel_font_ = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
24 wxPanel::SetName(name);
80 state +=
"name=" +
name_ +
";";
81 state +=
"title=" +
title_ +
";";
83 state +=
"visible=" + wxString(IsShown() ?
"true" :
"false") +
";";
97 return operation ==
"refresh" || operation ==
"reset" || operation ==
"serialize";
101 if (operation ==
"refresh") {
104 }
else if (operation ==
"reset") {
108 }
else if (operation ==
"serialize") {
BehaviorTreeProjectDialog::OnProjectNameChanged BehaviorTreeProjectDialog::OnRemoveFiles wxEND_EVENT_TABLE() BehaviorTreeProjectDialog
Base class for all panels with layout, theme, and state management.
virtual void OnPanelPaint(wxPaintEvent &event)
Hook: handles panel paint events.
virtual void CreateLayout()
Hook: creates the panel layout. Override to customize.
void Cleanup() override
Cleans up panel resources.
virtual void HandleActivation()
Hook: handles panel activation. Override to customize.
void DeserializeState(const wxString &state) override
Restores panel state from a serialized string.
void SetName(const wxString &name) override
Sets the panel name.
void OnActivated() override
Called when the panel is activated.
void OnDeactivated() override
Called when the panel is deactivated.
wxColour foreground_color_
virtual void ApplyTheme()
Hook: applies theme colors and fonts. Override to customize.
virtual void OnPanelSize(wxSizeEvent &event)
Hook: handles panel resize events.
bool SupportsOperation(const wxString &operation) const override
Returns true if the panel supports the given operation.
bool ExecuteOperation(const wxString &operation, const wxString ¶meter="") override
Executes a named operation with optional parameter.
void SetupEventHandlers()
void Initialize() override
Initializes the panel layout and appearance.
void SetMainSizer(wxSizer *sizer)
Sets the main sizer.
wxColour background_color_
virtual void UpdateContent()
Hook: updates displayed content. Override to refresh data.
wxString SerializeState() const override
Serializes panel state to a string.
virtual void HandleDeactivation()
Hook: handles panel deactivation. Override to customize.
void Refresh() override
Refreshes panel content.
bool Save() override
Saves panel state; returns true on success.
virtual bool ValidateState() const
Hook: validates panel state; returns true if valid.
bool has_unsaved_changes_
Standard layout constants for consistent UI spacing and sizing.
wxBEGIN_EVENT_TABLE(Panel, wxPanel) EVT_SIZE(Panel