Ember
Loading...
Searching...
No Matches
PropertiesTabBase.h
Go to the documentation of this file.
1#pragma once
2
3#include "Interfaces/ITab.h"
5#include <wx/propgrid/propgrid.h>
6#include <wx/simplebook.h>
7#include <wx/wx.h>
8
9namespace EmberUI {
10
12class PropertiesTabBase : public wxPanel, public ITab {
13 public:
14 explicit PropertiesTabBase(wxWindow *parent);
15 virtual ~PropertiesTabBase() = default;
16
17 // ITab interface
18 wxWindow *GetWidget() override { return this; }
19 wxString GetTitle() const override { return "Properties"; }
20
24 void ClearSelection();
25
27 void SetSelectionHighlightColor(const wxColour &color);
28
29 protected:
31 void InitLayout();
33 void SetupPropertyGrid(wxPanel *parent);
35 void AddBasicNodeInfo();
36
38 virtual void CreateContentLayout(wxPanel *contentPanel) = 0;
40 virtual void PopulateProperties() = 0;
42 virtual wxString GetPlaceholderText() const;
44 virtual void OnNodeCleared();
45
46 wxSimplebook *m_stack;
49 wxPropertyGrid *m_propertyGrid;
51
53
54 static const wxColour kBgColor;
55 static const wxColour kCaptionBgColor;
56 static const wxColour kTextColor;
57 static const wxColour kLineColor;
58 static const wxColour kCellBgColor;
59};
60
61} // namespace EmberUI
Abstract interface for tree nodes that can be visualized.
Definition ITreeNode.h:31
void InitLayout()
Initializes the tab layout (stack, placeholder, content panels).
static const wxColour kLineColor
PropertiesTabBase(wxWindow *parent)
virtual void PopulateProperties()=0
Pure virtual: subclasses populate the property grid from m_selectedNode.
static const wxColour kCellBgColor
void SetSelectedNode(EmberCore::ITreeNode *node)
Sets the node whose properties are displayed.
static const wxColour kBgColor
void SetupPropertyGrid(wxPanel *parent)
Creates and configures the property grid in the given parent.
static const wxColour kTextColor
virtual void CreateContentLayout(wxPanel *contentPanel)=0
Pure virtual: subclasses create their content layout in contentPanel.
EmberCore::ITreeNode * m_selectedNode
void ClearSelection()
Clears the current selection.
virtual ~PropertiesTabBase()=default
void SetSelectionHighlightColor(const wxColour &color)
Sets the highlight color for the selected node.
virtual wxString GetPlaceholderText() const
Returns placeholder text when no node is selected.
wxWindow * GetWidget() override
Returns the wxWidgets window used as the tab content.
wxString GetTitle() const override
Returns the display title of the tab.
static const wxColour kCaptionBgColor
void AddBasicNodeInfo()
Adds basic node info (name, type) to the property grid.
virtual void OnNodeCleared()
Called when selection is cleared; subclasses may override.
Interface for tab-based UI components in the application.
Definition ITab.h:7
Definition Panel.h:8