Ember
Loading...
Searching...
No Matches
BottomPanel.h
Go to the documentation of this file.
1#pragma once
2
4#include "Interfaces/ITab.h"
5#include "Utils/Logger.h"
7#include <memory>
8#include <vector>
9#include <wx/aui/auibook.h>
10#include <wx/listbox.h>
11#include <wx/srchctrl.h>
12#include <wx/wx.h>
13
14// Forward declarations for EmberForge namespace
15namespace EmberForge {
16enum class TabType;
17class LogPanel;
19} // namespace EmberForge
20
21class MainFrame; // Forward declaration
22
45class BottomPanel : public SidePanel {
46 public:
47 BottomPanel(wxWindow *parent, MainFrame *mainFrame);
48 virtual ~BottomPanel();
49
50 // Override pure virtual methods from SidePanel
51 wxString GetTitle() const override { return "Bottom Panel"; }
52 wxString GetPanelType() const override { return "Bottom"; }
53
54 // Access to specific tabs (for backward compatibility)
55 wxTextCtrl *GetLogOutput() const { return m_logOutput; }
56 EmberForge::LogPanel *GetLogPanel() const { return m_logPanel; }
58
59 // Apply preferences to the bottom panel
60 void ApplyPreferences() override;
61
62 // Save the current state (last active tab, etc.)
63 void SaveState() override;
64
65 // Restore state from preferences
66 void RestoreState() override;
67
68 protected:
69 // Override settings accessor methods for common tab restoration logic
70 bool GetRememberLastTab() const override;
71 const std::vector<std::string> &GetLastOpenTabs() const override;
72 std::string GetLastActiveTab() const override;
73 std::string GetDefaultActiveTab() const override;
74
75 protected:
76 // Override hook methods to customize bottom panel behavior
77 void OnPanelSpecificSetup() override;
78 void OnAddTabButtonClicked(wxCommandEvent &event) override;
79 std::vector<EmberForge::TabType> GetSupportedTabTypes() const override;
80
81 private:
82 // References to specific controls that MainFrame needs (for compatibility)
83 wxTextCtrl *m_logOutput;
84 EmberForge::LogPanel *m_logPanel;
86
87 // Bottom panel specific event handlers
88 void OnAddLogTab(wxCommandEvent &event);
89 void OnAddPerformanceTab(wxCommandEvent &event);
90 void OnAddFileExplorerTab(wxCommandEvent &event);
91
92 // Bottom panel specific event IDs (offset from base)
93 enum {
98 };
99
101};
wxDECLARE_EVENT_TABLE()
std::string GetDefaultActiveTab() const override
EmberForge::PerformancePanel * m_performancePanel
Definition BottomPanel.h:85
void RestoreState() override
wxString GetTitle() const override
Returns the panel title.
Definition BottomPanel.h:51
void SaveState() override
wxString GetPanelType() const override
Returns the panel type identifier.
Definition BottomPanel.h:52
EmberForge::PerformancePanel * GetPerformancePanel() const
Definition BottomPanel.h:57
void OnAddTabButtonClicked(wxCommandEvent &event) override
void OnAddPerformanceTab(wxCommandEvent &event)
void OnAddLogTab(wxCommandEvent &event)
wxTextCtrl * GetLogOutput() const
Definition BottomPanel.h:55
@ ID_ADD_PERFORMANCE_TAB
Definition BottomPanel.h:96
@ ID_ADD_FILE_EXPLORER_TAB
Definition BottomPanel.h:97
@ ID_BOTTOM_PANEL_BASE
Definition BottomPanel.h:94
EmberForge::LogPanel * GetLogPanel() const
Definition BottomPanel.h:56
bool GetRememberLastTab() const override
EmberForge::LogPanel * m_logPanel
Definition BottomPanel.h:84
void ApplyPreferences() override
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)
virtual ~BottomPanel()
BottomPanel(wxWindow *parent, MainFrame *mainFrame)
wxTextCtrl * m_logOutput
Definition BottomPanel.h:83
Performance panel UI for displaying real-time metrics.
Main application window for EmberForge.
Definition MainFrame.h:67
SidePanel(wxWindow *parent, MainFrame *mainFrame=nullptr, const wxString &panelName="Side Panel", EmberForge::PanelType panelType=EmberForge::PanelType::LeftPanel, EmberForge::PanelDescriptor *parentDescriptor=nullptr)
TabType
Enumeration of available tab types.
Definition TabFactory.h:17