Ember
Loading...
Searching...
No Matches
SidePanel Class Referenceabstract

#include <ForgeSidePanel.h>

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

Public Member Functions

 SidePanel (wxWindow *parent, MainFrame *mainFrame=nullptr, const wxString &panelName="Side Panel", EmberForge::PanelType panelType=EmberForge::PanelType::LeftPanel, EmberForge::PanelDescriptor *parentDescriptor=nullptr)
virtual ~SidePanel ()
void FinishSetup ()
wxString GetTitle () const override=0
 Returns the panel title.
wxString GetPanelType () const override=0
 Returns the panel type identifier.
int AddTab (ITabPtr tab) override
 Adds a tab and returns its index.
ITabPtr RemoveTab (int index) override
 Removes the tab at the given index; returns the removed tab.
bool SetActiveTab (int index) override
 Sets the active tab by index; returns true on success.
void ClearAllTabs () override
 Removes all tabs.
EmberForge::CustomAuiNotebookGetCustomNotebook () const
void ResetToDefaultTab (EmberForge::TabType defaultTabType)
void ResetToDefaultTabs (const std::vector< EmberForge::TabType > &defaultTabTypes)
virtual void ApplyPreferences ()
virtual void SaveState ()
virtual void RestoreState ()
void SetTabBarButtonsEnabled (bool enabled)
bool AreTabBarButtonsEnabled () const
void ToggleTabBarButtons ()
void SetPanelName (const wxString &name)
const EmberForge::PanelDescriptorGetPanelDescriptor () const
void SetPanelDescriptor (const EmberForge::PanelDescriptor &descriptor)
Public Member Functions inherited from EmberUI::SidePanel
 SidePanel (wxWindow *parent, const wxString &panelName="Side Panel", bool autoLayout=true)
 Constructs the side panel with optional name and auto-layout flag.
ITabGetTab (int index) const
 Returns the tab at the given index, or nullptr.
ITabGetActiveTab () const
 Returns the currently active tab, or nullptr.
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.
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.
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 Types

enum  BaseEventIDs {
  ID_BASE_NOTEBOOK = wxID_HIGHEST + 1000 , ID_BASE_HIDE_PANEL_MENU_ITEM , ID_BASE_PREFERENCES_MENU_ITEM , ID_BASE_ADD_TAB_BUTTON ,
  ID_BASE_MENU_BUTTON , ID_BASE_LAST
}

Protected Member Functions

void CreateLayout () override
 Creates the side panel layout with the notebook.
void CreateNotebook () override
 Hook: creates the notebook control. Override to customize.
virtual void SetupEventHandlers ()
virtual void OnPanelSpecificSetup ()
virtual bool GetRememberLastTab () const =0
virtual const std::vector< std::string > & GetLastOpenTabs () const =0
virtual std::string GetLastActiveTab () const =0
virtual std::string GetDefaultActiveTab () const =0
void RestoreAndEnsureTabs ()
void DoCreateLayout ()
void DoCreateNotebook ()
void DoSetupEventHandlers ()
virtual void OnAddTabButtonClicked (wxCommandEvent &event)
virtual std::vector< EmberForge::TabTypeGetSupportedTabTypes () const
void OnTabChanged (wxAuiNotebookEvent &event)
void OnTabClosed (wxAuiNotebookEvent &event)
void OnAddTabButtonClickedInternal (wxCommandEvent &event)
virtual void OnMenuButtonClicked (wxCommandEvent &event)
void OnHidePanelClicked (wxCommandEvent &event)
void OnPanelPreferencesClicked (wxCommandEvent &event)
void OnTabBarAddButtonClicked (wxCommandEvent &event)
void OnTabBarMenuButtonClicked (wxCommandEvent &event)
void CreateAndAddTab (EmberForge::TabType tabType)
void ShowTabCreationMenu ()
Protected Member Functions inherited from EmberUI::SidePanel
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.
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

MainFramem_mainFrame
wxString m_panelName
bool m_tabBarButtonsEnabled
bool m_isInitializing
EmberForge::PanelDescriptor m_descriptor
Protected Attributes inherited from EmberUI::SidePanel
wxAuiNotebook * m_notebook
std::vector< ITabPtrm_tabs
int m_activeTabIndex

Private Member Functions

 wxDECLARE_EVENT_TABLE ()

Detailed Description

Definition at line 20 of file ForgeSidePanel.h.

Member Enumeration Documentation

◆ BaseEventIDs

enum SidePanel::BaseEventIDs
protected
Enumerator
ID_BASE_NOTEBOOK 
ID_BASE_HIDE_PANEL_MENU_ITEM 
ID_BASE_PREFERENCES_MENU_ITEM 
ID_BASE_ADD_TAB_BUTTON 
ID_BASE_MENU_BUTTON 
ID_BASE_LAST 

Definition at line 101 of file ForgeSidePanel.h.

Constructor & Destructor Documentation

◆ SidePanel()

SidePanel::SidePanel ( wxWindow * parent,
MainFrame * mainFrame = nullptr,
const wxString & panelName = "Side Panel",
EmberForge::PanelType panelType = EmberForge::PanelType::LeftPanel,
EmberForge::PanelDescriptor * parentDescriptor = nullptr )

◆ ~SidePanel()

SidePanel::~SidePanel ( )
virtual

Reimplemented from EmberUI::SidePanel.

Definition at line 42 of file SidePanel.cpp.

Member Function Documentation

◆ AddTab()

int SidePanel::AddTab ( ITabPtr tab)
overridevirtual

Adds a tab and returns its index.

Reimplemented from EmberUI::SidePanel.

Definition at line 171 of file SidePanel.cpp.

◆ ApplyPreferences()

void SidePanel::ApplyPreferences ( )
virtual

Reimplemented in BottomPanel, LeftSidePanel, and RightSidePanel.

Definition at line 560 of file SidePanel.cpp.

◆ AreTabBarButtonsEnabled()

bool SidePanel::AreTabBarButtonsEnabled ( ) const
inline

Definition at line 49 of file ForgeSidePanel.h.

◆ ClearAllTabs()

void SidePanel::ClearAllTabs ( )
overridevirtual

Removes all tabs.

Reimplemented from EmberUI::SidePanel.

Definition at line 288 of file SidePanel.cpp.

◆ CreateAndAddTab()

void SidePanel::CreateAndAddTab ( EmberForge::TabType tabType)
protected

Definition at line 439 of file SidePanel.cpp.

◆ CreateLayout()

void SidePanel::CreateLayout ( )
overrideprotectedvirtual

Creates the side panel layout with the notebook.

Reimplemented from EmberUI::SidePanel.

Definition at line 52 of file SidePanel.cpp.

◆ CreateNotebook()

void SidePanel::CreateNotebook ( )
overrideprotectedvirtual

Hook: creates the notebook control. Override to customize.

Reimplemented from EmberUI::SidePanel.

Definition at line 81 of file SidePanel.cpp.

◆ DoCreateLayout()

void SidePanel::DoCreateLayout ( )
protected

Definition at line 54 of file SidePanel.cpp.

◆ DoCreateNotebook()

void SidePanel::DoCreateNotebook ( )
protected

Definition at line 83 of file SidePanel.cpp.

◆ DoSetupEventHandlers()

void SidePanel::DoSetupEventHandlers ( )
protected

Definition at line 100 of file SidePanel.cpp.

◆ FinishSetup()

void SidePanel::FinishSetup ( )

Definition at line 69 of file SidePanel.cpp.

◆ GetCustomNotebook()

EmberForge::CustomAuiNotebook * SidePanel::GetCustomNotebook ( ) const
inline

Definition at line 37 of file ForgeSidePanel.h.

◆ GetDefaultActiveTab()

virtual std::string SidePanel::GetDefaultActiveTab ( ) const
protectedpure virtual

Implemented in BottomPanel, LeftSidePanel, and RightSidePanel.

◆ GetLastActiveTab()

virtual std::string SidePanel::GetLastActiveTab ( ) const
protectedpure virtual

Implemented in BottomPanel, LeftSidePanel, and RightSidePanel.

◆ GetLastOpenTabs()

virtual const std::vector< std::string > & SidePanel::GetLastOpenTabs ( ) const
protectedpure virtual

Implemented in BottomPanel, LeftSidePanel, and RightSidePanel.

◆ GetPanelDescriptor()

const EmberForge::PanelDescriptor & SidePanel::GetPanelDescriptor ( ) const
inline

Definition at line 54 of file ForgeSidePanel.h.

◆ GetPanelType()

wxString SidePanel::GetPanelType ( ) const
overridepure virtual

Returns the panel type identifier.

Reimplemented from EmberUI::Panel.

Implemented in BottomPanel, LeftSidePanel, and RightSidePanel.

◆ GetRememberLastTab()

virtual bool SidePanel::GetRememberLastTab ( ) const
protectedpure virtual

Implemented in BottomPanel, LeftSidePanel, and RightSidePanel.

◆ GetSupportedTabTypes()

virtual std::vector< EmberForge::TabType > SidePanel::GetSupportedTabTypes ( ) const
inlineprotectedvirtual

Reimplemented in BottomPanel, LeftSidePanel, and RightSidePanel.

Definition at line 79 of file ForgeSidePanel.h.

◆ GetTitle()

wxString SidePanel::GetTitle ( ) const
overridepure virtual

Returns the panel title.

Reimplemented from EmberUI::Panel.

Implemented in BottomPanel, LeftSidePanel, and RightSidePanel.

◆ OnAddTabButtonClicked()

virtual void SidePanel::OnAddTabButtonClicked ( wxCommandEvent & event)
inlineprotectedvirtual

Reimplemented in BottomPanel, LeftSidePanel, and RightSidePanel.

Definition at line 78 of file ForgeSidePanel.h.

◆ OnAddTabButtonClickedInternal()

void SidePanel::OnAddTabButtonClickedInternal ( wxCommandEvent & event)
protected

Definition at line 357 of file SidePanel.cpp.

◆ OnHidePanelClicked()

void SidePanel::OnHidePanelClicked ( wxCommandEvent & event)
protected

Definition at line 394 of file SidePanel.cpp.

◆ OnMenuButtonClicked()

void SidePanel::OnMenuButtonClicked ( wxCommandEvent & event)
protectedvirtual

Definition at line 381 of file SidePanel.cpp.

◆ OnPanelPreferencesClicked()

void SidePanel::OnPanelPreferencesClicked ( wxCommandEvent & event)
protected

Definition at line 419 of file SidePanel.cpp.

◆ OnPanelSpecificSetup()

void SidePanel::OnPanelSpecificSetup ( )
protectedvirtual

Reimplemented in BottomPanel, LeftSidePanel, and RightSidePanel.

Definition at line 104 of file SidePanel.cpp.

◆ OnTabBarAddButtonClicked()

void SidePanel::OnTabBarAddButtonClicked ( wxCommandEvent & event)
protected

Definition at line 367 of file SidePanel.cpp.

◆ OnTabBarMenuButtonClicked()

void SidePanel::OnTabBarMenuButtonClicked ( wxCommandEvent & event)
protected

Definition at line 374 of file SidePanel.cpp.

◆ OnTabChanged()

void SidePanel::OnTabChanged ( wxAuiNotebookEvent & event)
protected

Definition at line 298 of file SidePanel.cpp.

◆ OnTabClosed()

void SidePanel::OnTabClosed ( wxAuiNotebookEvent & event)
protected

Definition at line 320 of file SidePanel.cpp.

◆ RemoveTab()

ITabPtr SidePanel::RemoveTab ( int index)
overridevirtual

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

Reimplemented from EmberUI::SidePanel.

Definition at line 200 of file SidePanel.cpp.

◆ ResetToDefaultTab()

void SidePanel::ResetToDefaultTab ( EmberForge::TabType defaultTabType)

Definition at line 227 of file SidePanel.cpp.

◆ ResetToDefaultTabs()

void SidePanel::ResetToDefaultTabs ( const std::vector< EmberForge::TabType > & defaultTabTypes)

Definition at line 263 of file SidePanel.cpp.

◆ RestoreAndEnsureTabs()

void SidePanel::RestoreAndEnsureTabs ( )
protected

Definition at line 108 of file SidePanel.cpp.

◆ RestoreState()

void SidePanel::RestoreState ( )
virtual

Reimplemented in BottomPanel, LeftSidePanel, and RightSidePanel.

Definition at line 570 of file SidePanel.cpp.

◆ SaveState()

void SidePanel::SaveState ( )
virtual

Reimplemented in BottomPanel, LeftSidePanel, and RightSidePanel.

Definition at line 565 of file SidePanel.cpp.

◆ SetActiveTab()

bool SidePanel::SetActiveTab ( int index)
overridevirtual

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

Reimplemented from EmberUI::SidePanel.

Definition at line 218 of file SidePanel.cpp.

◆ SetPanelDescriptor()

void SidePanel::SetPanelDescriptor ( const EmberForge::PanelDescriptor & descriptor)
inline

Definition at line 55 of file ForgeSidePanel.h.

◆ SetPanelName()

void SidePanel::SetPanelName ( const wxString & name)
inline

Definition at line 52 of file ForgeSidePanel.h.

◆ SetTabBarButtonsEnabled()

void SidePanel::SetTabBarButtonsEnabled ( bool enabled)

Definition at line 540 of file SidePanel.cpp.

◆ SetupEventHandlers()

void SidePanel::SetupEventHandlers ( )
protectedvirtual

Definition at line 98 of file SidePanel.cpp.

◆ ShowTabCreationMenu()

void SidePanel::ShowTabCreationMenu ( )
protected

Definition at line 482 of file SidePanel.cpp.

◆ ToggleTabBarButtons()

void SidePanel::ToggleTabBarButtons ( )

Definition at line 554 of file SidePanel.cpp.

◆ wxDECLARE_EVENT_TABLE()

SidePanel::wxDECLARE_EVENT_TABLE ( )
private

Member Data Documentation

◆ m_descriptor

EmberForge::PanelDescriptor SidePanel::m_descriptor
protected

Definition at line 99 of file ForgeSidePanel.h.

◆ m_isInitializing

bool SidePanel::m_isInitializing
protected

Definition at line 98 of file ForgeSidePanel.h.

◆ m_mainFrame

MainFrame* SidePanel::m_mainFrame
protected

Definition at line 95 of file ForgeSidePanel.h.

◆ m_panelName

wxString SidePanel::m_panelName
protected

Definition at line 96 of file ForgeSidePanel.h.

◆ m_tabBarButtonsEnabled

bool SidePanel::m_tabBarButtonsEnabled
protected

Definition at line 97 of file ForgeSidePanel.h.


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