TDME2
1.9.121
src
tdme
gui
elements
GUIMenuHeaderItemController.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
#include <vector>
5
6
#include <
tdme/tdme.h
>
7
#include <
tdme/gui/elements/fwd-tdme.h
>
8
#include <
tdme/gui/events/fwd-tdme.h
>
9
#include <
tdme/gui/nodes/fwd-tdme.h
>
10
#include <
tdme/gui/nodes/GUIElementController.h
>
11
#include <
tdme/utilities/MutableString.h
>
12
13
using
std::string;
14
using
std::vector;
15
16
using
tdme::gui::events::GUIKeyboardEvent
;
17
using
tdme::gui::events::GUIMouseEvent
;
18
using
tdme::gui::nodes::GUIElementController
;
19
using
tdme::gui::nodes::GUIElementNode
;
20
using
tdme::gui::nodes::GUINode
;
21
using
tdme::gui::nodes::GUINodeController
;
22
using
tdme::gui::nodes::GUIParentNode
;
23
using
tdme::utilities::MutableString
;
24
25
/**
26
* GUI menu header item controller
27
* @author Andreas Drewke
28
* @version $Id$
29
*/
30
class
tdme::gui::elements::GUIMenuHeaderItemController
final
31
:
public
GUIElementController
32
{
33
friend
class
GUIMenuHeaderController
;
34
friend
class
GUIMenuHeaderItem
;
35
friend
class
GUIMenuHeaderItemOptionController
;
36
friend
class
GUIMenuItemController
;
37
38
private
:
39
STATIC_DLL_IMPEXT
static
string
CONDITION_OPENED
;
40
STATIC_DLL_IMPEXT
static
string
CONDITION_CLOSED
;
41
STATIC_DLL_IMPEXT
static
string
CONDITION_SELECTED
;
42
STATIC_DLL_IMPEXT
static
string
CONDITION_UNSELECTED
;
43
GUIElementNode
*
menuHeaderNode
{
nullptr
};
44
vector<GUIMenuItemController*>
menuItemControllers
;
45
bool
open
;
46
bool
selected
;
47
MutableString
value
;
48
int
selectedMenuItemControllerIdx
{ -1 };
49
50
private
:
51
/**
52
* Private constructor
53
* @param node node
54
*/
55
GUIMenuHeaderItemController
(
GUINode
*
node
);
56
57
/**
58
* @return menu open state
59
*/
60
bool
isOpen
();
61
62
/**
63
* @return is selected
64
*/
65
bool
isSelected
();
66
67
/**
68
* Select
69
*/
70
void
select
();
71
72
/**
73
* Unselect
74
*/
75
void
unselect
();
76
77
/**
78
* Toggle open state
79
*/
80
void
toggleOpenState
();
81
82
/**
83
* Determine menu item controllers
84
*/
85
void
determineMenuItemControllers
();
86
87
/**
88
* Unselect selection
89
*/
90
void
unselectSelection
();
91
92
/**
93
* Select first menu item
94
*/
95
void
selectFirst
();
96
97
/**
98
* Select next menu item
99
*/
100
void
selectNext
();
101
102
/**
103
* Select previous menu item
104
*/
105
void
selectPrevious
();
106
107
/**
108
* Handle current menu item keyboard event
109
* @param event event
110
*/
111
void
handleCurrentMenuItemKeyboardEvent
(
GUIKeyboardEvent
* event);
112
113
public
:
114
// overridden methods
115
void
initialize
()
override
;
116
void
dispose
()
override
;
117
void
postLayout
()
override
;
118
void
handleMouseEvent
(
GUINode
*
node
,
GUIMouseEvent
* event)
override
;
119
void
handleKeyboardEvent
(
GUIKeyboardEvent
* event)
override
;
120
void
tick
()
override
;
121
void
onFocusGained
()
override
;
122
void
onFocusLost
()
override
;
123
bool
hasValue
()
override
;
124
const
MutableString
&
getValue
()
override
;
125
void
setValue
(
const
MutableString
&
value
)
override
;
126
void
onSubTreeChange
()
override
;
127
128
};
GUIElementController.h
MutableString.h
tdme::gui::elements::GUIMenuHeaderController
GUI menu header controller.
Definition:
GUIMenuHeaderController.h:28
tdme::gui::elements::GUIMenuHeaderItemController
GUI menu header item controller.
Definition:
GUIMenuHeaderItemController.h:32
tdme::gui::elements::GUIMenuHeaderItemController::GUIMenuHeaderItemController
GUIMenuHeaderItemController(GUINode *node)
Private constructor.
Definition:
GUIMenuHeaderItemController.cpp:48
tdme::gui::elements::GUIMenuHeaderItemController::menuHeaderNode
GUIElementNode * menuHeaderNode
Definition:
GUIMenuHeaderItemController.h:43
tdme::gui::elements::GUIMenuHeaderItemController::onFocusGained
void onFocusGained() override
On focus gained.
Definition:
GUIMenuHeaderItemController.cpp:253
tdme::gui::elements::GUIMenuHeaderItemController::dispose
void dispose() override
Dispose controller.
Definition:
GUIMenuHeaderItemController.cpp:96
tdme::gui::elements::GUIMenuHeaderItemController::CONDITION_CLOSED
static STATIC_DLL_IMPEXT string CONDITION_CLOSED
Definition:
GUIMenuHeaderItemController.h:40
tdme::gui::elements::GUIMenuHeaderItemController::postLayout
void postLayout() override
Post layout event.
Definition:
GUIMenuHeaderItemController.cpp:101
tdme::gui::elements::GUIMenuHeaderItemController::initialize
void initialize() override
Initialize controller after element has been created.
Definition:
GUIMenuHeaderItemController.cpp:76
tdme::gui::elements::GUIMenuHeaderItemController::isOpen
bool isOpen()
Definition:
GUIMenuHeaderItemController.cpp:105
tdme::gui::elements::GUIMenuHeaderItemController::handleKeyboardEvent
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
Definition:
GUIMenuHeaderItemController.cpp:242
tdme::gui::elements::GUIMenuHeaderItemController::selectedMenuItemControllerIdx
int selectedMenuItemControllerIdx
Definition:
GUIMenuHeaderItemController.h:48
tdme::gui::elements::GUIMenuHeaderItemController::handleCurrentMenuItemKeyboardEvent
void handleCurrentMenuItemKeyboardEvent(GUIKeyboardEvent *event)
Handle current menu item keyboard event.
Definition:
GUIMenuHeaderItemController.cpp:192
tdme::gui::elements::GUIMenuHeaderItemController::menuItemControllers
vector< GUIMenuItemController * > menuItemControllers
Definition:
GUIMenuHeaderItemController.h:44
tdme::gui::elements::GUIMenuHeaderItemController::toggleOpenState
void toggleOpenState()
Toggle open state.
Definition:
GUIMenuHeaderItemController.cpp:110
tdme::gui::elements::GUIMenuHeaderItemController::determineMenuItemControllers
void determineMenuItemControllers()
Determine menu item controllers.
Definition:
GUIMenuHeaderItemController.cpp:118
tdme::gui::elements::GUIMenuHeaderItemController::selectNext
void selectNext()
Select next menu item.
Definition:
GUIMenuHeaderItemController.cpp:148
tdme::gui::elements::GUIMenuHeaderItemController::isSelected
bool isSelected()
Definition:
GUIMenuHeaderItemController.cpp:55
tdme::gui::elements::GUIMenuHeaderItemController::onFocusLost
void onFocusLost() override
On focus lost.
Definition:
GUIMenuHeaderItemController.cpp:257
tdme::gui::elements::GUIMenuHeaderItemController::setValue
void setValue(const MutableString &value) override
Set value.
Definition:
GUIMenuHeaderItemController.cpp:272
tdme::gui::elements::GUIMenuHeaderItemController::handleMouseEvent
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
Definition:
GUIMenuHeaderItemController.cpp:199
tdme::gui::elements::GUIMenuHeaderItemController::selectFirst
void selectFirst()
Select first menu item.
Definition:
GUIMenuHeaderItemController.cpp:140
tdme::gui::elements::GUIMenuHeaderItemController::GUIMenuHeaderItemOptionController
friend class GUIMenuHeaderItemOptionController
Definition:
GUIMenuHeaderItemController.h:35
tdme::gui::elements::GUIMenuHeaderItemController::tick
void tick() override
Tick method will be executed once per frame.
Definition:
GUIMenuHeaderItemController.cpp:247
tdme::gui::elements::GUIMenuHeaderItemController::unselect
void unselect()
Unselect.
Definition:
GUIMenuHeaderItemController.cpp:68
tdme::gui::elements::GUIMenuHeaderItemController::open
bool open
Definition:
GUIMenuHeaderItemController.h:45
tdme::gui::elements::GUIMenuHeaderItemController::unselectSelection
void unselectSelection()
Unselect selection.
Definition:
GUIMenuHeaderItemController.cpp:133
tdme::gui::elements::GUIMenuHeaderItemController::CONDITION_UNSELECTED
static STATIC_DLL_IMPEXT string CONDITION_UNSELECTED
Definition:
GUIMenuHeaderItemController.h:42
tdme::gui::elements::GUIMenuHeaderItemController::selected
bool selected
Definition:
GUIMenuHeaderItemController.h:46
tdme::gui::elements::GUIMenuHeaderItemController::value
MutableString value
Definition:
GUIMenuHeaderItemController.h:47
tdme::gui::elements::GUIMenuHeaderItemController::getValue
const MutableString & getValue() override
Definition:
GUIMenuHeaderItemController.cpp:266
tdme::gui::elements::GUIMenuHeaderItemController::onSubTreeChange
void onSubTreeChange() override
On sub tree change.
Definition:
GUIMenuHeaderItemController.cpp:277
tdme::gui::elements::GUIMenuHeaderItemController::hasValue
bool hasValue() override
Definition:
GUIMenuHeaderItemController.cpp:261
tdme::gui::elements::GUIMenuHeaderItemController::CONDITION_OPENED
static STATIC_DLL_IMPEXT string CONDITION_OPENED
Definition:
GUIMenuHeaderItemController.h:39
tdme::gui::elements::GUIMenuHeaderItemController::select
void select()
Select.
Definition:
GUIMenuHeaderItemController.cpp:60
tdme::gui::elements::GUIMenuHeaderItemController::CONDITION_SELECTED
static STATIC_DLL_IMPEXT string CONDITION_SELECTED
Definition:
GUIMenuHeaderItemController.h:41
tdme::gui::elements::GUIMenuHeaderItemController::selectPrevious
void selectPrevious()
Select previous menu item.
Definition:
GUIMenuHeaderItemController.cpp:170
tdme::gui::elements::GUIMenuHeaderItem
GUI menu header item element.
Definition:
GUIMenuHeaderItem.h:28
tdme::gui::elements::GUIMenuItemController
GUI menu item controller.
Definition:
GUIMenuItemController.h:29
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::GUIElementNode
GUI element node.
Definition:
GUIElementNode.h:38
tdme::gui::nodes::GUINodeController
GUI node controller base class.
Definition:
GUINodeController.h:19
tdme::gui::nodes::GUINodeController::node
GUINode * node
Definition:
GUINodeController.h:21
tdme::gui::nodes::GUINode
GUI node base class.
Definition:
GUINode.h:63
tdme::gui::nodes::GUIParentNode
GUI parent node base class thats supporting child nodes.
Definition:
GUIParentNode.h:43
tdme::utilities::MutableString
Mutable string class.
Definition:
MutableString.h:16
fwd-tdme.h
fwd-tdme.h
fwd-tdme.h
tdme.h
STATIC_DLL_IMPEXT
#define STATIC_DLL_IMPEXT
Definition:
tdme.h:11
Generated by
1.9.3