/
iusercontrol.h
80 lines (63 loc) · 3.3 KB
/
iusercontrol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#pragma once
#include <memory>
#include <string>
class wxWindow;
namespace ui
{
/**
* User control interface, to be implemented by all widgets that
* can be packed into DarkRadiant's main frame or group dialog tabs.
*/
class IUserControl
{
public:
virtual ~IUserControl() {}
using Ptr = std::shared_ptr<IUserControl>;
// Returns the name of this control. This is an identifier corresponding to the
// UserControl enumeration, like UserControl::Camera, or a plugin-defined identifier
// Whitespace and other non-alphanumeric characters are not allowed
virtual std::string getControlName() = 0;
// A visible, localised identifier used for tab captions and window titles
virtual std::string getDisplayName() = 0;
// Optional icon file name to use for tab captions, e.g. "icon_texture.png"
virtual std::string getIcon() { return {}; }
// Creates a new wxWidget window for packing into a dialog or sizer
// Widget ownership is transferred to the caller, IUserControl implementations
// will not delete the returned window
virtual wxWindow* createWidget(wxWindow* parent) = 0;
};
// The command used to toggle a control: bring it to front if hidden, or hide it if it's a visible floating window
constexpr const char* const TOGGLE_CONTROL_COMMAND = "ToggleControl";
// The command used to make a control the main control (replacing the resident ortho view)
constexpr const char* const TOGGLE_MAIN_CONTROL_COMMAND = "ToggleMainControl";
// The command name used to focus a control, brings it to front, creating it if necessary
constexpr const char* const FOCUS_CONTROL_COMMAND = "FocusControl";
// The command name used to create a new instance of a control
constexpr const char* const CREATE_CONTROL_COMMAND = "CreateControl";
// Prefix used to construct statements like "ToggleLightInspector"
constexpr const char* const TOGGLE_CONTROL_STATEMENT_PREFIX = "Toggle";
// Prefix for statements making a certain control the main control
constexpr const char* const TOGGLE_MAIN_CONTROL_STATEMENT_PREFIX = "ToggleMainControl_";
// Predefined known user control names
struct UserControl
{
constexpr static const char* Camera = "Camera";
constexpr static const char* Console = "Console";
constexpr static const char* FavouritesBrowser = "FavouritesBrowser";
constexpr static const char* EntityInspector = "EntityInspector";
constexpr static const char* EntityList = "EntityList";
constexpr static const char* MediaBrowser = "MediaBrowser";
constexpr static const char* OrthoView = "OrthoView";
constexpr static const char* TextureBrowser = "TextureBrowser";
constexpr static const char* SurfaceInspector = "SurfaceInspector";
constexpr static const char* PatchInspector = "PatchInspector";
constexpr static const char* FindAndReplaceMaterial = "FindAndReplaceMaterial";
constexpr static const char* LightInspector = "LightInspector";
constexpr static const char* LayerControlPanel = "LayerControlPanel";
constexpr static const char* TextureTool = "TextureTool";
constexpr static const char* TransformPanel = "TransformPanel";
constexpr static const char* MapMergePanel = "MapMergePanel";
constexpr static const char* AasVisualisationPanel = "AasVisualisationPanel";
constexpr static const char* OrthoBackgroundPanel = "OrthoBackgroundPanel";
};
}