10#include <wx/aui/auibook.h>
11#include <wx/aui/framemanager.h>
12#include <wx/splitter.h>
35 SidePanel(wxWindow *parent,
MainFrame *mainFrame =
nullptr,
const wxString &panelName =
"Side Panel",
std::unique_ptr< ITab > ITabPtr
Smart pointer type for ITab instances.
Custom wxAuiNotebook that integrates Add Tab and Menu buttons into the tab bar.
Descriptor that tracks panel metadata.
wxString GetDisplayName() const
Get a display name for this panel type.
Abstract interface for individual tabs that can be moved between panels.
Main application window for EmberForge.
Panel(wxWindow *parent, const wxString &name="Panel", long style=wxTAB_TRAVERSAL)
Constructor.
wxString GetPanelType() const override=0
Get a unique identifier for this panel type.
void SetTabBarButtonsEnabled(bool enabled)
Enable or disable the tab bar buttons (+ and menu)
@ ID_BASE_PREFERENCES_MENU_ITEM
@ ID_BASE_HIDE_PANEL_MENU_ITEM
void FinishSetup()
Complete panel setup after construction.
virtual void ApplyPreferences()
Apply preferences to the side panel Virtual to allow derived classes to use their specific settings.
ITabPtr RemoveTab(int index)
Remove a tab by index.
void OnTabChanged(wxAuiNotebookEvent &event)
virtual const std::vector< std::string > & GetLastOpenTabs() const =0
std::vector< ITabPtr > m_tabs
void ClearAllTabs()
Clear all tabs from the panel Removes all tabs without creating any new ones.
void OnHidePanelClicked(wxCommandEvent &event)
bool HasTabWithName(const wxString &tabName) const
Check if this panel has a tab with the given name.
int AddTab(ITabPtr tab)
Add a tab to this panel.
wxString GetTitle() const override=0
Get the display title for this panel.
void ResetToDefaultTab(EmberForge::TabType defaultTabType)
Reset the panel to a single default tab Closes all tabs and creates only the specified default tab.
void RestoreAndEnsureTabs()
bool m_tabBarButtonsEnabled
virtual void CreateNotebook()
virtual void SetupEventHandlers()
ITab * GetActiveTab() const
Get the currently active tab.
void OnPanelPreferencesClicked(wxCommandEvent &event)
void SetPanelName(const wxString &name)
Set the panel name (for split panels)
virtual void OnMenuButtonClicked(wxCommandEvent &event)
virtual void OnPanelSpecificSetup()
void DoSetupEventHandlers()
void OnAddTabButtonClickedInternal(wxCommandEvent &event)
SidePanel(wxWindow *parent, MainFrame *mainFrame=nullptr, const wxString &panelName="Side Panel", EmberForge::PanelType panelType=EmberForge::PanelType::LeftPanel, EmberForge::PanelDescriptor *parentDescriptor=nullptr)
void OnTabClosed(wxAuiNotebookEvent &event)
virtual std::string GetLastActiveTab() const =0
void SetPanelDescriptor(const EmberForge::PanelDescriptor &descriptor)
Update the panel descriptor (used when creating split panels)
EmberForge::CustomAuiNotebook * GetNotebook() const
Get the notebook widget for direct access.
void ShowTabCreationMenu()
const EmberForge::PanelDescriptor & GetPanelDescriptor() const
Get the panel descriptor for this panel.
void ToggleTabBarButtons()
Toggle tab bar buttons visibility.
bool AreTabBarButtonsEnabled() const
Check if tab bar buttons are enabled.
virtual void OnAddTabButtonClicked(wxCommandEvent &event)
virtual void RestoreState()
Restore state from preferences Virtual to allow derived classes to use their specific settings.
void OnTabBarMenuButtonClicked(wxCommandEvent &event)
bool SetActiveTab(int index)
Set the active tab by index.
virtual bool GetRememberLastTab() const =0
void CreateAndAddTab(EmberForge::TabType tabType)
virtual void SaveState()
Save the current state (last active tab, etc.) Virtual to allow derived classes to use their specific...
EmberForge::PanelDescriptor m_descriptor
void ResetToDefaultTabs(const std::vector< EmberForge::TabType > &defaultTabTypes)
Reset the panel to multiple default tabs Closes all tabs and creates the specified default tabs.
virtual std::vector< EmberForge::TabType > GetSupportedTabTypes() const
EmberForge::CustomAuiNotebook * m_notebook
void OnTabBarAddButtonClicked(wxCommandEvent &event)
size_t GetTabCount() const
Get the number of tabs.
void CreateLayout() override
Create the panel's UI layout Called during initialization.
virtual std::string GetDefaultActiveTab() const =0
ITab * GetTab(int index) const
Get a tab by index.
PanelType
Defines the type of panel in the UI hierarchy.
TabType
Enumeration of available tab types.