yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
editor_panel.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SYSTEM_EDITOR_PANEL_H_
2#define YAZE_APP_EDITOR_SYSTEM_EDITOR_PANEL_H_
3
4#include <string>
5
6namespace yaze {
7namespace editor {
8
18enum class PanelCategory {
22};
23
60 public:
61 virtual ~EditorPanel() = default;
62
63 // ==========================================================================
64 // Identity (Required)
65 // ==========================================================================
66
76 virtual std::string GetId() const = 0;
77
82 virtual std::string GetDisplayName() const = 0;
83
88 virtual std::string GetIcon() const = 0;
89
94 virtual std::string GetEditorCategory() const = 0;
95
96 // ==========================================================================
97 // Drawing (Required)
98 // ==========================================================================
99
108 virtual void Draw(bool* p_open) = 0;
109
110 // ==========================================================================
111 // Lifecycle Hooks (Optional)
112 // ==========================================================================
113
120 virtual void OnOpen() {}
121
128 virtual void OnClose() {}
129
135 virtual void OnFocus() {}
136
137 // ==========================================================================
138 // Behavior (Optional)
139 // ==========================================================================
140
149 }
150
158 virtual bool IsEnabled() const { return true; }
159
164 virtual std::string GetDisabledTooltip() const { return ""; }
165
170 virtual std::string GetShortcutHint() const { return ""; }
171
176 virtual int GetPriority() const { return 50; }
177
185 virtual float GetPreferredWidth() const { return 0.0f; }
186
194 virtual bool IsVisibleByDefault() const { return false; }
195
196 // ==========================================================================
197 // Relationships (Optional)
198 // ==========================================================================
199
207 virtual std::string GetParentPanelId() const { return ""; }
208
215 virtual bool CascadeCloseChildren() const { return false; }
216};
217
218} // namespace editor
219} // namespace yaze
220
221#endif // YAZE_APP_EDITOR_SYSTEM_EDITOR_PANEL_H_
Base interface for all logical panel components.
virtual void OnClose()
Called when panel is hidden.
virtual std::string GetId() const =0
Unique identifier for this panel.
virtual bool CascadeCloseChildren() const
Whether closing this panel should close child panels.
virtual bool IsVisibleByDefault() const
Whether this panel should be visible by default.
virtual std::string GetIcon() const =0
Material Design icon for this panel.
virtual ~EditorPanel()=default
virtual float GetPreferredWidth() const
Get preferred width for this panel (optional)
virtual void OnFocus()
Called when panel receives focus.
virtual std::string GetDisabledTooltip() const
Get tooltip text when panel is disabled.
virtual int GetPriority() const
Get display priority for menu ordering.
virtual std::string GetShortcutHint() const
Get keyboard shortcut hint for display.
virtual std::string GetDisplayName() const =0
Human-readable name shown in menus and title bars.
virtual std::string GetParentPanelId() const
Get parent panel ID for cascade behavior.
virtual PanelCategory GetPanelCategory() const
Get the lifecycle category for this panel.
virtual void Draw(bool *p_open)=0
Draw the panel content.
virtual std::string GetEditorCategory() const =0
Editor category this panel belongs to.
virtual bool IsEnabled() const
Check if this panel is currently enabled.
virtual void OnOpen()
Called when panel becomes visible.
PanelCategory
Defines lifecycle behavior for editor panels.
@ Persistent
Always visible once shown.
@ EditorBound
Hidden when switching editors (default)
@ CrossEditor
User can pin to persist across editors.