Ember
Loading...
Searching...
No Matches
EmberUI::Panel Class Reference

Base class for all panels with layout, theme, and state management. More...

#include <Panel.h>

Inheritance diagram for EmberUI::Panel:
IPanel Ember::Monitor::ConnectionPanel Ember::Monitor::MainPanel EmberUI::SidePanel MainPanel Ember::Monitor::RightSidePanel SidePanel BottomPanel LeftSidePanel RightSidePanel

Public Member Functions

 Panel (wxWindow *parent, const wxString &name="Panel", long style=wxTAB_TRAVERSAL)
 Constructs the panel with optional name and style.
virtual ~Panel ()
wxPanel * GetPanel () override
 Returns this panel as wxPanel pointer.
wxString GetTitle () const override
 Returns the panel title.
wxString GetPanelType () const override
 Returns the panel type identifier.
void Initialize () override
 Initializes the panel layout and appearance.
void Refresh () override
 Refreshes panel content.
void OnActivated () override
 Called when the panel is activated.
void OnDeactivated () override
 Called when the panel is deactivated.
void Cleanup () override
 Cleans up panel resources.
bool IsValid () const override
 Returns true if the panel has been initialized.
wxString SerializeState () const override
 Serializes panel state to a string.
void DeserializeState (const wxString &state) override
 Restores panel state from a serialized string.
bool HasUnsavedChanges () const override
 Returns true if there are unsaved changes.
bool Save () override
 Saves panel state; returns true on success.
bool SupportsOperation (const wxString &operation) const override
 Returns true if the panel supports the given operation.
bool ExecuteOperation (const wxString &operation, const wxString &parameter="") override
 Executes a named operation with optional parameter.
wxString GetName () const override
 Returns the panel name.
void SetName (const wxString &name) override
 Sets the panel name.
void SetTitle (const wxString &title)
 Sets the panel title.
void SetPanelType (const wxString &type)
 Sets the panel type identifier.
Public Member Functions inherited from IPanel
virtual ~IPanel ()=default

Protected Member Functions

virtual void CreateLayout ()
 Hook: creates the panel layout. Override to customize.
virtual void ApplyTheme ()
 Hook: applies theme colors and fonts. Override to customize.
virtual void UpdateContent ()
 Hook: updates displayed content. Override to refresh data.
virtual void HandleActivation ()
 Hook: handles panel activation. Override to customize.
virtual void HandleDeactivation ()
 Hook: handles panel deactivation. Override to customize.
virtual bool ValidateState () const
 Hook: validates panel state; returns true if valid.
void MarkChanged ()
 Marks the panel as having unsaved changes.
void MarkSaved ()
 Clears the unsaved-changes flag.
wxSizer * GetMainSizer () const
 Returns the main sizer for layout.
void SetMainSizer (wxSizer *sizer)
 Sets the main sizer.
virtual void OnPanelSize (wxSizeEvent &event)
 Hook: handles panel resize events.
virtual void OnPanelPaint (wxPaintEvent &event)
 Hook: handles panel paint events.

Private Member Functions

void InitializePanel ()
void SetupEventHandlers ()
void UpdateAppearance ()
void DoCleanup ()
void DoApplyTheme ()
 Panel (const Panel &)=delete
Paneloperator= (const Panel &)=delete

Private Attributes

wxSizer * main_sizer_
wxString name_
wxString title_
wxString panel_type_
bool is_initialized_
bool is_active_
bool has_unsaved_changes_
wxColour background_color_
wxColour foreground_color_
wxFont panel_font_

Detailed Description

Base class for all panels with layout, theme, and state management.

Definition at line 11 of file Panel.h.

Constructor & Destructor Documentation

◆ Panel() [1/2]

EmberUI::Panel::Panel ( wxWindow * parent,
const wxString & name = "Panel",
long style = wxTAB_TRAVERSAL )
explicit

Constructs the panel with optional name and style.

◆ ~Panel()

EmberUI::Panel::~Panel ( )
virtual

Definition at line 20 of file Panel.cpp.

◆ Panel() [2/2]

EmberUI::Panel::Panel ( const Panel & )
privatedelete

Member Function Documentation

◆ ApplyTheme()

void EmberUI::Panel::ApplyTheme ( )
protectedvirtual

Hook: applies theme colors and fonts. Override to customize.

Definition at line 122 of file Panel.cpp.

◆ Cleanup()

void EmberUI::Panel::Cleanup ( )
overridevirtual

Cleans up panel resources.

Reimplemented from IPanel.

Definition at line 63 of file Panel.cpp.

◆ CreateLayout()

void EmberUI::Panel::CreateLayout ( )
protectedvirtual

Hook: creates the panel layout. Override to customize.

Reimplemented in Ember::Monitor::MainPanel, EmberUI::SidePanel, MainPanel, and SidePanel.

Definition at line 115 of file Panel.cpp.

◆ DeserializeState()

void EmberUI::Panel::DeserializeState ( const wxString & state)
overridevirtual

Restores panel state from a serialized string.

Reimplemented from IPanel.

Definition at line 87 of file Panel.cpp.

◆ DoApplyTheme()

void EmberUI::Panel::DoApplyTheme ( )
private

Definition at line 124 of file Panel.cpp.

◆ DoCleanup()

void EmberUI::Panel::DoCleanup ( )
private

Definition at line 65 of file Panel.cpp.

◆ ExecuteOperation()

bool EmberUI::Panel::ExecuteOperation ( const wxString & operation,
const wxString & parameter = "" )
overridevirtual

Executes a named operation with optional parameter.

Reimplemented from IPanel.

Definition at line 100 of file Panel.cpp.

◆ GetMainSizer()

wxSizer * EmberUI::Panel::GetMainSizer ( ) const
inlineprotected

Returns the main sizer for layout.

Definition at line 83 of file Panel.h.

◆ GetName()

wxString EmberUI::Panel::GetName ( ) const
inlineoverride

Returns the panel name.

Definition at line 54 of file Panel.h.

◆ GetPanel()

wxPanel * EmberUI::Panel::GetPanel ( )
inlineoverridevirtual

Returns this panel as wxPanel pointer.

Implements IPanel.

Definition at line 18 of file Panel.h.

◆ GetPanelType()

wxString EmberUI::Panel::GetPanelType ( ) const
inlineoverridevirtual

Returns the panel type identifier.

Implements IPanel.

Reimplemented in Ember::Monitor::RightSidePanel, RightSidePanel, and SidePanel.

Definition at line 22 of file Panel.h.

◆ GetTitle()

wxString EmberUI::Panel::GetTitle ( ) const
inlineoverridevirtual

Returns the panel title.

Implements IPanel.

Reimplemented in Ember::Monitor::RightSidePanel, RightSidePanel, and SidePanel.

Definition at line 20 of file Panel.h.

◆ HandleActivation()

void EmberUI::Panel::HandleActivation ( )
protectedvirtual

Hook: handles panel activation. Override to customize.

Definition at line 132 of file Panel.cpp.

◆ HandleDeactivation()

void EmberUI::Panel::HandleDeactivation ( )
protectedvirtual

Hook: handles panel deactivation. Override to customize.

Definition at line 134 of file Panel.cpp.

◆ HasUnsavedChanges()

bool EmberUI::Panel::HasUnsavedChanges ( ) const
inlineoverridevirtual

Returns true if there are unsaved changes.

Reimplemented from IPanel.

Definition at line 44 of file Panel.h.

◆ Initialize()

void EmberUI::Panel::Initialize ( )
overridevirtual

Initializes the panel layout and appearance.

Reimplemented from IPanel.

Definition at line 27 of file Panel.cpp.

◆ InitializePanel()

void EmberUI::Panel::InitializePanel ( )
private

Definition at line 155 of file Panel.cpp.

◆ IsValid()

bool EmberUI::Panel::IsValid ( ) const
inlineoverridevirtual

Returns true if the panel has been initialized.

Reimplemented from IPanel.

Definition at line 36 of file Panel.h.

◆ MarkChanged()

void EmberUI::Panel::MarkChanged ( )
inlineprotected

Marks the panel as having unsaved changes.

Definition at line 78 of file Panel.h.

◆ MarkSaved()

void EmberUI::Panel::MarkSaved ( )
inlineprotected

Clears the unsaved-changes flag.

Definition at line 80 of file Panel.h.

◆ OnActivated()

void EmberUI::Panel::OnActivated ( )
overridevirtual

Called when the panel is activated.

Reimplemented from IPanel.

Definition at line 47 of file Panel.cpp.

◆ OnDeactivated()

void EmberUI::Panel::OnDeactivated ( )
overridevirtual

Called when the panel is deactivated.

Reimplemented from IPanel.

Definition at line 55 of file Panel.cpp.

◆ OnPanelPaint()

void EmberUI::Panel::OnPanelPaint ( wxPaintEvent & event)
protectedvirtual

Hook: handles panel paint events.

Definition at line 150 of file Panel.cpp.

◆ OnPanelSize()

void EmberUI::Panel::OnPanelSize ( wxSizeEvent & event)
protectedvirtual

Hook: handles panel resize events.

Definition at line 143 of file Panel.cpp.

◆ operator=()

Panel & EmberUI::Panel::operator= ( const Panel & )
privatedelete

◆ Refresh()

void EmberUI::Panel::Refresh ( )
overridevirtual

Refreshes panel content.

Reimplemented from IPanel.

Definition at line 38 of file Panel.cpp.

◆ Save()

bool EmberUI::Panel::Save ( )
overridevirtual

Saves panel state; returns true on success.

Reimplemented from IPanel.

Definition at line 89 of file Panel.cpp.

◆ SerializeState()

wxString EmberUI::Panel::SerializeState ( ) const
overridevirtual

Serializes panel state to a string.

Reimplemented from IPanel.

Definition at line 78 of file Panel.cpp.

◆ SetMainSizer()

void EmberUI::Panel::SetMainSizer ( wxSizer * sizer)
protected

Sets the main sizer.

Definition at line 138 of file Panel.cpp.

◆ SetName()

void EmberUI::Panel::SetName ( const wxString & name)
override

Sets the panel name.

Definition at line 22 of file Panel.cpp.

◆ SetPanelType()

void EmberUI::Panel::SetPanelType ( const wxString & type)
inline

Sets the panel type identifier.

Definition at line 61 of file Panel.h.

◆ SetTitle()

void EmberUI::Panel::SetTitle ( const wxString & title)
inline

Sets the panel title.

Definition at line 59 of file Panel.h.

◆ SetupEventHandlers()

void EmberUI::Panel::SetupEventHandlers ( )
private

Definition at line 160 of file Panel.cpp.

◆ SupportsOperation()

bool EmberUI::Panel::SupportsOperation ( const wxString & operation) const
overridevirtual

Returns true if the panel supports the given operation.

Reimplemented from IPanel.

Definition at line 96 of file Panel.cpp.

◆ UpdateAppearance()

void EmberUI::Panel::UpdateAppearance ( )
private

Definition at line 162 of file Panel.cpp.

◆ UpdateContent()

void EmberUI::Panel::UpdateContent ( )
protectedvirtual

Hook: updates displayed content. Override to refresh data.

Definition at line 130 of file Panel.cpp.

◆ ValidateState()

bool EmberUI::Panel::ValidateState ( ) const
protectedvirtual

Hook: validates panel state; returns true if valid.

Definition at line 136 of file Panel.cpp.

Member Data Documentation

◆ background_color_

wxColour EmberUI::Panel::background_color_
private

Definition at line 101 of file Panel.h.

◆ foreground_color_

wxColour EmberUI::Panel::foreground_color_
private

Definition at line 102 of file Panel.h.

◆ has_unsaved_changes_

bool EmberUI::Panel::has_unsaved_changes_
private

Definition at line 99 of file Panel.h.

◆ is_active_

bool EmberUI::Panel::is_active_
private

Definition at line 98 of file Panel.h.

◆ is_initialized_

bool EmberUI::Panel::is_initialized_
private

Definition at line 97 of file Panel.h.

◆ main_sizer_

wxSizer* EmberUI::Panel::main_sizer_
private

Definition at line 93 of file Panel.h.

◆ name_

wxString EmberUI::Panel::name_
private

Definition at line 94 of file Panel.h.

◆ panel_font_

wxFont EmberUI::Panel::panel_font_
private

Definition at line 103 of file Panel.h.

◆ panel_type_

wxString EmberUI::Panel::panel_type_
private

Definition at line 96 of file Panel.h.

◆ title_

wxString EmberUI::Panel::title_
private

Definition at line 95 of file Panel.h.


The documentation for this class was generated from the following files: