TDME2 1.9.121
GUITabContentController.cpp
Go to the documentation of this file.
2
3#include <tdme/tdme.h>
8#include <tdme/gui/GUI.h>
9
15using tdme::gui::GUI;
16
17GUITabContentController::GUITabContentController(GUINode* node)
18 : GUINodeController(node)
19{
20 this->selected = false;
21 CONDITION_SELECTED = node->getId() + "-selected";
22 CONDITION_UNSELECTED = node->getId() + "-unselected";
23}
24
26{
27 return false;
28}
29
31{
32}
33
35{
36 return selected;
37}
38
40{
41 auto& nodeConditions = parentElementNode->getActiveConditions();
42 nodeConditions.remove(this->selected == true?CONDITION_SELECTED:CONDITION_UNSELECTED);
43 this->selected = selected;
44 nodeConditions.add(this->selected == true ?CONDITION_SELECTED:CONDITION_UNSELECTED);
45}
46
48{
49 auto _parentElementNode = this->node->getParentNode();
50 while (dynamic_cast<GUIElementNode*>(_parentElementNode) == nullptr) _parentElementNode = _parentElementNode->getParentNode();
51 parentElementNode = required_dynamic_cast<GUIElementNode*>(_parentElementNode);
52}
53
55{
56}
57
59{
60}
61
63{
64}
65
67{
68}
69
71{
72}
73
75{
76}
77
79{
80}
81
83{
84 return false;
85}
86
88{
89 return value;
90}
91
93{
94}
95
97{
98}
GUI module class.
Definition: GUI.h:66
void initialize() override
Initialize controller after element has been created.
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
void setValue(const MutableString &value) override
Set value.
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
void tick() override
Tick method will be executed once per frame.
void setDisabled(bool disabled) override
Set disabled.
void onSubTreeChange() override
On sub tree change.
GUINodeConditions & getActiveConditions()
GUI element node conditions.
bool remove(const string &condition)
Remove a condition.
GUI node controller base class.
GUI node base class.
Definition: GUINode.h:63
const string & getId()
Definition: GUINode.h:329
GUIParentNode * getParentNode()
Definition: GUINode.h:322
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:43
Mutable string class.
Definition: MutableString.h:16