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