TDME2  1.9.200
GUIDropDownOptionController.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
11 
12 using std::string;
13 
21 
22 /**
23  * GUI drop down option controller
24  * @author Andreas Drewke
25  */
27  : public GUIElementController
28 {
29  friend class GUIDropDownOption;
30  friend class GUIDropDownController;
31 
32 private:
39  bool selected;
40  bool hidden;
42 
43  // forbid class copy
45 
46  /**
47  * Private constructor
48  * @param node node
49  */
51 
52  /**
53  * @return is selected
54  */
55  inline bool isSelected() {
56  return selected;
57  }
58 
59  /**
60  * Select
61  */
62  void select();
63 
64  /**
65  * Unselect
66  */
67  void unselect();
68 
69  /**
70  * Search by string
71  * @param value value
72  * @return search did match
73  */
74  bool search(const string& value);
75 
76  /**
77  * @return hidden
78  */
79  inline bool isHidden() {
80  return hidden;
81  }
82 
83 public:
84  // overridden methods
85  void setDisabled(bool disabled) override;
86  void initialize() override;
87  void postLayout() override;
88  void dispose() override;
89  void handleMouseEvent(GUINode* node, GUIMouseEvent* event) override;
90  void handleKeyboardEvent(GUIKeyboardEvent* event) override;
91  void tick() override;
92  void onFocusGained() override;
93  void onFocusLost() override;
94  bool hasValue() override;
95  const MutableString& getValue() override;
96  void setValue(const MutableString& value) override;
97 
98 };
bool search(const string &value)
Search by string.
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.
GUIDropDownOptionController(GUINode *node)
Private constructor.
void tick() override
Tick method will be executed once per frame.
void setDisabled(bool disabled) override
Set disabled.
GUI drop down option element.
GUI node controller base class.
GUI node base class.
Definition: GUINode.h:64
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:42
Mutable utf8 aware string class.
Definition: MutableString.h:23
#define STATIC_DLL_IMPEXT
Definition: tdme.h:15
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6