TDME2 1.9.121
GUITabsHeaderController.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include <tdme/tdme.h>
11
12using std::vector;
13
20
21/**
22 * GUI tabs header controller
23 * @author Andreas Drewke
24 * @version $Id$
25 */
28{
29 friend class GUITabsHeader;
30 friend class GUITabController;
31
32private:
33 GUINode* tabsNode { nullptr };
34 vector<GUITabController*> tabControllers;
35 int tabControllerIdx { -1 };
36 bool focus;
38
39 /**
40 * Private constructor
41 * @param node node
42 */
44
45 /**
46 * @return has focus
47 */
48 bool hasFocus();
49
50 /**
51 * Determine select box option controllers
52 */
54
55 /**
56 * Select next node
57 */
58 void selectNext();
59
60 /**
61 * Select previous
62 */
63 void selectPrevious();
64
65 /**
66 * Select current
67 */
68 void selectCurrent();
69
70public:
71 /**
72 * Unselect selected tab
73 */
74 void unselect();
75
76 /**
77 * Select selected tab
78 */
79 void select();
80
81 /**
82 * Select tab by index
83 * @param idx index
84 */
85 void select(int idx);
86
87 /**
88 * Select tab by index
89 * @param tabElementNode tab element node
90 */
91 void select(GUIElementNode* tabElementNode);
92
93 // overridden methods
94 bool isDisabled() override;
95 void setDisabled(bool disabled) override;
96 void initialize() override;
97 void dispose() override;
98 void postLayout() override;
99 void handleMouseEvent(GUINode* node, GUIMouseEvent* event) override;
100 void handleKeyboardEvent(GUIKeyboardEvent* event) override;
101 void tick() override;
102 void onFocusGained() override;
103 void onFocusLost() override;
104 bool hasValue() override;
105 const MutableString& getValue() override;
106 void setValue(const MutableString& value) override;
107 void onSubTreeChange() override;
108
109};
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.
GUITabsHeaderController(GUINode *node)
Private constructor.
void tick() override
Tick method will be executed once per frame.
void setDisabled(bool disabled) override
Set disabled.
void determineTabControllers()
Determine select box option controllers.
void onSubTreeChange() override
On sub tree change.
GUI tabs header element.
Definition: GUITabsHeader.h:28
GUI node base class.
Definition: GUINode.h:63
Mutable string class.
Definition: MutableString.h:16