TDME2 1.9.121
GUIKnobController.h
Go to the documentation of this file.
1#pragma once
2
3#include <tdme/tdme.h>
9
15
16/**
17 * GUI knob controller
18 * @author Andreas Drewke
19 * @version $Id$
20 */
22{
23 friend class GUIKnob;
24
25private:
26 GUINode* knobNode { nullptr };
27 bool disabled { false };
28 float valueFloat { 0.0f };
30 int mouseLastX { -1 };
31
32 /**
33 * Private constructor
34 * @param node node
35 */
37
38 /**
39 * Update knob
40 */
41 void updateKnob();
42
43public:
44 // overridden methods
45 bool isDisabled() override;
46 void setDisabled(bool disabled) override;
47 void initialize() override;
48 void dispose() override;
49 void postLayout() override;
50 void handleMouseEvent(GUINode* node, GUIMouseEvent* event) override;
51 void handleKeyboardEvent(GUIKeyboardEvent* event) override;
52 void tick() override;
53 void onFocusGained() override;
54 void onFocusLost() override;
55 bool hasValue() override;
56 const MutableString& getValue() override;
57 void setValue(const MutableString& value) override;
58
59};
void onFocusGained() override
On focus gained.
void dispose() override
Dispose controller.
void postLayout() override
Post layout event.
void initialize() override
Initialize controller after element has been created.
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
void onFocusLost() override
On focus lost.
void setValue(const MutableString &value) override
Set value.
GUIKnobController(GUINode *node)
Private constructor.
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
void tick() override
Tick method will be executed once per frame.
void setDisabled(bool disabled) override
Set disabled.
const MutableString & getValue() override
GUI knob element.
Definition: GUIKnob.h:29
GUI node base class.
Definition: GUINode.h:63
Mutable string class.
Definition: MutableString.h:16