TDME2 1.9.121
BasePropertiesSubController.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <map>
5#include <string>
6#include <vector>
7
8#include <tdme/tdme.h>
18
19using std::array;
20using std::map;
21using std::string;
22using std::vector;
23
34
35/**
36 * Prototype base sub screen controller
37 * @author Andreas Drewke
38 * @version $Id$
39 */
41{
42private:
43 EditorView* editorView { nullptr };
45 PopUps* popUps { nullptr };
47 string rootNodeId;
48
49 array<string, 1> applyPropertyNodes = {
50 "property_value"
51 };
52
53 array<string, 2> applyBaseNodes = {
54 "prototype_name",
55 "prototype_description"
56 };
57
59
60public:
61 /**
62 * Public constructor
63 * @param editorView editor view
64 * @param rootNode root node
65 */
66 BasePropertiesSubController(EditorView* editorView, const string& rootNode);
67
68 /**
69 * Destructor
70 */
72
73 /**
74 * Init
75 * @param screenNode screen node
76 */
78
79 /**
80 * Create base properties XML for outliner
81 * @param baseProperties base properties
82 * @param xml xml
83 */
84 void createBasePropertiesXML(BaseProperties* baseProperties, string& xml);
85
86 /**
87 * Set property base details
88 * @param prototype prototype
89 */
90 void setBasePropertiesDetails(BaseProperties* baseProperties);
91
92 /**
93 * Apply property base details
94 * @param prototype prototype
95 */
96 void applyPropertyDetails(BaseProperties* baseProperties);
97
98 /**
99 * Set property details
100 * @param prototype prototype
101 * @param propertyName property name
102 */
103 void setPropertyDetails(BaseProperties* baseProperties, const string& propertyName);
104
105 /**
106 * Update details panel
107 * @param prototype prototype
108 * @param outlinerNode outliner node
109 */
110 void updateDetails(BaseProperties* baseProperties, const string& outlinerNode);
111
112 /**
113 * Apply property details
114 * @param prototype prototype
115 * @param propertyName property name
116 */
117 void applyPropertyDetails(BaseProperties* baseProperties, const string& propertyName);
118
119 /**
120 * Create property
121 * @param prototype prototype
122 */
123 void createProperty(BaseProperties* baseProperties);
124
125 /**
126 * Start rename property
127 * @param property property
128 * @param propertyName property name
129 */
130 void startRenameProperty(BaseProperties* baseProperties, const string& propertyName);
131
132 /**
133 * Rename property
134 * @param prototype prototype
135 */
136 void renameProperty(BaseProperties* baseProperties);
137
138 /**
139 * On value changed
140 * @param node node
141 * @param prototype prototype
142 */
143 void onValueChanged(GUIElementNode* node, BaseProperties* baseProperties);
144
145 /**
146 * On action performed
147 * @param type type
148 * @param node node
149 * @param prototype prototype
150 */
151 void onActionPerformed(GUIActionListenerType type, GUIElementNode* node, BaseProperties* baseProperties);
152
153 /**
154 * On focus
155 * @param node node
156 * @param prototype prototype
157 */
158 void onFocus(GUIElementNode* node, BaseProperties* baseProperties);
159
160 /**
161 * On unfocus
162 * @param node node
163 * @param prototype prototype
164 */
165 void onUnfocus(GUIElementNode* node, BaseProperties* baseProperties);
166
167 /**
168 * On context menu requested
169 * @param node node
170 * @param mouseX unscaled mouse X position
171 * @param mouseY unscaled mouse Y position
172 * @param prototype prototype
173 */
174 void onContextMenuRequested(GUIElementNode* node, int mouseX, int mouseY, BaseProperties* baseProperties);
175
176 /**
177 * Apply property value
178 * @param prototype prototype
179 */
180 void applyPropertyValue(BaseProperties* baseProperties);
181
182 /**
183 * Shows the error pop up
184 * @param caption caption
185 * @param message message
186 */
187 void showErrorPopUp(const string& caption, const string& message);
188
189};
Base property model class.
Definition: BaseProperty.h:16
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:57
Pop ups controller accessor class.
Definition: PopUps.h:19
void onValueChanged(GUIElementNode *node, BaseProperties *baseProperties)
On value changed.
void onFocus(GUIElementNode *node, BaseProperties *baseProperties)
On focus.
void applyPropertyDetails(BaseProperties *baseProperties)
Apply property base details.
void onUnfocus(GUIElementNode *node, BaseProperties *baseProperties)
On unfocus.
void setBasePropertiesDetails(BaseProperties *baseProperties)
Set property base details.
void updateDetails(BaseProperties *baseProperties, const string &outlinerNode)
Update details panel.
void setPropertyDetails(BaseProperties *baseProperties, const string &propertyName)
Set property details.
void showErrorPopUp(const string &caption, const string &message)
Shows the error pop up.
void onActionPerformed(GUIActionListenerType type, GUIElementNode *node, BaseProperties *baseProperties)
On action performed.
void onContextMenuRequested(GUIElementNode *node, int mouseX, int mouseY, BaseProperties *baseProperties)
On context menu requested.
void createBasePropertiesXML(BaseProperties *baseProperties, string &xml)
Create base properties XML for outliner.
BasePropertiesSubController(EditorView *editorView, const string &rootNode)
Public constructor.
void startRenameProperty(BaseProperties *baseProperties, const string &propertyName)
Start rename property.
Mutable string class.
Definition: MutableString.h:16
Action Interface.
Definition: Action.h:12