TDME2 1.9.121
GUIDropDownController.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include <tdme/tdme.h>
12
13using std::string;
14using std::vector;
15
24
25/**
26 * GUI drop down controller
27 * @author Andreas Drewke
28 * @version $Id$
29 */
32{
33 friend class GUIDropDown;
35
36private:
41 vector<GUIDropDownOptionController*> dropDownOptionControllers;
42 bool open;
48 string search;
51
52private:
53 /**
54 * Private constructor
55 * @param node node
56 */
58
59 /**
60 * @return drop down open state
61 */
62 bool isOpen();
63
64 /**
65 * Unselect
66 */
67 void unselect();
68
69 /**
70 * Select by index
71 * @param idx index
72 */
73 void select(int idx);
74
75 /**
76 * Select by option element node
77 * @param selectedDropDownOptionElementNode selected drop down option element node
78 */
79 void select(GUIElementNode* selectedDropDownOptionElementNode);
80
81 /**
82 * Toggle open state
83 */
84 void toggleOpenState();
85
86 /**
87 * Determine drop down option controllers
88 */
90
91 /**
92 * Select next node
93 */
94 void selectNext();
95
96 /**
97 * Select previous
98 */
99 void selectPrevious();
100
101 /**
102 * Select last
103 */
104 void selectLast();
105
106 /**
107 * Do search
108 */
109 void doSearch();
110
111public:
112 // overridden methods
113 bool isDisabled() override;
114 void setDisabled(bool disabled) override;
115 void initialize() override;
116 void dispose() override;
117 void postLayout() override;
118 void handleMouseEvent(GUINode* node, GUIMouseEvent* event) override;
119 void handleKeyboardEvent(GUIKeyboardEvent* event) override;
120 void tick() override;
121 void onFocusGained() override;
122 void onFocusLost() override;
123 bool hasValue() override;
124 const MutableString& getValue() override;
125 void setValue(const MutableString& value) override;
126 void onSubTreeChange() override;
127
128};
void dispose() override
Dispose controller.
static STATIC_DLL_IMPEXT string CONDITION_CLOSED
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 setValue(const MutableString &value) override
Set value.
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
vector< GUIDropDownOptionController * > dropDownOptionControllers
void tick() override
Tick method will be executed once per frame.
GUIDropDownController(GUINode *node)
Private constructor.
void determineDropDownOptionControllers()
Determine drop down option controllers.
static STATIC_DLL_IMPEXT string CONDITION_DISABLED
static STATIC_DLL_IMPEXT string CONDITION_ENABLED
void setDisabled(bool disabled) override
Set disabled.
void onSubTreeChange() override
On sub tree change.
static STATIC_DLL_IMPEXT string CONDITION_OPENED
GUI drop down element.
Definition: GUIDropDown.h:28
GUI node controller base class.
GUI node base class.
Definition: GUINode.h:63
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:43
Mutable string class.
Definition: MutableString.h:16
#define STATIC_DLL_IMPEXT
Definition: tdme.h:11