Ember
Loading...
Searching...
No Matches
BottomPanel Class Reference

Bottom dockable panel for logs and output. More...

#include <BottomPanel.h>

Inheritance diagram for BottomPanel:
SidePanel Panel IPanel

Public Member Functions

 BottomPanel (wxWindow *parent, MainFrame *mainFrame)
virtual ~BottomPanel ()
wxString GetTitle () const override
 Get the display title for this panel.
wxString GetPanelType () const override
 Get a unique identifier for this panel type.
wxTextCtrl * GetLogOutput () const
EmberForge::LogPanel * GetLogPanel () const
EmberForge::PerformancePanel * GetPerformancePanel () const
void ApplyPreferences () override
 Apply preferences to the side panel Virtual to allow derived classes to use their specific settings.
void SaveState () override
 Save the current state (last active tab, etc.) Virtual to allow derived classes to use their specific settings.
void RestoreState () override
 Restore state from preferences Virtual to allow derived classes to use their specific settings.
Public Member Functions inherited from SidePanel
 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 ()
 Complete panel setup after construction.
int AddTab (ITabPtr tab)
 Add a tab to this panel.
ITabPtr RemoveTab (int index)
 Remove a tab by index.
ITab * GetTab (int index) const
 Get a tab by index.
size_t GetTabCount () const
 Get the number of tabs.
bool SetActiveTab (int index)
 Set the active tab by index.
ITab * GetActiveTab () const
 Get the currently active tab.
EmberForge::CustomAuiNotebook * GetNotebook () const
 Get the notebook widget for direct access.
bool HasTabWithName (const wxString &tabName) const
 Check if this panel has a tab with the given name.
void ResetToDefaultTab (EmberForge::TabType defaultTabType)
 Reset the panel to a single default tab Closes all tabs and creates only the specified default tab.
void ResetToDefaultTabs (const std::vector< EmberForge::TabType > &defaultTabTypes)
 Reset the panel to multiple default tabs Closes all tabs and creates the specified default tabs.
void ClearAllTabs ()
 Clear all tabs from the panel Removes all tabs without creating any new ones.
void SetTabBarButtonsEnabled (bool enabled)
 Enable or disable the tab bar buttons (+ and menu)
bool AreTabBarButtonsEnabled () const
 Check if tab bar buttons are enabled.
void ToggleTabBarButtons ()
 Toggle tab bar buttons visibility.
void SetPanelName (const wxString &name)
 Set the panel name (for split panels)
const EmberForge::PanelDescriptor & GetPanelDescriptor () const
 Get the panel descriptor for this panel.
void SetPanelDescriptor (const EmberForge::PanelDescriptor &descriptor)
 Update the panel descriptor (used when creating split panels)
Public Member Functions inherited from Panel
 Panel (wxWindow *parent, const wxString &name="Panel", long style=wxTAB_TRAVERSAL)
 Constructor.
virtual ~Panel ()
 Destructor.
wxPanel * GetPanel () override
 Get the main panel widget.
void Initialize () override
 Initialize the panel after construction Called once after the panel is created and configured.
void Refresh () override
 Called when the panel should refresh its display This should update the panel's content to reflect current state.
void OnActivated () override
 Called when the panel becomes visible/active.
void OnDeactivated () override
 Called when the panel becomes hidden/inactive.
void Cleanup () override
 Called when the panel is about to be destroyed Use this for cleanup operations.
bool IsValid () const override
 Check if the panel is in a valid state.
wxString SerializeState () const override
 Serialize the panel's current state to a string.
void DeserializeState (const wxString &state) override
 Restore the panel's state from serialized data.
bool HasUnsavedChanges () const override
 Check if this panel has unsaved changes.
bool Save () override
 Save the panel's data (if applicable)
bool SupportsOperation (const wxString &operation) const override
 Check if this panel supports the given operation.
bool ExecuteOperation (const wxString &operation, const wxString &parameter="") override
 Execute a named operation on this panel.
wxString GetName () const override
void SetName (const wxString &name) override
void SetTitle (const wxString &title)
void SetPanelType (const wxString &type)
Public Member Functions inherited from IPanel
virtual ~IPanel ()=default

Protected Member Functions

bool GetRememberLastTab () const override
const std::vector< std::string > & GetLastOpenTabs () const override
std::string GetLastActiveTab () const override
std::string GetDefaultActiveTab () const override
void OnPanelSpecificSetup () override
void OnAddTabButtonClicked (wxCommandEvent &event) override
std::vector< EmberForge::TabType > GetSupportedTabTypes () const override
Protected Member Functions inherited from SidePanel
void CreateLayout () override
 Create the panel's UI layout Called during initialization.
virtual void CreateNotebook ()
virtual void SetupEventHandlers ()
void RestoreAndEnsureTabs ()
void DoCreateLayout ()
void DoCreateNotebook ()
void DoSetupEventHandlers ()
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 Panel
virtual void ApplyTheme ()
 Apply current theme to the panel Called when theme changes.
virtual void UpdateContent ()
 Update panel content Called during refresh.
virtual void HandleActivation ()
 Handle panel activation Called when panel becomes active.
virtual void HandleDeactivation ()
 Handle panel deactivation Called when panel becomes inactive.
virtual bool ValidateState () const
 Validate panel state Override to provide custom validation logic.
void MarkChanged ()
 Mark panel as having unsaved changes.
void MarkSaved ()
 Mark panel as saved (no unsaved changes)
wxSizer * GetMainSizer () const
 Get the main sizer for layout management.
void SetMainSizer (wxSizer *sizer)
 Set the main sizer (takes ownership)
virtual void OnPanelSize (wxSizeEvent &event)
virtual void OnPanelPaint (wxPaintEvent &event)
virtual void OnPanelRightClick (wxContextMenuEvent &event)

Private Types

enum  { ID_BOTTOM_PANEL_BASE = ID_BASE_LAST + 300 , ID_ADD_LOG_TAB , ID_ADD_PERFORMANCE_TAB , ID_ADD_FILE_EXPLORER_TAB }

Private Member Functions

void OnAddLogTab (wxCommandEvent &event)
void OnAddPerformanceTab (wxCommandEvent &event)
void OnAddFileExplorerTab (wxCommandEvent &event)
 wxDECLARE_EVENT_TABLE ()

Private Attributes

wxTextCtrl * m_logOutput
EmberForge::LogPanel * m_logPanel
EmberForge::PerformancePanel * m_performancePanel

Additional Inherited Members

Protected Types inherited from SidePanel
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 Attributes inherited from SidePanel
MainFrame * m_mainFrame
EmberForge::CustomAuiNotebook * m_notebook
std::vector< ITabPtr > m_tabs
int m_activeTabIndex
wxString m_panelName
bool m_tabBarButtonsEnabled
bool m_isInitializing
EmberForge::PanelDescriptor m_descriptor

Detailed Description

Bottom dockable panel for logs and output.

BottomPanel is the bottom dock area containing:

  • Log output tab for application messages
  • Performance monitoring panel
  • File explorer (optional)

The panel provides a central location for viewing application output and monitoring system performance.

Default Tabs

  • Logs: Application log messages with filtering
  • Performance: CPU, memory, and frame rate monitoring

State Persistence

The panel saves and restores:

  • Active tab selection
  • Log filter settings
  • Performance chart visibility

Definition at line 45 of file BottomPanel.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ID_BOTTOM_PANEL_BASE 
ID_ADD_LOG_TAB 
ID_ADD_PERFORMANCE_TAB 
ID_ADD_FILE_EXPLORER_TAB 

Definition at line 93 of file BottomPanel.h.

Constructor & Destructor Documentation

◆ BottomPanel()

BottomPanel::BottomPanel ( wxWindow * parent,
MainFrame * mainFrame )

◆ ~BottomPanel()

BottomPanel::~BottomPanel ( )
virtual

Definition at line 20 of file BottomPanel.cpp.

Member Function Documentation

◆ ApplyPreferences()

void BottomPanel::ApplyPreferences ( )
overridevirtual

Apply preferences to the side panel Virtual to allow derived classes to use their specific settings.

Reimplemented from SidePanel.

Definition at line 64 of file BottomPanel.cpp.

◆ GetDefaultActiveTab()

std::string BottomPanel::GetDefaultActiveTab ( ) const
overrideprotectedvirtual

Implements SidePanel.

Definition at line 40 of file BottomPanel.cpp.

◆ GetLastActiveTab()

std::string BottomPanel::GetLastActiveTab ( ) const
overrideprotectedvirtual

Implements SidePanel.

Definition at line 35 of file BottomPanel.cpp.

◆ GetLastOpenTabs()

const std::vector< std::string > & BottomPanel::GetLastOpenTabs ( ) const
overrideprotectedvirtual

Implements SidePanel.

Definition at line 30 of file BottomPanel.cpp.

◆ GetLogOutput()

wxTextCtrl * BottomPanel::GetLogOutput ( ) const
inline

Definition at line 55 of file BottomPanel.h.

◆ GetLogPanel()

EmberForge::LogPanel * BottomPanel::GetLogPanel ( ) const
inline

Definition at line 56 of file BottomPanel.h.

◆ GetPanelType()

wxString BottomPanel::GetPanelType ( ) const
inlineoverridevirtual

Get a unique identifier for this panel type.

Returns
wxString Identifier like "Properties", "SceneHierarchy", etc.

Implements SidePanel.

Definition at line 52 of file BottomPanel.h.

◆ GetPerformancePanel()

EmberForge::PerformancePanel * BottomPanel::GetPerformancePanel ( ) const
inline

Definition at line 57 of file BottomPanel.h.

◆ GetRememberLastTab()

bool BottomPanel::GetRememberLastTab ( ) const
overrideprotectedvirtual

Implements SidePanel.

Definition at line 25 of file BottomPanel.cpp.

◆ GetSupportedTabTypes()

std::vector< EmberForge::TabType > BottomPanel::GetSupportedTabTypes ( ) const
overrideprotectedvirtual

Reimplemented from SidePanel.

Definition at line 53 of file BottomPanel.cpp.

◆ GetTitle()

wxString BottomPanel::GetTitle ( ) const
inlineoverridevirtual

Get the display title for this panel.

Returns
wxString The title to show in tabs, captions, etc.

Implements SidePanel.

Definition at line 51 of file BottomPanel.h.

◆ OnAddFileExplorerTab()

void BottomPanel::OnAddFileExplorerTab ( wxCommandEvent & event)
private

Definition at line 62 of file BottomPanel.cpp.

◆ OnAddLogTab()

void BottomPanel::OnAddLogTab ( wxCommandEvent & event)
private

Definition at line 58 of file BottomPanel.cpp.

◆ OnAddPerformanceTab()

void BottomPanel::OnAddPerformanceTab ( wxCommandEvent & event)
private

Definition at line 60 of file BottomPanel.cpp.

◆ OnAddTabButtonClicked()

void BottomPanel::OnAddTabButtonClicked ( wxCommandEvent & event)
overrideprotectedvirtual

Reimplemented from SidePanel.

Definition at line 48 of file BottomPanel.cpp.

◆ OnPanelSpecificSetup()

void BottomPanel::OnPanelSpecificSetup ( )
overrideprotectedvirtual

Reimplemented from SidePanel.

Definition at line 42 of file BottomPanel.cpp.

◆ RestoreState()

void BottomPanel::RestoreState ( )
overridevirtual

Restore state from preferences Virtual to allow derived classes to use their specific settings.

Reimplemented from SidePanel.

Definition at line 140 of file BottomPanel.cpp.

◆ SaveState()

void BottomPanel::SaveState ( )
overridevirtual

Save the current state (last active tab, etc.) Virtual to allow derived classes to use their specific settings.

Reimplemented from SidePanel.

Definition at line 94 of file BottomPanel.cpp.

◆ wxDECLARE_EVENT_TABLE()

BottomPanel::wxDECLARE_EVENT_TABLE ( )
private

Member Data Documentation

◆ m_logOutput

wxTextCtrl* BottomPanel::m_logOutput
private

Definition at line 83 of file BottomPanel.h.

◆ m_logPanel

EmberForge::LogPanel* BottomPanel::m_logPanel
private

Definition at line 84 of file BottomPanel.h.

◆ m_performancePanel

EmberForge::PerformancePanel* BottomPanel::m_performancePanel
private

Definition at line 85 of file BottomPanel.h.


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