16 m_logPanel(
nullptr), m_performancePanel(
nullptr) {
17 SetBackgroundColour(wxColour(60, 60, 60));
43 LOG_INFO(
"BottomPanel",
"*** BottomPanel::OnPanelSpecificSetup() called ***");
45 LOG_INFO(
"BottomPanel",
"OnPanelSpecificSetup() completed");
49 LOG_INFO(
"Panel",
"Bottom panel add tab button clicked - showing tab creation menu");
69 LOG_ERROR(
"BottomPanel",
"Cannot apply preferences - notebook is null");
73 LOG_INFO(
"BottomPanel",
"Applying bottom panel preferences");
79 if (settings.showTabCloseButtons) {
80 style |= wxAUI_NB_CLOSE_ON_ALL_TABS;
82 style &= ~wxAUI_NB_CLOSE_ON_ALL_TABS;
83 style &= ~wxAUI_NB_CLOSE_ON_ACTIVE_TAB;
84 style &= ~wxAUI_NB_CLOSE_BUTTON;
91 wxString::Format(
"Applied preferences - closeButtons: %d", settings.showTabCloseButtons).ToStdString());
108 if (activeIndex != wxNOT_FOUND && activeIndex <
static_cast<int>(
m_notebook->GetPageCount())) {
109 wxString tabDisplayName =
m_notebook->GetPageText(activeIndex);
113 for (
const auto &tabType : bottomPanelTabs) {
116 LOG_INFO(
"BottomPanel", std::string(
"Saved last active tab: ") + settings.lastActiveTab);
123 settings.lastOpenTabs.clear();
124 for (
size_t i = 0; i <
m_notebook->GetPageCount(); ++i) {
125 wxString tabDisplayName =
m_notebook->GetPageText(i);
129 for (
const auto &tabType : bottomPanelTabs) {
136 LOG_INFO(
"BottomPanel", wxString::Format(
"Saved %zu open tabs", settings.lastOpenTabs.size()).ToStdString());
147 if (settings.rememberLastTab && !settings.lastOpenTabs.empty()) {
150 wxString::Format(
"Restoring %zu open tabs", settings.lastOpenTabs.size()).ToStdString());
152 for (
const auto &tabTypeStr : settings.lastOpenTabs) {
157 bool alreadyOpen =
false;
158 for (
size_t i = 0; i <
m_notebook->GetPageCount(); ++i) {
159 if (
m_notebook->GetPageText(i) == tabDisplayName) {
168 LOG_INFO(
"BottomPanel", wxString::Format(
"Restored tab: %s", tabDisplayName).ToStdString());
173 wxString targetTabName =
176 for (
size_t i = 0; i <
m_notebook->GetPageCount(); ++i) {
177 if (
m_notebook->GetPageText(i) == targetTabName) {
179 LOG_INFO(
"BottomPanel", wxString::Format(
"Selected active tab: %s", targetTabName).ToStdString());
187 for (
size_t i = 0; i <
m_notebook->GetPageCount(); ++i) {
188 if (
m_notebook->GetPageText(i) == targetTabName) {
190 LOG_INFO(
"BottomPanel", wxString::Format(
"Selected default tab: %s", targetTabName).ToStdString());
BehaviorTreeProjectDialog::OnProjectNameChanged BehaviorTreeProjectDialog::OnRemoveFiles wxEND_EVENT_TABLE() BehaviorTreeProjectDialog
wxBEGIN_EVENT_TABLE(BottomPanel, SidePanel) EVT_MENU(ID_ADD_LOG_TAB
BottomPanel::OnAddLogTab EVT_MENU(ID_ADD_FILE_EXPLORER_TAB, BottomPanel::OnAddFileExplorerTab) wxEND_EVENT_TABLE() BottomPanel
#define LOG_ERROR(category, message)
#define LOG_INFO(category, message)
MainFrame::OnExit EVT_MENU(wxID_ABOUT, MainFrame::OnAbout) EVT_MENU(ID_NewProject
Bottom dockable panel for logs and output.
std::string GetDefaultActiveTab() const override
void RestoreState() override
Restore state from preferences 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...
void OnAddTabButtonClicked(wxCommandEvent &event) override
void OnAddPerformanceTab(wxCommandEvent &event)
void OnAddLogTab(wxCommandEvent &event)
bool GetRememberLastTab() const override
void ApplyPreferences() override
Apply preferences to the side panel Virtual to allow derived classes to use their specific settings.
std::string GetLastActiveTab() const override
std::vector< EmberForge::TabType > GetSupportedTabTypes() const override
const std::vector< std::string > & GetLastOpenTabs() const override
void OnPanelSpecificSetup() override
void OnAddFileExplorerTab(wxCommandEvent &event)
AppPreferences & GetPreferences()
static AppPreferencesManager & GetInstance()
BottomPanelSettings & GetBottomPanelSettings()
static wxString GetTabDisplayName(TabType type)
Get the display name for a tab type.
static std::string TabTypeToString(TabType type)
Convert tab type to string identifier (for preferences storage)
static TabType StringToTabType(const std::string &str)
Convert string identifier to tab type.
static std::vector< TabType > GetBottomPanelTabTypes()
Get tab types supported by the bottom panel.
Main application window for EmberForge.
Base class for sidebar panels with shared tab management backend.
void RestoreAndEnsureTabs()
void ShowTabCreationMenu()
void CreateAndAddTab(EmberForge::TabType tabType)
EmberForge::CustomAuiNotebook * m_notebook
TabType
Enumeration of available tab types.
EmberCore::String lastActiveTab
std::vector< EmberCore::String > lastOpenTabs