TDME2
1.9.121
src
tdme
gui
elements
GUIInputController.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
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/fwd-tdme.h
>
11
12
using
std::string;
13
14
using
tdme::gui::events::GUIKeyboardEvent
;
15
using
tdme::gui::events::GUIMouseEvent
;
16
using
tdme::gui::nodes::GUIElementController
;
17
using
tdme::gui::nodes::GUIInputInternalNode
;
18
using
tdme::gui::nodes::GUINode
;
19
using
tdme::utilities::MutableString
;
20
21
/**
22
* GUI input controller
23
* @author Andreas Drewke
24
* @version $Id$
25
*/
26
class
tdme::gui::elements::GUIInputController
final
27
:
public
GUIElementController
28
{
29
friend
class
GUIInput
;
30
31
private
:
32
STATIC_DLL_IMPEXT
static
string
CONDITION_DISABLED
;
33
STATIC_DLL_IMPEXT
static
string
CONDITION_ENABLED
;
34
GUIInputInternalNode
*
inputNode
{
nullptr
};
35
bool
disabled
;
36
37
/**
38
* Private constructor
39
* @param node node
40
*/
41
GUIInputController
(
GUINode
*
node
);
42
43
public
:
44
45
/**
46
* On value change
47
*/
48
void
onValueChange
();
49
50
// overridden methods
51
bool
isDisabled
()
override
;
52
void
setDisabled
(
bool
disabled
)
override
;
53
void
initialize
()
override
;
54
void
dispose
()
override
;
55
void
postLayout
()
override
;
56
void
handleMouseEvent
(
GUINode
*
node
,
GUIMouseEvent
* event)
override
;
57
void
handleKeyboardEvent
(
GUIKeyboardEvent
* event)
override
;
58
void
tick
()
override
;
59
void
onFocusGained
()
override
;
60
void
onFocusLost
()
override
;
61
bool
hasValue
()
override
;
62
const
MutableString
&
getValue
()
override
;
63
void
setValue
(
const
MutableString
&
value
)
override
;
64
void
onSubTreeChange
()
override
;
65
66
};
GUIElementController.h
tdme::gui::elements::GUIInputController
GUI input controller.
Definition:
GUIInputController.h:28
tdme::gui::elements::GUIInputController::onFocusGained
void onFocusGained() override
On focus gained.
Definition:
GUIInputController.cpp:100
tdme::gui::elements::GUIInputController::dispose
void dispose() override
Dispose controller.
Definition:
GUIInputController.cpp:73
tdme::gui::elements::GUIInputController::postLayout
void postLayout() override
Post layout event.
Definition:
GUIInputController.cpp:78
tdme::gui::elements::GUIInputController::initialize
void initialize() override
Initialize controller after element has been created.
Definition:
GUIInputController.cpp:62
tdme::gui::elements::GUIInputController::handleKeyboardEvent
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
Definition:
GUIInputController.cpp:91
tdme::gui::elements::GUIInputController::disabled
bool disabled
Definition:
GUIInputController.h:35
tdme::gui::elements::GUIInputController::onFocusLost
void onFocusLost() override
On focus lost.
Definition:
GUIInputController.cpp:106
tdme::gui::elements::GUIInputController::setValue
void setValue(const MutableString &value) override
Set value.
Definition:
GUIInputController.cpp:122
tdme::gui::elements::GUIInputController::handleMouseEvent
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
Definition:
GUIInputController.cpp:82
tdme::gui::elements::GUIInputController::tick
void tick() override
Tick method will be executed once per frame.
Definition:
GUIInputController.cpp:95
tdme::gui::elements::GUIInputController::onValueChange
void onValueChange()
On value change.
Definition:
GUIInputController.cpp:40
tdme::gui::elements::GUIInputController::CONDITION_DISABLED
static STATIC_DLL_IMPEXT string CONDITION_DISABLED
Definition:
GUIInputController.h:32
tdme::gui::elements::GUIInputController::inputNode
GUIInputInternalNode * inputNode
Definition:
GUIInputController.h:34
tdme::gui::elements::GUIInputController::CONDITION_ENABLED
static STATIC_DLL_IMPEXT string CONDITION_ENABLED
Definition:
GUIInputController.h:33
tdme::gui::elements::GUIInputController::setDisabled
void setDisabled(bool disabled) override
Set disabled.
Definition:
GUIInputController.cpp:54
tdme::gui::elements::GUIInputController::getValue
const MutableString & getValue() override
Definition:
GUIInputController.cpp:117
tdme::gui::elements::GUIInputController::GUIInputController
GUIInputController(GUINode *node)
Private constructor.
Definition:
GUIInputController.cpp:34
tdme::gui::elements::GUIInputController::isDisabled
bool isDisabled() override
Definition:
GUIInputController.cpp:49
tdme::gui::elements::GUIInputController::onSubTreeChange
void onSubTreeChange() override
On sub tree change.
Definition:
GUIInputController.cpp:131
tdme::gui::elements::GUIInputController::hasValue
bool hasValue() override
Definition:
GUIInputController.cpp:112
tdme::gui::elements::GUIInput
GUI input element.
Definition:
GUIInput.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::value
MutableString value
Definition:
GUIElementController.h:35
tdme::gui::nodes::GUIInputInternalNode
GUI input internal node.
Definition:
GUIInputInternalNode.h:40
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
fwd-tdme.h
Generated by
1.9.3