TDME2
1.9.121
src
tdme
gui
nodes
GUIHorizontalScrollbarInternalController.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
tdme/tdme.h
>
4
#include <
tdme/gui/events/fwd-tdme.h
>
5
#include <
tdme/gui/nodes/fwd-tdme.h
>
6
#include <
tdme/gui/nodes/GUINodeController.h
>
7
#include <
tdme/utilities/fwd-tdme.h
>
8
#include <
tdme/utilities/MutableString.h
>
9
10
using
tdme::gui::events::GUIKeyboardEvent
;
11
using
tdme::gui::events::GUIMouseEvent
;
12
using
tdme::gui::nodes::GUIHorizontalScrollbarInternalController_State;
13
using
tdme::gui::nodes::GUILayoutNode
;
14
using
tdme::gui::nodes::GUINode
;
15
using
tdme::gui::nodes::GUINodeController
;
16
using
tdme::utilities::MutableString
;
17
18
/**
19
* GUI scroll bar controller
20
* @author Andreas Drewke
21
* @version $Id$
22
*/
23
class
tdme::gui::nodes::GUIHorizontalScrollbarInternalController
24
:
public
GUINodeController
25
{
26
friend
class
GUIHorizontalScrollbarInternalNode
;
27
public
:
28
enum
State
{
STATE_NONE
,
STATE_MOUSEOVER
,
STATE_DRAGGING
};
29
30
private
:
31
GUILayoutNode
*
contentNode
{
nullptr
};
32
float
contentWidth
;
33
State
state
{
STATE_NONE
};
34
int
mouseXOffset
;
35
MutableString
value
;
36
37
/**
38
* @return bar width
39
*/
40
virtual
float
getBarWidth
();
41
42
/**
43
* @return bar left
44
*/
45
virtual
float
getBarLeft
();
46
47
/**
48
* Set dragged x
49
* @param draggedX dragged x
50
*/
51
virtual
void
setDraggedX
(
float
draggedX);
52
53
protected
:
54
/**
55
* Constructor
56
* @param node node
57
*/
58
GUIHorizontalScrollbarInternalController
(
GUINode
*
node
);
59
60
public
:
61
/**
62
* @return state
63
*/
64
virtual
State
getState
();
65
66
// overridden methods
67
bool
isDisabled
()
override
;
68
void
setDisabled
(
bool
disabled)
override
;
69
void
initialize
()
override
;
70
void
dispose
()
override
;
71
void
postLayout
()
override
;
72
void
handleMouseEvent
(
GUINode
*
node
,
GUIMouseEvent
* event)
override
;
73
void
handleKeyboardEvent
(
GUIKeyboardEvent
* event)
override
;
74
void
tick
()
override
;
75
void
onFocusGained
()
override
;
76
void
onFocusLost
()
override
;
77
bool
hasValue
()
override
;
78
const
MutableString
&
getValue
()
override
;
79
void
setValue
(
const
MutableString
&
value
)
override
;
80
void
onSubTreeChange
()
override
;
81
82
};
GUINodeController.h
MutableString.h
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::GUIHorizontalScrollbarInternalController
GUI scroll bar controller.
Definition:
GUIHorizontalScrollbarInternalController.h:25
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::onFocusGained
void onFocusGained() override
On focus gained.
Definition:
GUIHorizontalScrollbarInternalController.cpp:150
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::dispose
void dispose() override
Dispose controller.
Definition:
GUIHorizontalScrollbarInternalController.cpp:47
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::postLayout
void postLayout() override
Post layout event.
Definition:
GUIHorizontalScrollbarInternalController.cpp:51
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::getBarWidth
virtual float getBarWidth()
Definition:
GUIHorizontalScrollbarInternalController.cpp:61
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::getBarLeft
virtual float getBarLeft()
Definition:
GUIHorizontalScrollbarInternalController.cpp:71
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::initialize
void initialize() override
Initialize controller after element has been created.
Definition:
GUIHorizontalScrollbarInternalController.cpp:43
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::handleKeyboardEvent
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
Definition:
GUIHorizontalScrollbarInternalController.cpp:142
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::State
State
Definition:
GUIHorizontalScrollbarInternalController.h:28
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::STATE_MOUSEOVER
@ STATE_MOUSEOVER
Definition:
GUIHorizontalScrollbarInternalController.h:28
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::STATE_DRAGGING
@ STATE_DRAGGING
Definition:
GUIHorizontalScrollbarInternalController.h:28
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::STATE_NONE
@ STATE_NONE
Definition:
GUIHorizontalScrollbarInternalController.h:28
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::onFocusLost
void onFocusLost() override
On focus lost.
Definition:
GUIHorizontalScrollbarInternalController.cpp:154
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::setValue
void setValue(const MutableString &value) override
Set value.
Definition:
GUIHorizontalScrollbarInternalController.cpp:168
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::handleMouseEvent
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
Definition:
GUIHorizontalScrollbarInternalController.cpp:96
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::contentNode
GUILayoutNode * contentNode
Definition:
GUIHorizontalScrollbarInternalController.h:31
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::tick
void tick() override
Tick method will be executed once per frame.
Definition:
GUIHorizontalScrollbarInternalController.cpp:146
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::state
State state
Definition:
GUIHorizontalScrollbarInternalController.h:33
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::setDraggedX
virtual void setDraggedX(float draggedX)
Set dragged x.
Definition:
GUIHorizontalScrollbarInternalController.cpp:83
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::getState
virtual State getState()
Definition:
GUIHorizontalScrollbarInternalController.cpp:56
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::setDisabled
void setDisabled(bool disabled) override
Set disabled.
Definition:
GUIHorizontalScrollbarInternalController.cpp:39
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::value
MutableString value
Definition:
GUIHorizontalScrollbarInternalController.h:35
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::contentWidth
float contentWidth
Definition:
GUIHorizontalScrollbarInternalController.h:32
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::getValue
const MutableString & getValue() override
Definition:
GUIHorizontalScrollbarInternalController.cpp:163
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::GUIHorizontalScrollbarInternalController
GUIHorizontalScrollbarInternalController(GUINode *node)
Constructor.
Definition:
GUIHorizontalScrollbarInternalController.cpp:25
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::isDisabled
bool isDisabled() override
Definition:
GUIHorizontalScrollbarInternalController.cpp:34
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::onSubTreeChange
void onSubTreeChange() override
On sub tree change.
Definition:
GUIHorizontalScrollbarInternalController.cpp:172
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::hasValue
bool hasValue() override
Definition:
GUIHorizontalScrollbarInternalController.cpp:158
tdme::gui::nodes::GUIHorizontalScrollbarInternalController::mouseXOffset
int mouseXOffset
Definition:
GUIHorizontalScrollbarInternalController.h:34
tdme::gui::nodes::GUIHorizontalScrollbarInternalNode
GUI horizontal scroll bar internal node.
Definition:
GUIHorizontalScrollbarInternalNode.h:35
tdme::gui::nodes::GUILayoutNode
GUI layout node.
Definition:
GUILayoutNode.h:25
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
tdme.h
fwd-tdme.h
Generated by
1.9.3