TDME2  1.9.200
UIEditorTabController.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
17 
18 #include <ext/tinyxml/tinyxml.h>
19 
20 using std::string;
21 
37 
41 
42 /**
43  * UI editor tab controller
44  * @author Andreas Drewke
45  */
47  : public TabController
48 {
49 
50 private:
51  UIEditorTabView* view { nullptr };
52  GUIScreenNode* screenNode { nullptr };
53  PopUps* popUps { nullptr };
57 
58  bool firstSearch { true };
59  int searchIndex { -1 };
60 
61 public:
62  // forbid class copy
64 
65  /**
66  * Public constructor
67  * @param view view
68  */
70 
71  /**
72  * Destructor
73  */
74  virtual ~UIEditorTabController();
75 
76  /**
77  * Get view
78  * @return view
79  */
81  return view;
82  }
83 
84  // overridden method
85  inline GUIScreenNode* getScreenNode() override {
86  return screenNode;
87  }
88 
89  // overridden methods
90  void initialize(GUIScreenNode* screenNode) override;
91  void dispose() override;
92  void onChange(GUIElementNode* node) override;
93  void onAction(GUIActionListenerType type, GUIElementNode* node) override;
94  void onFocus(GUIElementNode* node) override;
95  void onUnfocus(GUIElementNode* node) override;
96  void onContextMenuRequest(GUIElementNode* node, int mouseX, int mouseY) override;
97  void onTooltipShowRequest(GUINode* node, int mouseX, int mouseY) override;
98  void onTooltipCloseRequest() override;
99  void onCommand(TabControllerCommand command) override;
100  void onDrop(const string& payload, int mouseX, int mouseY) override;
101 
102  /**
103  * Create outliner GUI parent node nodes xml
104  * @param xmlParentNode XML parent node
105  * @param xml xml
106  * @param screenIdx screen index
107  * @param nodeIdx node index
108  */
109  void createOutlinerParentNodeNodesXML(TiXmlElement* xmlParentNode, string& xml, int screenIdx, int& nodeIdx);
110 
111  /**
112  * Set outliner content
113  */
114  void setOutlinerContent();
115 
116  /**
117  * Set outliner add drop down content
118  */
120 
121  /**
122  * Update details panel
123  * @param outlinerNode outliner node
124  */
125  void updateDetails(const string& outlinerNode);
126 
127  /**
128  * Update screen details
129  */
130  void updateScreenDetails();
131 
132  /**
133  * Update screens details
134  */
135  void updateScreensDetails();
136 
137  /**
138  * On load screen
139  */
140  void onLoadScreen();
141 
142  /**
143  * On remove screen
144  */
145  void onUnsetScreen();
146 
147  /**
148  * On browse to screen
149  */
150  void onBrowseToScreen();
151 
152  /**
153  * Reload screens
154  */
155  void reloadScreens();
156 
157  /**
158  * On load prototype
159  */
160  void onLoadPrototype();
161 
162  /**
163  * On load prototype
164  */
165  void onRemovePrototype();
166 
167  /**
168  * On browse to prototype
169  */
170  void onBrowseToPrototype();
171 
172  /**
173  * Set screen
174  * @param screenIdx screen index
175  * @param fileName file name
176  */
177  void setScreen(int screenIdx, const string& fileName);
178 
179  /**
180  * Set prototype
181  * @param pathName path name
182  * @param fileName file name
183  * @param modelMeshNode model mesh node
184  * @param modelMeshAnimation model mesh animation
185  */
186  void setPrototype(const string& pathName, const string& fileName, const string& modelMeshNode, const string& modelMeshAnimation);
187 
188  /**
189  * Close find/replace window
190  */
191  void closeFindReplaceWindow();
192 
193  /**
194  * Save
195  */
196  void save();
197 
198  /**
199  * Save as
200  */
201  void saveAs();
202 
203  /**
204  * Show the information pop up / modal
205  * @param caption caption
206  * @param message message
207  */
208  void showInfoPopUp(const string& caption, const string& message);
209 
210 };
GUI node base class.
Definition: GUINode.h:64
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:42
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
Pop ups controller accessor class.
Definition: PopUps.h:29
void onContextMenuRequest(GUIElementNode *node, int mouseX, int mouseY) override
On context menu request.
void onDrop(const string &payload, int mouseX, int mouseY) override
On drop.
void setOutlinerAddDropDownContent()
Set outliner add drop down content.
void onChange(GUIElementNode *node) override
On change.
void setScreen(int screenIdx, const string &fileName)
Set screen.
UIEditorTabController(UIEditorTabView *view)
Public constructor.
void setPrototype(const string &pathName, const string &fileName, const string &modelMeshNode, const string &modelMeshAnimation)
Set prototype.
void onCommand(TabControllerCommand command) override
On command.
void onUnfocus(GUIElementNode *node) override
On unfocus.
void onTooltipCloseRequest() override
On tooltip close request.
void updateDetails(const string &outlinerNode)
Update details panel.
void onFocus(GUIElementNode *node) override
On focus.
void initialize(GUIScreenNode *screenNode) override
Init.
void createOutlinerParentNodeNodesXML(TiXmlElement *xmlParentNode, string &xml, int screenIdx, int &nodeIdx)
Create outliner GUI parent node nodes xml.
void showInfoPopUp(const string &caption, const string &message)
Show the information pop up / modal.
void onAction(GUIActionListenerType type, GUIElementNode *node) override
void onTooltipShowRequest(GUINode *node, int mouseX, int mouseY) override
On tooltip show request.
Mutable utf8 aware string class.
Definition: MutableString.h:23
An attribute is a name-value pair.
Definition: tinyxml.h:734
Always the top level node.
Definition: tinyxml.h:1317
The element is a container class.
Definition: tinyxml.h:886
GUI action listener interface.
GUI change listener interface.
GUI focus listener interface.
Tab controller, which connects UI with logic.
Definition: TabController.h:34
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6