TDME2  1.9.200
GUISelectBoxOptionController.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 
20 
21 /**
22  * GUI select box option controller
23  * @author Andreas Drewke
24  */
26 {
27  friend class GUISelectBoxOption;
28  friend class GUISelectBoxController;
30 
31 protected:
33 
34 private:
43  bool selected;
44  bool focussed;
46 
47  // forbid class copy
49 
50  /**
51  * Private constructor
52  * @param node node
53  */
55 
56  /**
57  * @return is selected
58  */
59  inline bool isSelected() {
60  return selected;
61  }
62 
63  /**
64  * Select
65  */
66  void select();
67 
68  /**
69  * Unselect
70  */
71  void unselect();
72 
73  /**
74  * Toggle selection
75  */
76  void toggle();
77 
78  /**
79  * @return is focussed
80  */
81  inline bool isFocussed() {
82  return focussed;
83  }
84 
85  /**
86  * Focus
87  */
88  void focus();
89 
90  /**
91  * Unfocus
92  */
93  void unfocus();
94 
95  /**
96  * @return if hierarchy is expanded
97  */
98  bool isHierarchyExpanded();
99 
100  /**
101  * Expand hierarchy
102  */
103  void expandHierarchy();
104 public:
105  // overridden methods
106  void setDisabled(bool disabled) override;
107  void initialize() override;
108  void dispose() override;
109  void postLayout() override;
110  void handleMouseEvent(GUINode* node, GUIMouseEvent* event) override;
111  void handleKeyboardEvent(GUIKeyboardEvent* event) override;
112  void onFocusGained() override;
113  void onFocusLost() override;
114  bool hasValue() override;
115  const MutableString& getValue() override;
116  void setValue(const MutableString& value) override;
117 
118 };
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.
void setDisabled(bool disabled) override
Set disabled.
GUI select box option element.
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