TDME2
1.9.121
src
tdme
gui
elements
GUIMenuHeaderController.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/GUINodeController.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::GUIElementNode
;
17
using
tdme::gui::nodes::GUINode
;
18
using
tdme::gui::nodes::GUINodeController
;
19
using
tdme::utilities::MutableString
;
20
21
/**
22
* GUI menu header controller
23
* @author Andreas Drewke
24
* @version $Id$
25
*/
26
class
tdme::gui::elements::GUIMenuHeaderController
final
27
:
public
GUINodeController
28
{
29
friend
class
GUIMenuHeader
;
30
friend
class
GUIMenuHeaderItemController
;
31
32
private
:
33
vector<GUIMenuHeaderItemController*>
menuHeaderItemControllers
;
34
bool
focus
;
35
MutableString
value
;
36
int
menuHeaderItemControllerIdx
{ -1 };
37
38
/**
39
* Private constructor
40
* @param node node
41
*/
42
GUIMenuHeaderController
(
GUINode
*
node
);
43
44
/**
45
* @return has focus
46
*/
47
bool
hasFocus
();
48
49
/**
50
* Determine menu header item controllers
51
*/
52
void
determineMenuHeaderItemControllers
();
53
54
/**
55
* @return if menu is open
56
*/
57
bool
isOpen
();
58
59
/**
60
* Unselect
61
*/
62
void
unselect
();
63
64
/**
65
* Select next node
66
*/
67
void
selectNext
();
68
69
/**
70
* Select previous
71
*/
72
void
selectPrevious
();
73
74
/**
75
* Select by index
76
* @param idx index
77
*/
78
void
select
(
int
idx);
79
80
/**
81
* Select element node
82
* @param elementNode element node
83
*/
84
void
select
(
GUIElementNode
* elementNode);
85
86
public
:
87
// overridden methods
88
bool
isDisabled
()
override
;
89
void
setDisabled
(
bool
disabled)
override
;
90
void
initialize
()
override
;
91
void
dispose
()
override
;
92
void
postLayout
()
override
;
93
void
handleMouseEvent
(
GUINode
*
node
,
GUIMouseEvent
* event)
override
;
94
void
handleKeyboardEvent
(
GUIKeyboardEvent
* event)
override
;
95
void
tick
()
override
;
96
void
onFocusGained
()
override
;
97
void
onFocusLost
()
override
;
98
bool
hasValue
()
override
;
99
const
MutableString
&
getValue
()
override
;
100
void
setValue
(
const
MutableString
&
value
)
override
;
101
void
onSubTreeChange
()
override
;
102
103
};
GUINodeController.h
MutableString.h
tdme::gui::elements::GUIMenuHeaderController
GUI menu header controller.
Definition:
GUIMenuHeaderController.h:28
tdme::gui::elements::GUIMenuHeaderController::determineMenuHeaderItemControllers
void determineMenuHeaderItemControllers()
Determine menu header item controllers.
Definition:
GUIMenuHeaderController.cpp:61
tdme::gui::elements::GUIMenuHeaderController::onFocusGained
void onFocusGained() override
On focus gained.
Definition:
GUIMenuHeaderController.cpp:234
tdme::gui::elements::GUIMenuHeaderController::dispose
void dispose() override
Dispose controller.
Definition:
GUIMenuHeaderController.cpp:48
tdme::gui::elements::GUIMenuHeaderController::menuHeaderItemControllers
vector< GUIMenuHeaderItemController * > menuHeaderItemControllers
Definition:
GUIMenuHeaderController.h:33
tdme::gui::elements::GUIMenuHeaderController::postLayout
void postLayout() override
Post layout event.
Definition:
GUIMenuHeaderController.cpp:52
tdme::gui::elements::GUIMenuHeaderController::GUIMenuHeaderController
GUIMenuHeaderController(GUINode *node)
Private constructor.
Definition:
GUIMenuHeaderController.cpp:29
tdme::gui::elements::GUIMenuHeaderController::initialize
void initialize() override
Initialize controller after element has been created.
Definition:
GUIMenuHeaderController.cpp:44
tdme::gui::elements::GUIMenuHeaderController::isOpen
bool isOpen()
Definition:
GUIMenuHeaderController.cpp:78
tdme::gui::elements::GUIMenuHeaderController::handleKeyboardEvent
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
Definition:
GUIMenuHeaderController.cpp:167
tdme::gui::elements::GUIMenuHeaderController::selectNext
void selectNext()
Select next node.
Definition:
GUIMenuHeaderController.cpp:91
tdme::gui::elements::GUIMenuHeaderController::onFocusLost
void onFocusLost() override
On focus lost.
Definition:
GUIMenuHeaderController.cpp:239
tdme::gui::elements::GUIMenuHeaderController::setValue
void setValue(const MutableString &value) override
Set value.
Definition:
GUIMenuHeaderController.cpp:254
tdme::gui::elements::GUIMenuHeaderController::handleMouseEvent
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
Definition:
GUIMenuHeaderController.cpp:157
tdme::gui::elements::GUIMenuHeaderController::tick
void tick() override
Tick method will be executed once per frame.
Definition:
GUIMenuHeaderController.cpp:230
tdme::gui::elements::GUIMenuHeaderController::unselect
void unselect()
Unselect.
Definition:
GUIMenuHeaderController.cpp:83
tdme::gui::elements::GUIMenuHeaderController::setDisabled
void setDisabled(bool disabled) override
Set disabled.
Definition:
GUIMenuHeaderController.cpp:40
tdme::gui::elements::GUIMenuHeaderController::value
MutableString value
Definition:
GUIMenuHeaderController.h:35
tdme::gui::elements::GUIMenuHeaderController::menuHeaderItemControllerIdx
int menuHeaderItemControllerIdx
Definition:
GUIMenuHeaderController.h:36
tdme::gui::elements::GUIMenuHeaderController::getValue
const MutableString & getValue() override
Definition:
GUIMenuHeaderController.cpp:249
tdme::gui::elements::GUIMenuHeaderController::focus
bool focus
Definition:
GUIMenuHeaderController.h:34
tdme::gui::elements::GUIMenuHeaderController::isDisabled
bool isDisabled() override
Definition:
GUIMenuHeaderController.cpp:35
tdme::gui::elements::GUIMenuHeaderController::onSubTreeChange
void onSubTreeChange() override
On sub tree change.
Definition:
GUIMenuHeaderController.cpp:258
tdme::gui::elements::GUIMenuHeaderController::select
void select(int idx)
Select by index.
Definition:
GUIMenuHeaderController.cpp:138
tdme::gui::elements::GUIMenuHeaderController::hasFocus
bool hasFocus()
Definition:
GUIMenuHeaderController.cpp:56
tdme::gui::elements::GUIMenuHeaderController::hasValue
bool hasValue() override
Definition:
GUIMenuHeaderController.cpp:244
tdme::gui::elements::GUIMenuHeaderController::selectPrevious
void selectPrevious()
Select previous.
Definition:
GUIMenuHeaderController.cpp:114
tdme::gui::elements::GUIMenuHeaderItemController
GUI menu header item controller.
Definition:
GUIMenuHeaderItemController.h:32
tdme::gui::elements::GUIMenuHeader
GUI menu header element.
Definition:
GUIMenuHeader.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::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::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