![]() |
Ember
|
Generic container for managing tabbed UI components. More...
#include <TabContainer.h>
Classes | |
| struct | TabInfo |
Public Types | |
| enum class | TabState { Active , Inactive , Modified , Loading , Error } |
| using | TabActivatedCallback = std::function<void(ITab *tab, int index)> |
| using | TabClosedCallback = std::function<void(ITab *tab, int index)> |
| using | TabCreatedCallback = std::function<void(ITab *tab, int index)> |
Public Member Functions | |
| TabContainer (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxNB_TOP) | |
| virtual | ~TabContainer () |
| int | AddTab (std::unique_ptr< ITab > tab, const wxString &title, const wxString &tooltip=wxEmptyString) |
| bool | RemoveTab (int index) |
| bool | RemoveTab (ITab *tab) |
| void | RemoveAllTabs () |
| ITab * | GetTab (int index) const |
| ITab * | GetActiveTab () const |
| int | GetTabCount () const |
| int | GetTabIndex (ITab *tab) const |
| void | SetTabTitle (int index, const wxString &title) |
| wxString | GetTabTitle (int index) const |
| void | SetTabTooltip (int index, const wxString &tooltip) |
| wxString | GetTabTooltip (int index) const |
| void | SetTabState (int index, TabState state) |
| TabState | GetTabState (int index) const |
| void | SetTabClosable (int index, bool closable) |
| bool | IsTabClosable (int index) const |
| void | SetActiveTab (int index) |
| void | SetActiveTab (ITab *tab) |
| int | GetActiveTabIndex () const |
| void | NextTab () |
| void | PrevTab () |
| void | RefreshTab (int index) |
| void | RefreshAllTabs () |
| bool | CanCloseTab (int index) |
| bool | CanCloseAllTabs () |
| void | SetTabActivatedCallback (TabActivatedCallback callback) |
| void | SetTabClosedCallback (TabClosedCallback callback) |
| void | SetTabCreatedCallback (TabCreatedCallback callback) |
| void | SetTabUserData (int index, void *userData) |
| void * | GetTabUserData (int index) const |
| bool | SerializeState (wxString &data) const |
| bool | DeserializeState (const wxString &data) |
Protected Member Functions | |
| void | OnTabChanged (wxBookCtrlEvent &event) |
| void | OnTabChanging (wxBookCtrlEvent &event) |
| void | OnTabRightClick (wxMouseEvent &event) |
| void | OnTabMiddleClick (wxMouseEvent &event) |
| void | UpdateTabAppearance (int index) |
| void | CreateTabContextMenu (int index) |
| bool | ValidateTabIndex (int index) const |
| void | NotifyTabActivated (int index) |
| void | NotifyTabClosed (int index) |
| void | NotifyTabCreated (int index) |
Private Attributes | |
| std::vector< TabInfo > | m_tabs |
| TabActivatedCallback | m_tabActivatedCallback |
| TabClosedCallback | m_tabClosedCallback |
| TabCreatedCallback | m_tabCreatedCallback |
| int | m_activeTabIndex |
| bool | m_allowTabReorder |
| bool | m_showCloseButton |
Generic container for managing tabbed UI components.
TabContainer provides a reusable, feature-rich tab management system built on wxNotebook. It handles tab lifecycle, state tracking, event callbacks, and serialization for ITab-based components.
| State | Description |
|---|---|
| Active | Currently selected and visible |
| Inactive | Not currently selected |
| Modified | Has unsaved changes |
| Loading | Content is being loaded |
| Error | Tab encountered an error |
Definition at line 58 of file TabContainer.h.
| using EmberForge::ui::TabContainer::TabActivatedCallback = std::function<void(ITab *tab, int index)> |
Definition at line 61 of file TabContainer.h.
| using EmberForge::ui::TabContainer::TabClosedCallback = std::function<void(ITab *tab, int index)> |
Definition at line 62 of file TabContainer.h.
| using EmberForge::ui::TabContainer::TabCreatedCallback = std::function<void(ITab *tab, int index)> |
Definition at line 63 of file TabContainer.h.
|
strong |
| Enumerator | |
|---|---|
| Active | |
| Inactive | |
| Modified | |
| Loading | |
| Error | |
Definition at line 66 of file TabContainer.h.
| EmberForge::ui::TabContainer::TabContainer | ( | wxWindow * | parent, |
| wxWindowID | id = wxID_ANY, | ||
| const wxPoint & | pos = wxDefaultPosition, | ||
| const wxSize & | size = wxDefaultSize, | ||
| long | style = wxNB_TOP ) |
|
virtual |
Definition at line 18 of file TabContainer.cpp.
| int EmberForge::ui::TabContainer::AddTab | ( | std::unique_ptr< ITab > | tab, |
| const wxString & | title, | ||
| const wxString & | tooltip = wxEmptyString ) |
Definition at line 20 of file TabContainer.cpp.
| bool EmberForge::ui::TabContainer::CanCloseAllTabs | ( | ) |
Definition at line 234 of file TabContainer.cpp.
| bool EmberForge::ui::TabContainer::CanCloseTab | ( | int | index | ) |
Definition at line 226 of file TabContainer.cpp.
|
protected |
Definition at line 330 of file TabContainer.cpp.
| bool EmberForge::ui::TabContainer::DeserializeState | ( | const wxString & | data | ) |
Definition at line 268 of file TabContainer.cpp.
| ITab * EmberForge::ui::TabContainer::GetActiveTab | ( | ) | const |
Definition at line 109 of file TabContainer.cpp.
| int EmberForge::ui::TabContainer::GetActiveTabIndex | ( | ) | const |
Definition at line 193 of file TabContainer.cpp.
| ITab * EmberForge::ui::TabContainer::GetTab | ( | int | index | ) | const |
Definition at line 102 of file TabContainer.cpp.
| int EmberForge::ui::TabContainer::GetTabCount | ( | ) | const |
Definition at line 111 of file TabContainer.cpp.
| int EmberForge::ui::TabContainer::GetTabIndex | ( | ITab * | tab | ) | const |
Definition at line 113 of file TabContainer.cpp.
| TabContainer::TabState EmberForge::ui::TabContainer::GetTabState | ( | int | index | ) | const |
Definition at line 158 of file TabContainer.cpp.
| wxString EmberForge::ui::TabContainer::GetTabTitle | ( | int | index | ) | const |
Definition at line 129 of file TabContainer.cpp.
| wxString EmberForge::ui::TabContainer::GetTabTooltip | ( | int | index | ) | const |
Definition at line 144 of file TabContainer.cpp.
| void * EmberForge::ui::TabContainer::GetTabUserData | ( | int | index | ) | const |
Definition at line 255 of file TabContainer.cpp.
| bool EmberForge::ui::TabContainer::IsTabClosable | ( | int | index | ) | const |
Definition at line 171 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::NextTab | ( | ) |
Definition at line 195 of file TabContainer.cpp.
|
protected |
Definition at line 348 of file TabContainer.cpp.
|
protected |
Definition at line 354 of file TabContainer.cpp.
|
protected |
Definition at line 360 of file TabContainer.cpp.
|
protected |
Definition at line 274 of file TabContainer.cpp.
|
protected |
Definition at line 281 of file TabContainer.cpp.
|
protected |
Definition at line 295 of file TabContainer.cpp.
|
protected |
Definition at line 286 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::PrevTab | ( | ) |
Definition at line 203 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::RefreshAllTabs | ( | ) |
Definition at line 220 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::RefreshTab | ( | int | index | ) |
Definition at line 211 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::RemoveAllTabs | ( | ) |
Definition at line 96 of file TabContainer.cpp.
| bool EmberForge::ui::TabContainer::RemoveTab | ( | int | index | ) |
Definition at line 57 of file TabContainer.cpp.
| bool EmberForge::ui::TabContainer::RemoveTab | ( | ITab * | tab | ) |
Definition at line 88 of file TabContainer.cpp.
| bool EmberForge::ui::TabContainer::SerializeState | ( | wxString & | data | ) | const |
Definition at line 262 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::SetActiveTab | ( | int | index | ) |
Definition at line 178 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::SetActiveTab | ( | ITab * | tab | ) |
Definition at line 186 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::SetTabActivatedCallback | ( | TabActivatedCallback | callback | ) |
Definition at line 243 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::SetTabClosable | ( | int | index, |
| bool | closable ) |
Definition at line 165 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::SetTabClosedCallback | ( | TabClosedCallback | callback | ) |
Definition at line 245 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::SetTabCreatedCallback | ( | TabCreatedCallback | callback | ) |
Definition at line 247 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::SetTabState | ( | int | index, |
| TabState | state ) |
Definition at line 151 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::SetTabTitle | ( | int | index, |
| const wxString & | title ) |
Definition at line 122 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::SetTabTooltip | ( | int | index, |
| const wxString & | tooltip ) |
Definition at line 136 of file TabContainer.cpp.
| void EmberForge::ui::TabContainer::SetTabUserData | ( | int | index, |
| void * | userData ) |
Definition at line 249 of file TabContainer.cpp.
|
protected |
Definition at line 305 of file TabContainer.cpp.
|
protected |
Definition at line 346 of file TabContainer.cpp.
|
private |
Definition at line 158 of file TabContainer.h.
|
private |
Definition at line 159 of file TabContainer.h.
|
private |
Definition at line 160 of file TabContainer.h.
|
private |
Definition at line 153 of file TabContainer.h.
|
private |
Definition at line 154 of file TabContainer.h.
|
private |
Definition at line 155 of file TabContainer.h.
|
private |
Definition at line 150 of file TabContainer.h.