TDME2  1.9.200
SelectorDialogScreenController.cpp
Go to the documentation of this file.
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
7 #include <tdme/engine/Engine.h>
8 #include <tdme/engine/Version.h>
16 #include <tdme/gui/GUI.h>
17 #include <tdme/gui/GUIParser.h>
20 #include <tdme/utilities/Console.h>
24 
25 using std::string;
26 
39 using tdme::gui::GUI;
47 
48 SelectorDialogScreenController::SelectorDialogScreenController(PopUps* popUps): popUps(popUps)
49 {
50 }
51 
53 {
54  screenNode = nullptr;
55 }
56 
58 {
59  return screenNode;
60 }
61 
63 {
64  try {
65  screenNode = GUIParser::parse("resources/engine/gui", "popup_selector.xml");
66  screenNode->setEnabled(false);
70  } catch (Exception& exception) {
71  Console::println("SelectorDialogScreenController::initialize(): An error occurred: " + string(exception.what()));
72  }
73 }
74 
76 {
77 }
78 
80 {
81  screenNode->setEnabled(true);
82 }
83 
85 {
86  screenNode->setEnabled(false);
87 }
88 
90 {
92  if (StringTools::startsWith(node->getId(), "tab_selector_close_") == true) { // TODO: a.drewke, check with DH) {
93  close();
94  }
95  }
96 }
97 
99  GUI::setDisableTabFocusControl(node->getScreenNode() != screenNode);
100 }
101 
103 }
104 
106  popUps->getTooltipScreenController()->show(mouseX, mouseY, node->getToolTip());
107 }
108 
111 }
Application base class, please make sure to allocate application on heap to have correct application ...
Definition: Application.h:41
Engine main class.
Definition: Engine.h:131
GUI parser.
Definition: GUIParser.h:40
GUI module class.
Definition: GUI.h:64
GUI node base class.
Definition: GUINode.h:64
const string & getToolTip()
Definition: GUINode.h:346
GUIScreenNode * getScreenNode()
Definition: GUINode.h:325
const string & getId()
Definition: GUINode.h:339
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
void setEnabled(bool enabled)
Set enabled.
void addTooltipRequestListener(GUITooltipRequestListener *listener)
Add tooltip request listener.
void addActionListener(GUIActionListener *listener)
Add action listener.
void invalidateLayouts()
Actually do the nodes marked for layout invalidation.
void onAction(GUIActionListenerType type, GUIElementNode *node) override
void onTooltipShowRequest(GUINode *node, int mouseX, int mouseY) override
On tooltip show request.
void show(int mouseX, int mouseY, const string &tooltip)
Show tooltip.
Pop ups controller accessor class.
Definition: PopUps.h:29
TooltipScreenController * getTooltipScreenController()
Definition: PopUps.h:131
Console class.
Definition: Console.h:29
Mutable utf8 aware string class.
Definition: MutableString.h:23
String tools class.
Definition: StringTools.h:22
std::exception Exception
Exception base class.
Definition: Exception.h:18
GUI action listener interface.
GUI focus listener interface.