TDME2
1.9.200
src
tdme
gui
elements
GUIRadioButtonController.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
#include <unordered_map>
5
#include <vector>
6
7
#include <
tdme/tdme.h
>
8
#include <
tdme/gui/elements/fwd-tdme.h
>
9
#include <
tdme/gui/events/fwd-tdme.h
>
10
#include <
tdme/gui/nodes/fwd-tdme.h
>
11
#include <
tdme/gui/nodes/GUIElementController.h
>
12
#include <
tdme/utilities/MutableString.h
>
13
14
using
std::string;
15
using
std::unordered_map;
16
using
std::vector;
17
18
using
tdme::gui::events::GUIKeyboardEvent
;
19
using
tdme::gui::events::GUIMouseEvent
;
20
using
tdme::gui::nodes::GUIElementController
;
21
using
tdme::gui::nodes::GUIElementNode
;
22
using
tdme::gui::nodes::GUINode
;
23
using
tdme::utilities::MutableString
;
24
25
/**
26
* GUI radio button controller
27
* @author Andreas Drewke
28
*/
29
class
tdme::gui::elements::GUIRadioButtonController
final
30
:
public
GUIElementController
31
{
32
friend
class
GUIRadioButton
;
33
34
private
:
35
STATIC_DLL_IMPEXT
static
string
CONDITION_SELECTED
;
36
STATIC_DLL_IMPEXT
static
string
CONDITION_UNSELECTED
;
37
STATIC_DLL_IMPEXT
static
string
CONDITION_DISABLED
;
38
STATIC_DLL_IMPEXT
static
string
CONDITION_ENABLED
;
39
bool
selected
;
40
bool
disabled
;
41
STATIC_DLL_IMPEXT
static
unordered_map<string, vector<string>>
radioButtonGroupNodesByName
;
42
MutableString
value
;
43
44
// forbid class copy
45
FORBID_CLASS_COPY
(
GUIRadioButtonController
)
46
47
/**
48
* Private constructor
49
* @param node node
50
*/
51
GUIRadioButtonController
(
GUINode
*
node
);
52
53
/**
54
* @return is checked
55
*/
56
bool
isSelected
();
57
58
/**
59
* Select
60
*/
61
void
select
();
62
63
public
:
64
// overridden methods
65
bool
isDisabled
()
override
;
66
void
setDisabled
(
bool
disabled
)
override
;
67
void
initialize
()
override
;
68
void
dispose
()
override
;
69
void
postLayout
()
override
;
70
void
handleMouseEvent
(
GUINode
*
node
,
GUIMouseEvent
* event)
override
;
71
void
handleKeyboardEvent
(
GUIKeyboardEvent
* event)
override
;
72
void
tick
()
override
;
73
void
onFocusGained
()
override
;
74
void
onFocusLost
()
override
;
75
bool
hasValue
()
override
;
76
const
MutableString
&
getValue
()
override
;
77
void
setValue
(
const
MutableString
&
value
)
override
;
78
79
};
GUIElementController.h
MutableString.h
tdme::gui::elements::GUIRadioButtonController
GUI radio button controller.
Definition:
GUIRadioButtonController.h:31
tdme::gui::elements::GUIRadioButtonController::onFocusGained
void onFocusGained() override
On focus gained.
Definition:
GUIRadioButtonController.cpp:155
tdme::gui::elements::GUIRadioButtonController::dispose
void dispose() override
Dispose controller.
Definition:
GUIRadioButtonController.cpp:102
tdme::gui::elements::GUIRadioButtonController::postLayout
void postLayout() override
Post layout event.
Definition:
GUIRadioButtonController.cpp:112
tdme::gui::elements::GUIRadioButtonController::initialize
void initialize() override
Initialize controller after element has been created.
Definition:
GUIRadioButtonController.cpp:93
tdme::gui::elements::GUIRadioButtonController::handleKeyboardEvent
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
Definition:
GUIRadioButtonController.cpp:129
tdme::gui::elements::GUIRadioButtonController::disabled
bool disabled
Definition:
GUIRadioButtonController.h:40
tdme::gui::elements::GUIRadioButtonController::GUIRadioButtonController
GUIRadioButtonController(GUINode *node)
Private constructor.
Definition:
GUIRadioButtonController.cpp:40
tdme::gui::elements::GUIRadioButtonController::isSelected
bool isSelected()
Definition:
GUIRadioButtonController.cpp:52
tdme::gui::elements::GUIRadioButtonController::onFocusLost
void onFocusLost() override
On focus lost.
Definition:
GUIRadioButtonController.cpp:159
tdme::gui::elements::GUIRadioButtonController::setValue
void setValue(const MutableString &value) override
Set value.
Definition:
GUIRadioButtonController.cpp:177
tdme::gui::elements::GUIRadioButtonController::handleMouseEvent
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
Definition:
GUIRadioButtonController.cpp:116
tdme::gui::elements::GUIRadioButtonController::tick
void tick() override
Tick method will be executed once per frame.
Definition:
GUIRadioButtonController.cpp:150
tdme::gui::elements::GUIRadioButtonController::CONDITION_DISABLED
static STATIC_DLL_IMPEXT string CONDITION_DISABLED
Definition:
GUIRadioButtonController.h:37
tdme::gui::elements::GUIRadioButtonController::CONDITION_ENABLED
static STATIC_DLL_IMPEXT string CONDITION_ENABLED
Definition:
GUIRadioButtonController.h:38
tdme::gui::elements::GUIRadioButtonController::CONDITION_UNSELECTED
static STATIC_DLL_IMPEXT string CONDITION_UNSELECTED
Definition:
GUIRadioButtonController.h:36
tdme::gui::elements::GUIRadioButtonController::setDisabled
void setDisabled(bool disabled) override
Set disabled.
Definition:
GUIRadioButtonController.cpp:85
tdme::gui::elements::GUIRadioButtonController::selected
bool selected
Definition:
GUIRadioButtonController.h:39
tdme::gui::elements::GUIRadioButtonController::value
MutableString value
Definition:
GUIRadioButtonController.h:42
tdme::gui::elements::GUIRadioButtonController::getValue
const MutableString & getValue() override
Definition:
GUIRadioButtonController.cpp:168
tdme::gui::elements::GUIRadioButtonController::isDisabled
bool isDisabled() override
Definition:
GUIRadioButtonController.cpp:80
tdme::gui::elements::GUIRadioButtonController::hasValue
bool hasValue() override
Definition:
GUIRadioButtonController.cpp:163
tdme::gui::elements::GUIRadioButtonController::radioButtonGroupNodesByName
static STATIC_DLL_IMPEXT unordered_map< string, vector< string > > radioButtonGroupNodesByName
Definition:
GUIRadioButtonController.h:41
tdme::gui::elements::GUIRadioButtonController::select
void select()
Select.
Definition:
GUIRadioButtonController.cpp:57
tdme::gui::elements::GUIRadioButtonController::CONDITION_SELECTED
static STATIC_DLL_IMPEXT string CONDITION_SELECTED
Definition:
GUIRadioButtonController.h:35
tdme::gui::elements::GUIRadioButton
GUI radio button element.
Definition:
GUIRadioButton.h:27
tdme::gui::events::GUIKeyboardEvent
GUI keyboard event.
Definition:
GUIKeyboardEvent.h:12
tdme::gui::events::GUIMouseEvent
GUI mouse event.
Definition:
GUIMouseEvent.h:12
tdme::gui::nodes::GUIElementController
GUI element controller.
Definition:
GUIElementController.h:25
tdme::gui::nodes::GUIElementNode
GUI element node.
Definition:
GUIElementNode.h:37
tdme::gui::nodes::GUINodeController::node
GUINode * node
Definition:
GUINodeController.h:20
tdme::gui::nodes::GUINode
GUI node base class.
Definition:
GUINode.h:64
tdme::utilities::MutableString
Mutable utf8 aware string class.
Definition:
MutableString.h:23
fwd-tdme.h
fwd-tdme.h
fwd-tdme.h
tdme.h
STATIC_DLL_IMPEXT
#define STATIC_DLL_IMPEXT
Definition:
tdme.h:15
FORBID_CLASS_COPY
#define FORBID_CLASS_COPY(CLASS)
Definition:
tdme.h:6
Generated by
1.9.1