![]() |
Ember
|
#include <TreeSelectorTab.h>
Classes | |
| struct | FlatEntry |
| struct | TreeInfo |
Public Types | |
| enum class | SectionType { None , RootTrees , Subtrees } |
| using | TreeSelectionCallback = std::function<void(const std::string &treeId)> |
Public Member Functions | |
| TreeSelectorTab (wxWindow *parent, MainFrame *mainFrame=nullptr) | |
| wxWindow * | GetWidget () override |
| Get the main widget for this tab. | |
| wxString | GetTitle () const override |
| Get the display title for this tab. | |
| wxString | GetTabType () const override |
| Get a unique identifier for this tab type. | |
| void | OnClosed () override |
| Called when the tab is about to be closed/removed Use this for cleanup operations. | |
| void | OnActivated () override |
| Called when the tab becomes the active/visible tab. | |
| void | UpdateTreeList (const std::map< std::string, std::shared_ptr< EmberCore::BehaviorTree > > &trees, const std::string ¤tTreeId) |
| void | SetCurrentTree (const std::string &treeId) |
| void | ClearTreeList () |
| void | SetTreeSelectionCallback (TreeSelectionCallback callback) |
| const std::vector< FlatEntry > & | GetFlatList () const |
| const std::string & | GetCurrentTreeId () const |
| void | ToggleCollapse (const std::string &treeId) |
| void | ToggleSectionCollapse (SectionType section) |
| bool | IsCollapsed (const std::string &treeId) const |
| bool | IsSectionCollapsed (SectionType section) const |
| int | GetToggleHitX (int depth, bool isCurrent) const |
| void | ShowContextMenu (int itemIndex, const wxPoint &pos) |
| Public Member Functions inherited from ITab | |
| virtual | ~ITab ()=default |
| virtual wxBitmap | GetIcon () const |
| Get an optional icon for this tab. | |
| virtual void | Initialize () |
| Initialize the tab after construction Called once after the tab is created and configured. | |
| virtual void | Refresh () |
| Called when the tab should refresh its display This should update the tab's content to reflect current state. | |
| virtual void | OnDeactivated () |
| Called when the tab becomes inactive/hidden. | |
| virtual bool | IsValid () const |
| Check if the tab is in a valid state. | |
| virtual bool | CanClose () const |
| Check if this tab can be closed by the user. | |
| virtual bool | CanMove () const |
| Check if this tab can be moved to other panels. | |
| virtual wxString | SerializeState () const |
| Serialize the tab's current state to a string. | |
| virtual void | DeserializeState (const wxString &state) |
| Restore the tab's state from serialized data. | |
| virtual bool | HasUnsavedChanges () const |
| Check if this tab has unsaved changes. | |
| virtual bool | Save () |
| Save the tab's data (if applicable) | |
| virtual bool | SupportsOperation (const wxString &operation) const |
| Check if this tab supports the given operation. | |
| virtual bool | ExecuteOperation (const wxString &operation, const wxString ¶meter="") |
| Execute a named operation on this tab. | |
Private Types | |
| enum | { ID_LIST_BOX = wxID_HIGHEST + 1 , ID_SEARCH_CTRL , ID_COLLAPSE_ALL_BTN , ID_EXPAND_ALL_BTN , ID_CTX_VIEW_CURRENT , ID_CTX_OPEN_NEW_SCENE , ID_CTX_EXPAND_ALL , ID_CTX_COLLAPSE_ALL } |
Private Member Functions | |
| void | CreateLayout () |
| void | CollectSubTreeRefs (EmberCore::Node *node, std::set< std::string > &refs) const |
| void | BuildFlatList () |
| void | FlattenTree (const std::string &treeId, int depth, std::set< std::string > &visited, bool isLastChild, std::vector< bool > parentHasMore) |
| int | FindItemByTreeId (const std::string &treeId) const |
| void | OnSearchTextChanged (wxCommandEvent &event) |
| void | OnTreeSelected (wxCommandEvent &event) |
| void | OnContextViewInCurrent (wxCommandEvent &event) |
| void | OnContextOpenNewScene (wxCommandEvent &event) |
| void | OnContextExpandAll (wxCommandEvent &event) |
| void | OnContextCollapseAll (wxCommandEvent &event) |
| void | OnCollapseAll (wxCommandEvent &event) |
| void | OnExpandAll (wxCommandEvent &event) |
| void | CollapseAllTrees () |
| void | ExpandAllTrees () |
| wxDECLARE_EVENT_TABLE () | |
Private Attributes | |
| wxSearchCtrl * | m_searchCtrl |
| wxButton * | m_collapseAllBtn |
| wxButton * | m_expandAllBtn |
| TreeListBox * | m_listBox |
| wxStaticText * | m_statusLabel |
| std::map< std::string, TreeInfo > | m_treeInfoMap |
| std::vector< FlatEntry > | m_flatList |
| std::set< std::string > | m_collapsedTrees |
| bool | m_rootSectionCollapsed |
| bool | m_subtreesSectionCollapsed |
| std::string | m_currentTreeId |
| std::string | m_contextMenuTreeId |
| wxString | m_searchFilter |
| MainFrame * | m_mainFrame |
| TreeSelectionCallback | m_selectionCallback |
Definition at line 22 of file TreeSelectorTab.h.
| using TreeSelectorTab::TreeSelectionCallback = std::function<void(const std::string &treeId)> |
Definition at line 24 of file TreeSelectorTab.h.
|
private |
| Enumerator | |
|---|---|
| ID_LIST_BOX | |
| ID_SEARCH_CTRL | |
| ID_COLLAPSE_ALL_BTN | |
| ID_EXPAND_ALL_BTN | |
| ID_CTX_VIEW_CURRENT | |
| ID_CTX_OPEN_NEW_SCENE | |
| ID_CTX_EXPAND_ALL | |
| ID_CTX_COLLAPSE_ALL | |
Definition at line 122 of file TreeSelectorTab.h.
|
strong |
| Enumerator | |
|---|---|
| None | |
| RootTrees | |
| Subtrees | |
Definition at line 43 of file TreeSelectorTab.h.
| TreeSelectorTab::TreeSelectorTab | ( | wxWindow * | parent, |
| MainFrame * | mainFrame = nullptr ) |
Definition at line 298 of file TreeSelectorTab.cpp.
|
private |
Definition at line 395 of file TreeSelectorTab.cpp.
| void TreeSelectorTab::ClearTreeList | ( | ) |
Definition at line 642 of file TreeSelectorTab.cpp.
|
private |
Definition at line 739 of file TreeSelectorTab.cpp.
|
private |
Definition at line 342 of file TreeSelectorTab.cpp.
|
private |
Definition at line 306 of file TreeSelectorTab.cpp.
|
private |
Definition at line 749 of file TreeSelectorTab.cpp.
|
private |
Definition at line 575 of file TreeSelectorTab.cpp.
|
private |
Definition at line 527 of file TreeSelectorTab.cpp.
|
inline |
Definition at line 61 of file TreeSelectorTab.h.
|
inline |
Definition at line 60 of file TreeSelectorTab.h.
|
inlineoverridevirtual |
Get a unique identifier for this tab type.
Implements ITab.
Definition at line 31 of file TreeSelectorTab.h.
|
inlineoverridevirtual |
Get the display title for this tab.
Implements ITab.
Definition at line 30 of file TreeSelectorTab.h.
| int TreeSelectorTab::GetToggleHitX | ( | int | depth, |
| bool | isCurrent ) const |
Definition at line 632 of file TreeSelectorTab.cpp.
|
inlineoverridevirtual |
Get the main widget for this tab.
Implements ITab.
Definition at line 29 of file TreeSelectorTab.h.
| bool TreeSelectorTab::IsCollapsed | ( | const std::string & | treeId | ) | const |
Definition at line 602 of file TreeSelectorTab.cpp.
| bool TreeSelectorTab::IsSectionCollapsed | ( | SectionType | section | ) | const |
Definition at line 623 of file TreeSelectorTab.cpp.
|
overridevirtual |
Called when the tab becomes the active/visible tab.
Reimplemented from ITab.
Definition at line 660 of file TreeSelectorTab.cpp.
|
overridevirtual |
Called when the tab is about to be closed/removed Use this for cleanup operations.
Reimplemented from ITab.
Definition at line 654 of file TreeSelectorTab.cpp.
|
private |
Definition at line 735 of file TreeSelectorTab.cpp.
|
private |
Definition at line 728 of file TreeSelectorTab.cpp.
|
private |
Definition at line 721 of file TreeSelectorTab.cpp.
|
private |
Definition at line 714 of file TreeSelectorTab.cpp.
|
private |
Definition at line 701 of file TreeSelectorTab.cpp.
|
private |
Definition at line 737 of file TreeSelectorTab.cpp.
|
private |
Definition at line 674 of file TreeSelectorTab.cpp.
|
private |
Definition at line 670 of file TreeSelectorTab.cpp.
| void TreeSelectorTab::SetCurrentTree | ( | const std::string & | treeId | ) |
Definition at line 637 of file TreeSelectorTab.cpp.
|
inline |
Definition at line 41 of file TreeSelectorTab.h.
| void TreeSelectorTab::ShowContextMenu | ( | int | itemIndex, |
| const wxPoint & | pos ) |
Definition at line 679 of file TreeSelectorTab.cpp.
| void TreeSelectorTab::ToggleCollapse | ( | const std::string & | treeId | ) |
Definition at line 584 of file TreeSelectorTab.cpp.
| void TreeSelectorTab::ToggleSectionCollapse | ( | SectionType | section | ) |
Definition at line 606 of file TreeSelectorTab.cpp.
| void TreeSelectorTab::UpdateTreeList | ( | const std::map< std::string, std::shared_ptr< EmberCore::BehaviorTree > > & | trees, |
| const std::string & | currentTreeId ) |
Definition at line 356 of file TreeSelectorTab.cpp.
|
private |
|
private |
Definition at line 98 of file TreeSelectorTab.h.
|
private |
Definition at line 112 of file TreeSelectorTab.h.
|
private |
Definition at line 116 of file TreeSelectorTab.h.
|
private |
Definition at line 115 of file TreeSelectorTab.h.
|
private |
Definition at line 99 of file TreeSelectorTab.h.
|
private |
Definition at line 111 of file TreeSelectorTab.h.
|
private |
Definition at line 100 of file TreeSelectorTab.h.
|
private |
Definition at line 119 of file TreeSelectorTab.h.
|
private |
Definition at line 113 of file TreeSelectorTab.h.
|
private |
Definition at line 97 of file TreeSelectorTab.h.
|
private |
Definition at line 117 of file TreeSelectorTab.h.
|
private |
Definition at line 120 of file TreeSelectorTab.h.
|
private |
Definition at line 101 of file TreeSelectorTab.h.
|
private |
Definition at line 114 of file TreeSelectorTab.h.
|
private |
Definition at line 110 of file TreeSelectorTab.h.