TDME2
1.9.121
src
tdme
gui
elements
GUITabsHeaderController.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <vector>
4
5
#include <
tdme/tdme.h
>
6
#include <
tdme/gui/elements/fwd-tdme.h
>
7
#include <
tdme/gui/events/fwd-tdme.h
>
8
#include <
tdme/gui/nodes/fwd-tdme.h
>
9
#include <
tdme/gui/nodes/GUIElementController.h
>
10
#include <
tdme/utilities/MutableString.h
>
11
12
using
std::vector;
13
14
using
tdme::gui::events::GUIKeyboardEvent
;
15
using
tdme::gui::events::GUIMouseEvent
;
16
using
tdme::gui::nodes::GUIElementController
;
17
using
tdme::gui::nodes::GUIElementNode
;
18
using
tdme::gui::nodes::GUINode
;
19
using
tdme::utilities::MutableString
;
20
21
/**
22
* GUI tabs header controller
23
* @author Andreas Drewke
24
* @version $Id$
25
*/
26
class
tdme::gui::elements::GUITabsHeaderController
final
27
:
public
GUIElementController
28
{
29
friend
class
GUITabsHeader
;
30
friend
class
GUITabController
;
31
32
private
:
33
GUINode
*
tabsNode
{
nullptr
};
34
vector<GUITabController*>
tabControllers
;
35
int
tabControllerIdx
{ -1 };
36
bool
focus
;
37
MutableString
value
;
38
39
/**
40
* Private constructor
41
* @param node node
42
*/
43
GUITabsHeaderController
(
GUINode
*
node
);
44
45
/**
46
* @return has focus
47
*/
48
bool
hasFocus
();
49
50
/**
51
* Determine select box option controllers
52
*/
53
void
determineTabControllers
();
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
70
public
:
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
};
GUIElementController.h
MutableString.h
tdme::gui::elements::GUITabController
GUI tab controller.
Definition:
GUITabController.h:29
tdme::gui::elements::GUITabsHeaderController
GUI tabs header controller.
Definition:
GUITabsHeaderController.h:28
tdme::gui::elements::GUITabsHeaderController::selectCurrent
void selectCurrent()
Select current.
Definition:
GUITabsHeaderController.cpp:145
tdme::gui::elements::GUITabsHeaderController::onFocusGained
void onFocusGained() override
On focus gained.
Definition:
GUITabsHeaderController.cpp:195
tdme::gui::elements::GUITabsHeaderController::dispose
void dispose() override
Dispose controller.
Definition:
GUITabsHeaderController.cpp:55
tdme::gui::elements::GUITabsHeaderController::postLayout
void postLayout() override
Post layout event.
Definition:
GUITabsHeaderController.cpp:60
tdme::gui::elements::GUITabsHeaderController::initialize
void initialize() override
Initialize controller after element has been created.
Definition:
GUITabsHeaderController.cpp:43
tdme::gui::elements::GUITabsHeaderController::handleKeyboardEvent
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
Definition:
GUITabsHeaderController.cpp:169
tdme::gui::elements::GUITabsHeaderController::selectNext
void selectNext()
Select next node.
Definition:
GUITabsHeaderController.cpp:117
tdme::gui::elements::GUITabsHeaderController::onFocusLost
void onFocusLost() override
On focus lost.
Definition:
GUITabsHeaderController.cpp:201
tdme::gui::elements::GUITabsHeaderController::setValue
void setValue(const MutableString &value) override
Set value.
Definition:
GUITabsHeaderController.cpp:217
tdme::gui::elements::GUITabsHeaderController::handleMouseEvent
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
Definition:
GUITabsHeaderController.cpp:158
tdme::gui::elements::GUITabsHeaderController::GUITabsHeaderController
GUITabsHeaderController(GUINode *node)
Private constructor.
Definition:
GUITabsHeaderController.cpp:28
tdme::gui::elements::GUITabsHeaderController::tick
void tick() override
Tick method will be executed once per frame.
Definition:
GUITabsHeaderController.cpp:190
tdme::gui::elements::GUITabsHeaderController::unselect
void unselect()
Unselect selected tab.
Definition:
GUITabsHeaderController.cpp:69
tdme::gui::elements::GUITabsHeaderController::tabsNode
GUINode * tabsNode
Definition:
GUITabsHeaderController.h:33
tdme::gui::elements::GUITabsHeaderController::tabControllers
vector< GUITabController * > tabControllers
Definition:
GUITabsHeaderController.h:34
tdme::gui::elements::GUITabsHeaderController::setDisabled
void setDisabled(bool disabled) override
Set disabled.
Definition:
GUITabsHeaderController.cpp:39
tdme::gui::elements::GUITabsHeaderController::value
MutableString value
Definition:
GUITabsHeaderController.h:37
tdme::gui::elements::GUITabsHeaderController::getValue
const MutableString & getValue() override
Definition:
GUITabsHeaderController.cpp:212
tdme::gui::elements::GUITabsHeaderController::determineTabControllers
void determineTabControllers()
Determine select box option controllers.
Definition:
GUITabsHeaderController.cpp:100
tdme::gui::elements::GUITabsHeaderController::focus
bool focus
Definition:
GUITabsHeaderController.h:36
tdme::gui::elements::GUITabsHeaderController::isDisabled
bool isDisabled() override
Definition:
GUITabsHeaderController.cpp:34
tdme::gui::elements::GUITabsHeaderController::onSubTreeChange
void onSubTreeChange() override
On sub tree change.
Definition:
GUITabsHeaderController.cpp:221
tdme::gui::elements::GUITabsHeaderController::hasFocus
bool hasFocus()
Definition:
GUITabsHeaderController.cpp:64
tdme::gui::elements::GUITabsHeaderController::hasValue
bool hasValue() override
Definition:
GUITabsHeaderController.cpp:207
tdme::gui::elements::GUITabsHeaderController::select
void select()
Select selected tab.
Definition:
GUITabsHeaderController.cpp:75
tdme::gui::elements::GUITabsHeaderController::tabControllerIdx
int tabControllerIdx
Definition:
GUITabsHeaderController.h:35
tdme::gui::elements::GUITabsHeaderController::selectPrevious
void selectPrevious()
Select previous.
Definition:
GUITabsHeaderController.cpp:131
tdme::gui::elements::GUITabsHeader
GUI tabs header element.
Definition:
GUITabsHeader.h:28
tdme::gui::events::GUIKeyboardEvent
GUI keyboard event.
Definition:
GUIKeyboardEvent.h:13
tdme::gui::events::GUIMouseEvent
GUI mouse event.
Definition:
GUIMouseEvent.h:13
tdme::gui::nodes::GUIElementController
GUI element controller.
Definition:
GUIElementController.h:26
tdme::gui::nodes::GUIElementController::disabled
bool disabled
Definition:
GUIElementController.h:32
tdme::gui::nodes::GUIElementNode
GUI element node.
Definition:
GUIElementNode.h:38
tdme::gui::nodes::GUINodeController::node
GUINode * node
Definition:
GUINodeController.h:21
tdme::gui::nodes::GUINode
GUI node base class.
Definition:
GUINode.h:63
tdme::utilities::MutableString
Mutable string class.
Definition:
MutableString.h:16
fwd-tdme.h
fwd-tdme.h
fwd-tdme.h
tdme.h
Generated by
1.9.3