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

Tabbed side panel using wxAuiNotebook. More...

#include <SidePanel.h>

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

Public Member Functions

 SidePanel (wxWindow *parent, const wxString &panelName="Side Panel", bool autoLayout=true)
 Constructs the side panel with optional name and auto-layout flag.
virtual ~SidePanel ()
virtual int AddTab (ITabPtr tab)
 Adds a tab and returns its index.
virtual ITabPtr RemoveTab (int index)
 Removes the tab at the given index; returns the removed tab.
ITabGetTab (int index) const
 Returns the tab at the given index, or nullptr.
ITabGetActiveTab () const
 Returns the currently active tab, or nullptr.
virtual bool SetActiveTab (int index)
 Sets the active tab by index; returns true on success.
size_t GetTabCount () const
 Returns the number of tabs.
bool HasTabWithName (const wxString &name) const
 Returns true if a tab with the given name exists.
virtual void ClearAllTabs ()
 Removes all tabs.
wxAuiNotebook * GetNotebook () const
 Returns the underlying wxAuiNotebook.
Public Member Functions inherited from EmberUI::Panel
 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 CreateNotebook ()
 Hook: creates the notebook control. Override to customize.
virtual void OnTabAdded (ITab *tab, int index)
 Hook: called when a tab is added.
virtual void OnTabRemoved (ITab *tab, int index)
 Hook: called when a tab is removed.
virtual void OnActiveTabChanged (ITab *tab, int index)
 Hook: called when the active tab changes.
void CreateLayout () override
 Creates the side panel layout with the notebook.
Protected Member Functions inherited from EmberUI::Panel
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.

Protected Attributes

wxAuiNotebook * m_notebook
std::vector< ITabPtrm_tabs
int m_activeTabIndex

Private Types

enum  { ID_NOTEBOOK = wxID_HIGHEST + 2000 }

Private Member Functions

void OnTabChanged (wxAuiNotebookEvent &event)
void OnTabClosed (wxAuiNotebookEvent &event)
 SidePanel (const SidePanel &)=delete
SidePaneloperator= (const SidePanel &)=delete
 wxDECLARE_EVENT_TABLE ()

Detailed Description

Tabbed side panel using wxAuiNotebook.

Definition at line 12 of file SidePanel.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ID_NOTEBOOK 

Definition at line 58 of file SidePanel.h.

Constructor & Destructor Documentation

◆ SidePanel() [1/2]

EmberUI::SidePanel::SidePanel ( wxWindow * parent,
const wxString & panelName = "Side Panel",
bool autoLayout = true )

Constructs the side panel with optional name and auto-layout flag.

◆ ~SidePanel()

SidePanel::~SidePanel ( )
virtual

Reimplemented in SidePanel.

Definition at line 19 of file SidePanel.cpp.

◆ SidePanel() [2/2]

EmberUI::SidePanel::SidePanel ( const SidePanel & )
privatedelete

Member Function Documentation

◆ AddTab()

int SidePanel::AddTab ( ITabPtr tab)
virtual

Adds a tab and returns its index.

Reimplemented in SidePanel.

Definition at line 48 of file SidePanel.cpp.

◆ ClearAllTabs()

void SidePanel::ClearAllTabs ( )
virtual

Removes all tabs.

Reimplemented in SidePanel.

Definition at line 128 of file SidePanel.cpp.

◆ CreateLayout()

void SidePanel::CreateLayout ( )
overrideprotectedvirtual

Creates the side panel layout with the notebook.

Reimplemented from EmberUI::Panel.

Reimplemented in SidePanel.

Definition at line 27 of file SidePanel.cpp.

◆ CreateNotebook()

void SidePanel::CreateNotebook ( )
protectedvirtual

Hook: creates the notebook control. Override to customize.

Reimplemented in SidePanel.

Definition at line 39 of file SidePanel.cpp.

◆ GetActiveTab()

ITab * SidePanel::GetActiveTab ( ) const

Returns the currently active tab, or nullptr.

Definition at line 103 of file SidePanel.cpp.

◆ GetNotebook()

wxAuiNotebook * EmberUI::SidePanel::GetNotebook ( ) const
inline

Returns the underlying wxAuiNotebook.

Definition at line 35 of file SidePanel.h.

◆ GetTab()

ITab * SidePanel::GetTab ( int index) const

Returns the tab at the given index, or nullptr.

Definition at line 96 of file SidePanel.cpp.

◆ GetTabCount()

size_t EmberUI::SidePanel::GetTabCount ( ) const
inline

Returns the number of tabs.

Definition at line 29 of file SidePanel.h.

◆ HasTabWithName()

bool SidePanel::HasTabWithName ( const wxString & name) const

Returns true if a tab with the given name exists.

Definition at line 119 of file SidePanel.cpp.

◆ OnActiveTabChanged()

void SidePanel::OnActiveTabChanged ( ITab * tab,
int index )
protectedvirtual

Hook: called when the active tab changes.

Definition at line 140 of file SidePanel.cpp.

◆ OnTabAdded()

void SidePanel::OnTabAdded ( ITab * tab,
int index )
protectedvirtual

Hook: called when a tab is added.

Definition at line 138 of file SidePanel.cpp.

◆ OnTabChanged()

void SidePanel::OnTabChanged ( wxAuiNotebookEvent & event)
private

Definition at line 142 of file SidePanel.cpp.

◆ OnTabClosed()

void SidePanel::OnTabClosed ( wxAuiNotebookEvent & event)
private

Definition at line 154 of file SidePanel.cpp.

◆ OnTabRemoved()

void SidePanel::OnTabRemoved ( ITab * tab,
int index )
protectedvirtual

Hook: called when a tab is removed.

Definition at line 139 of file SidePanel.cpp.

◆ operator=()

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

◆ RemoveTab()

ITabPtr SidePanel::RemoveTab ( int index)
virtual

Removes the tab at the given index; returns the removed tab.

Reimplemented in SidePanel.

Definition at line 70 of file SidePanel.cpp.

◆ SetActiveTab()

bool SidePanel::SetActiveTab ( int index)
virtual

Sets the active tab by index; returns true on success.

Reimplemented in SidePanel.

Definition at line 110 of file SidePanel.cpp.

◆ wxDECLARE_EVENT_TABLE()

EmberUI::SidePanel::wxDECLARE_EVENT_TABLE ( )
private

Member Data Documentation

◆ m_activeTabIndex

int EmberUI::SidePanel::m_activeTabIndex
protected

Definition at line 52 of file SidePanel.h.

◆ m_notebook

wxAuiNotebook* EmberUI::SidePanel::m_notebook
protected

Definition at line 50 of file SidePanel.h.

◆ m_tabs

std::vector<ITabPtr> EmberUI::SidePanel::m_tabs
protected

Definition at line 51 of file SidePanel.h.


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