TDME2 1.9.121
GUITabsController.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include <tdme/tdme.h>
12
13using std::string;
14using std::vector;
15
23
24/**
25 * GUI tabs controller
26 * @author Andreas Drewke
27 * @version $Id$
28 */
30 : public GUINodeController
31{
32 friend class GUITabs;
33 friend class GUITabController;
35
36private:
37 vector<GUITabController*> tabControllers;
38 vector<GUITabContentController*> tabContentControllers;
41 bool tabSelected { false };
42
43 /**
44 * Private constructor
45 * @param node node
46 */
48
49 /**
50 * Determine tab controllers
51 */
53
54 /**
55 * Unselect
56 */
57 void unselect();
58
59 /**
60 * Select
61 * @param tabElementNode tab element node
62 */
63 void select(GUIElementNode* tabElementNode);
64
65 /**
66 * Set tab content selected
67 * @param id id
68 */
69 void setTabContentSelected(const string& id);
70
71 /**
72 * Set tab content selected internal
73 * @param id id
74 */
75 void setTabContentSelectedInternal(const string& id);
76
77public:
78 // overridden methods
79 bool isDisabled() override;
80 void setDisabled(bool disabled) override;
81 void initialize() override;
82 void dispose() override;
83 void postLayout() override;
84 void handleMouseEvent(GUINode* node, GUIMouseEvent* event) override;
85 void handleKeyboardEvent(GUIKeyboardEvent* event) override;
86 void tick() override;
87 void onFocusGained() override;
88 void onFocusLost() override;
89 bool hasValue() override;
90 const MutableString& getValue() override;
91 void setValue(const MutableString& value) override;
92 void onSubTreeChange() override;
93
94};
void setTabContentSelected(const string &id)
Set tab content selected.
void determineTabContentControllers()
Determine tab controllers.
void onFocusGained() override
On focus gained.
void dispose() override
Dispose controller.
void postLayout() override
Post layout event.
void initialize() override
Initialize controller after element has been created.
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
void setTabContentSelectedInternal(const string &id)
Set tab content selected internal.
void onFocusLost() override
On focus lost.
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.
GUITabsHeaderController * tabsHeaderController
GUITabsController(GUINode *node)
Private constructor.
vector< GUITabController * > tabControllers
vector< GUITabContentController * > tabContentControllers
void setDisabled(bool disabled) override
Set disabled.
const MutableString & getValue() override
void onSubTreeChange() override
On sub tree change.
void select(GUIElementNode *tabElementNode)
Select.
GUI tabs element.
Definition: GUITabs.h:28
GUI node controller base class.
GUI node base class.
Definition: GUINode.h:63
Mutable string class.
Definition: MutableString.h:16