TDME2
1.9.121
src
tdme
gui
elements
GUIContextMenuItemController.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/MutableString.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::GUINode
;
18
using
tdme::gui::nodes::GUINodeController
;
19
using
tdme::gui::nodes::GUIParentNode
;
20
using
tdme::utilities::MutableString
;
21
22
/**
23
* GUI context menu item controller
24
* @author Andreas Drewke
25
* @version $Id$
26
*/
27
class
tdme::gui::elements::GUIContextMenuItemController
final
28
:
public
GUIElementController
29
{
30
friend
class
GUIContextMenuController
;
31
friend
class
GUIContextMenuItem
;
32
33
private
:
34
STATIC_DLL_IMPEXT
static
string
CONDITION_SELECTED
;
35
STATIC_DLL_IMPEXT
static
string
CONDITION_UNSELECTED
;
36
bool
selected
;
37
MutableString
value
;
38
GUIParentNode
*
contextMenuNode
{
nullptr
};
39
40
/**
41
* Private constructor
42
* @param node node
43
*/
44
GUIContextMenuItemController
(
GUINode
*
node
);
45
46
/**
47
* @return is selected
48
*/
49
bool
isSelected
();
50
51
/**
52
* Select
53
*/
54
void
select
();
55
56
/**
57
* Unselect
58
*/
59
void
unselect
();
60
61
public
:
62
// overridden methods
63
void
initialize
()
override
;
64
void
postLayout
()
override
;
65
void
dispose
()
override
;
66
void
handleMouseEvent
(
GUINode
*
node
,
GUIMouseEvent
* event)
override
;
67
void
handleKeyboardEvent
(
GUIKeyboardEvent
* event)
override
;
68
void
tick
()
override
;
69
void
onFocusGained
()
override
;
70
void
onFocusLost
()
override
;
71
bool
hasValue
()
override
;
72
const
MutableString
&
getValue
()
override
;
73
void
setValue
(
const
MutableString
&
value
)
override
;
74
75
};
GUIElementController.h
MutableString.h
tdme::gui::elements::GUIContextMenuController
GUI context menu controller.
Definition:
GUIContextMenuController.h:32
tdme::gui::elements::GUIContextMenuItemController
GUI context menu item controller.
Definition:
GUIContextMenuItemController.h:29
tdme::gui::elements::GUIContextMenuItemController::onFocusGained
void onFocusGained() override
On focus gained.
Definition:
GUIContextMenuItemController.cpp:116
tdme::gui::elements::GUIContextMenuItemController::dispose
void dispose() override
Dispose controller.
Definition:
GUIContextMenuItemController.cpp:90
tdme::gui::elements::GUIContextMenuItemController::postLayout
void postLayout() override
Post layout event.
Definition:
GUIContextMenuItemController.cpp:86
tdme::gui::elements::GUIContextMenuItemController::initialize
void initialize() override
Initialize controller after element has been created.
Definition:
GUIContextMenuItemController.cpp:66
tdme::gui::elements::GUIContextMenuItemController::handleKeyboardEvent
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
Definition:
GUIContextMenuItemController.cpp:106
tdme::gui::elements::GUIContextMenuItemController::isSelected
bool isSelected()
Definition:
GUIContextMenuItemController.cpp:45
tdme::gui::elements::GUIContextMenuItemController::onFocusLost
void onFocusLost() override
On focus lost.
Definition:
GUIContextMenuItemController.cpp:120
tdme::gui::elements::GUIContextMenuItemController::setValue
void setValue(const MutableString &value) override
Set value.
Definition:
GUIContextMenuItemController.cpp:134
tdme::gui::elements::GUIContextMenuItemController::handleMouseEvent
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
Definition:
GUIContextMenuItemController.cpp:95
tdme::gui::elements::GUIContextMenuItemController::tick
void tick() override
Tick method will be executed once per frame.
Definition:
GUIContextMenuItemController.cpp:111
tdme::gui::elements::GUIContextMenuItemController::unselect
void unselect()
Unselect.
Definition:
GUIContextMenuItemController.cpp:58
tdme::gui::elements::GUIContextMenuItemController::CONDITION_UNSELECTED
static STATIC_DLL_IMPEXT string CONDITION_UNSELECTED
Definition:
GUIContextMenuItemController.h:35
tdme::gui::elements::GUIContextMenuItemController::selected
bool selected
Definition:
GUIContextMenuItemController.h:36
tdme::gui::elements::GUIContextMenuItemController::value
MutableString value
Definition:
GUIContextMenuItemController.h:37
tdme::gui::elements::GUIContextMenuItemController::getValue
const MutableString & getValue() override
Definition:
GUIContextMenuItemController.cpp:129
tdme::gui::elements::GUIContextMenuItemController::contextMenuNode
GUIParentNode * contextMenuNode
Definition:
GUIContextMenuItemController.h:38
tdme::gui::elements::GUIContextMenuItemController::hasValue
bool hasValue() override
Definition:
GUIContextMenuItemController.cpp:124
tdme::gui::elements::GUIContextMenuItemController::select
void select()
Select.
Definition:
GUIContextMenuItemController.cpp:50
tdme::gui::elements::GUIContextMenuItemController::CONDITION_SELECTED
static STATIC_DLL_IMPEXT string CONDITION_SELECTED
Definition:
GUIContextMenuItemController.h:34
tdme::gui::elements::GUIContextMenuItemController::GUIContextMenuItemController
GUIContextMenuItemController(GUINode *node)
Private constructor.
Definition:
GUIContextMenuItemController.cpp:39
tdme::gui::elements::GUIContextMenuItem
GUI context menu item element.
Definition:
GUIContextMenuItem.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::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