11 Panel::
Panel(wxWindow *parent, const wxString &name,
long style)
12 : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, style), main_sizer_(
nullptr), name_(name),
13 title_(name), panel_type_(
"Panel"), is_initialized_(false), is_active_(false), has_unsaved_changes_(false) {
15 background_color_ = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
16 foreground_color_ = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
17 panel_font_ = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
30 wxPanel::SetName(name);
93 state +=
"name=" +
name_ +
";";
94 state +=
"title=" +
title_ +
";";
96 state +=
"visible=" + wxString(IsShown() ?
"true" :
"false") +
";";
117 return operation ==
"refresh" || operation ==
"reset" || operation ==
"serialize";
121 if (operation ==
"refresh") {
124 }
else if (operation ==
"reset") {
128 }
else if (operation ==
"serialize") {
BehaviorTreeProjectDialog::OnProjectNameChanged BehaviorTreeProjectDialog::OnRemoveFiles wxEND_EVENT_TABLE() BehaviorTreeProjectDialog
wxBEGIN_EVENT_TABLE(Panel, wxPanel) EVT_SIZE(Panel
static Logger & GetInstance()
void Info(const EmberCore::String &category, const EmberCore::String &message)
Base implementation of IPanel interface.
void OnActivated() override
Called when the panel becomes visible/active.
bool SupportsOperation(const wxString &operation) const override
Check if this panel supports the given operation.
virtual void HandleActivation()
Handle panel activation Called when panel becomes active.
virtual void HandleDeactivation()
Handle panel deactivation Called when panel becomes inactive.
void Initialize() override
Initialize the panel after construction Called once after the panel is created and configured.
virtual void OnPanelSize(wxSizeEvent &event)
void Refresh() override
Called when the panel should refresh its display This should update the panel's content to reflect cu...
bool Save() override
Save the panel's data (if applicable)
virtual void ApplyTheme()
Apply current theme to the panel Called when theme changes.
void SetupEventHandlers()
wxColour background_color_
wxColour foreground_color_
virtual void OnPanelRightClick(wxContextMenuEvent &event)
void DeserializeState(const wxString &state) override
Restore the panel's state from serialized data.
virtual ~Panel()
Destructor.
virtual bool ValidateState() const
Validate panel state Override to provide custom validation logic.
void Cleanup() override
Called when the panel is about to be destroyed Use this for cleanup operations.
virtual void UpdateContent()
Update panel content Called during refresh.
wxString SerializeState() const override
Serialize the panel's current state to a string.
void SetMainSizer(wxSizer *sizer)
Set the main sizer (takes ownership)
void OnDeactivated() override
Called when the panel becomes hidden/inactive.
bool has_unsaved_changes_
void SetName(const wxString &name) override
virtual void OnPanelPaint(wxPaintEvent &event)
bool ExecuteOperation(const wxString &operation, const wxString ¶meter="") override
Execute a named operation on this panel.
virtual void CreateLayout()
Create the panel's UI layout Called during initialization.
Main types header for EmberCore.