1#include "Panels/RightSidePanel.h"
13 LOG_INFO(
"Panel",
"Created RightSidePanel with wxAuiToolBar");
41 LOG_INFO(
"Panel",
"*** RightSidePanel::OnPanelSpecificSetup() called ***");
43 LOG_INFO(
"Panel",
"RightSidePanel::OnPanelSpecificSetup() completed");
51 LOG_INFO(
"Panel",
"Right panel add tab button clicked - showing custom menu");
56 LOG_INFO(
"Panel",
"Adding Properties tab to right panel");
65 LOG_ERROR(
"RightPanel",
"Cannot apply preferences - notebook is null");
71 if (settings.showTabCloseButtons) {
72 style |= wxAUI_NB_CLOSE_ON_ACTIVE_TAB;
74 style &= ~wxAUI_NB_CLOSE_ON_ACTIVE_TAB;
79 wxString::Format(
"Applied preferences - closeButtons: %d", settings.showTabCloseButtons).ToStdString());
96 if (activeIndex != wxNOT_FOUND && activeIndex <
static_cast<int>(
GetNotebook()->GetPageCount())) {
97 wxString tabDisplayName =
GetNotebook()->GetPageText(activeIndex);
101 for (
const auto &tabType : sidePanelTabs) {
104 LOG_INFO(
"RightPanel", std::string(
"Saved last active tab: ") + settings.lastActiveTab);
111 settings.lastOpenTabs.clear();
112 for (
size_t i = 0; i <
GetNotebook()->GetPageCount(); ++i) {
113 wxString tabDisplayName =
GetNotebook()->GetPageText(i);
117 for (
const auto &tabType : sidePanelTabs) {
124 LOG_INFO(
"RightPanel", wxString::Format(
"Saved %zu open tabs", settings.lastOpenTabs.size()).ToStdString());
135 if (settings.rememberLastTab && !settings.lastOpenTabs.empty()) {
137 LOG_INFO(
"RightPanel", wxString::Format(
"Restoring %zu open tabs", settings.lastOpenTabs.size()).ToStdString());
139 for (
const auto &tabTypeStr : settings.lastOpenTabs) {
144 bool alreadyOpen =
false;
145 for (
size_t i = 0; i <
GetNotebook()->GetPageCount(); ++i) {
146 if (
GetNotebook()->GetPageText(i) == tabDisplayName) {
155 LOG_INFO(
"RightPanel", wxString::Format(
"Restored tab: %s", tabDisplayName).ToStdString());
160 wxString targetTabName =
163 for (
size_t i = 0; i <
GetNotebook()->GetPageCount(); ++i) {
164 if (
GetNotebook()->GetPageText(i) == targetTabName) {
166 LOG_INFO(
"RightPanel", wxString::Format(
"Selected active tab: %s", targetTabName).ToStdString());
175 for (
size_t i = 0; i <
GetNotebook()->GetPageCount(); ++i) {
176 if (
GetNotebook()->GetPageText(i) == targetTabName) {
178 LOG_INFO(
"RightPanel", wxString::Format(
"Selected default tab: %s", targetTabName).ToStdString());
BehaviorTreeProjectDialog::OnProjectNameChanged BehaviorTreeProjectDialog::OnRemoveFiles wxEND_EVENT_TABLE() BehaviorTreeProjectDialog
wxBEGIN_EVENT_TABLE(RightSidePanel, SidePanel) EVT_MENU(ID_ADD_PROPERTIES_TAB
#define LOG_ERROR(category, message)
#define LOG_INFO(category, message)
MainFrame::OnExit EVT_MENU(wxID_ABOUT, MainFrame::OnAbout) EVT_MENU(ID_NewProject
AppPreferences & GetPreferences()
static AppPreferencesManager & GetInstance()
RightPanelSettings & GetRightPanelSettings()
static wxString GetTabDisplayName(TabType type)
Get the display name for a tab type.
static std::vector< TabType > GetSidePanelTabTypes()
Get tab types supported by the side panels.
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.
wxAuiNotebook * GetNotebook() const
Returns the underlying wxAuiNotebook.
Main application window for EmberForge.
Right sidebar panel specialized for right-side functionality.
std::vector< EmberForge::TabType > GetSupportedTabTypes() const override
void OnAddTabButtonClicked(wxCommandEvent &event) override
void RestoreState() override
void SaveState() override
const std::vector< std::string > & GetLastOpenTabs() const override
std::string GetDefaultActiveTab() const override
void ApplyPreferences() override
void OnPanelSpecificSetup() override
void OnAddPropertiesTab(wxCommandEvent &event)
std::string GetLastActiveTab() const override
bool GetRememberLastTab() const override
virtual ~RightSidePanel()
void RestoreAndEnsureTabs()
void ShowTabCreationMenu()
void CreateAndAddTab(EmberForge::TabType tabType)
TabType
Enumeration of available tab types.
EmberCore::String lastActiveTab
EmberCore::String defaultActiveTab
std::vector< EmberCore::String > lastOpenTabs