TDME2
1.9.121
src
tdme
gui
elements
GUIRadioButtonController.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <map>
4
#include <string>
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::map;
15
using
std::string;
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
* @version $Id$
29
*/
30
class
tdme::gui::elements::GUIRadioButtonController
final
31
:
public
GUIElementController
32
{
33
friend
class
GUIRadioButton
;
34
35
private
:
36
STATIC_DLL_IMPEXT
static
string
CONDITION_SELECTED
;
37
STATIC_DLL_IMPEXT
static
string
CONDITION_UNSELECTED
;
38
STATIC_DLL_IMPEXT
static
string
CONDITION_DISABLED
;
39
STATIC_DLL_IMPEXT
static
string
CONDITION_ENABLED
;
40
bool
selected
;
41
bool
disabled
;
42
STATIC_DLL_IMPEXT
static
map<string, vector<GUIElementNode*>>*
radioButtonGroupNodesByName
;
43
MutableString
value
;
44
45
/**
46
* Private constructor
47
* @param node node
48
*/
49
GUIRadioButtonController
(
GUINode
*
node
);
50
51
/**
52
* @return is checked
53
*/
54
bool
isSelected
();
55
56
/**
57
* Select
58
*/
59
void
select
();
60
61
public
:
62
// overridden methods
63
bool
isDisabled
()
override
;
64
void
setDisabled
(
bool
disabled
)
override
;
65
void
initialize
()
override
;
66
void
dispose
()
override
;
67
void
postLayout
()
override
;
68
void
handleMouseEvent
(
GUINode
*
node
,
GUIMouseEvent
* event)
override
;
69
void
handleKeyboardEvent
(
GUIKeyboardEvent
* event)
override
;
70
void
tick
()
override
;
71
void
onFocusGained
()
override
;
72
void
onFocusLost
()
override
;
73
bool
hasValue
()
override
;
74
const
MutableString
&
getValue
()
override
;
75
void
setValue
(
const
MutableString
&
value
)
override
;
76
77
};
GUIElementController.h
MutableString.h
tdme::gui::elements::GUIRadioButtonController
GUI radio button controller.
Definition:
GUIRadioButtonController.h:32
tdme::gui::elements::GUIRadioButtonController::onFocusGained
void onFocusGained() override
On focus gained.
Definition:
GUIRadioButtonController.cpp:147
tdme::gui::elements::GUIRadioButtonController::dispose
void dispose() override
Dispose controller.
Definition:
GUIRadioButtonController.cpp:94
tdme::gui::elements::GUIRadioButtonController::radioButtonGroupNodesByName
static STATIC_DLL_IMPEXT map< string, vector< GUIElementNode * > > * radioButtonGroupNodesByName
Definition:
GUIRadioButtonController.h:42
tdme::gui::elements::GUIRadioButtonController::postLayout
void postLayout() override
Post layout event.
Definition:
GUIRadioButtonController.cpp:104
tdme::gui::elements::GUIRadioButtonController::initialize
void initialize() override
Initialize controller after element has been created.
Definition:
GUIRadioButtonController.cpp:85
tdme::gui::elements::GUIRadioButtonController::handleKeyboardEvent
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
Definition:
GUIRadioButtonController.cpp:121
tdme::gui::elements::GUIRadioButtonController::disabled
bool disabled
Definition:
GUIRadioButtonController.h:41
tdme::gui::elements::GUIRadioButtonController::GUIRadioButtonController
GUIRadioButtonController(GUINode *node)
Private constructor.
Definition:
GUIRadioButtonController.cpp:32
tdme::gui::elements::GUIRadioButtonController::isSelected
bool isSelected()
Definition:
GUIRadioButtonController.cpp:44
tdme::gui::elements::GUIRadioButtonController::onFocusLost
void onFocusLost() override
On focus lost.
Definition:
GUIRadioButtonController.cpp:151
tdme::gui::elements::GUIRadioButtonController::setValue
void setValue(const MutableString &value) override
Set value.
Definition:
GUIRadioButtonController.cpp:169
tdme::gui::elements::GUIRadioButtonController::handleMouseEvent
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
Definition:
GUIRadioButtonController.cpp:108
tdme::gui::elements::GUIRadioButtonController::tick
void tick() override
Tick method will be executed once per frame.
Definition:
GUIRadioButtonController.cpp:142
tdme::gui::elements::GUIRadioButtonController::CONDITION_DISABLED
static STATIC_DLL_IMPEXT string CONDITION_DISABLED
Definition:
GUIRadioButtonController.h:38
tdme::gui::elements::GUIRadioButtonController::CONDITION_ENABLED
static STATIC_DLL_IMPEXT string CONDITION_ENABLED
Definition:
GUIRadioButtonController.h:39
tdme::gui::elements::GUIRadioButtonController::CONDITION_UNSELECTED
static STATIC_DLL_IMPEXT string CONDITION_UNSELECTED
Definition:
GUIRadioButtonController.h:37
tdme::gui::elements::GUIRadioButtonController::setDisabled
void setDisabled(bool disabled) override
Set disabled.
Definition:
GUIRadioButtonController.cpp:77
tdme::gui::elements::GUIRadioButtonController::selected
bool selected
Definition:
GUIRadioButtonController.h:40
tdme::gui::elements::GUIRadioButtonController::value
MutableString value
Definition:
GUIRadioButtonController.h:43
tdme::gui::elements::GUIRadioButtonController::getValue
const MutableString & getValue() override
Definition:
GUIRadioButtonController.cpp:160
tdme::gui::elements::GUIRadioButtonController::isDisabled
bool isDisabled() override
Definition:
GUIRadioButtonController.cpp:72
tdme::gui::elements::GUIRadioButtonController::hasValue
bool hasValue() override
Definition:
GUIRadioButtonController.cpp:155
tdme::gui::elements::GUIRadioButtonController::select
void select()
Select.
Definition:
GUIRadioButtonController.cpp:49
tdme::gui::elements::GUIRadioButtonController::CONDITION_SELECTED
static STATIC_DLL_IMPEXT string CONDITION_SELECTED
Definition:
GUIRadioButtonController.h:36
tdme::gui::elements::GUIRadioButton
GUI radio button element.
Definition:
GUIRadioButton.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::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
STATIC_DLL_IMPEXT
#define STATIC_DLL_IMPEXT
Definition:
tdme.h:11
Generated by
1.9.3