TDME2 1.9.121
GUIElementController.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include <tdme/tdme.h>
10
11using std::string;
12
18
19/**
20 * GUI element controller
21 * @author Andreas Drewke
22 * @version $Id$
23 */
25 : public GUINodeController
26{
27 friend class GUIElementNode;
28
29private:
30 static constexpr int64_t TIME_DOUBLECLICK { 200LL };
31
36 int64_t timeLastClicked { -1LL };
37
38protected:
41
42 /**
43 * Constructor
44 * @param node node
45 */
47
48public:
49 // overridden methods
50 bool isDisabled() override;
51 void setDisabled(bool disabled) override;
52 void initialize() override;
53 void dispose() override;
54 void postLayout() override;
55 void handleMouseEvent(GUINode* node, GUIMouseEvent* event) override;
56 void handleKeyboardEvent(GUIKeyboardEvent* event) override;
57 void tick() override;
58 void onFocusGained() override;
59 void onFocusLost() override;
60 bool hasValue() override;
61 const MutableString& getValue() override;
62 void setValue(const MutableString& value) override;
63 void onSubTreeChange() override;
64};
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.
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
void tick() override
Tick method will be executed once per frame.
static STATIC_DLL_IMPEXT string CONDITION_DISABLED
static STATIC_DLL_IMPEXT string CONDITION_ENABLED
void setDisabled(bool disabled) override
Set disabled.
const MutableString & getValue() override
void onSubTreeChange() override
On sub tree change.
GUIElementController(GUINode *node)
Constructor.
GUI node controller base class.
GUI node base class.
Definition: GUINode.h:63
Mutable string class.
Definition: MutableString.h:16
#define STATIC_DLL_IMPEXT
Definition: tdme.h:11