TDME2 1.9.121
GUIContextMenuController.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 context menu controller
27 * @author Andreas Drewke
28 * @version $Id$
29 */
32{
33 friend class GUIContextMenu;
35
36private:
41 vector<GUIContextMenuItemController*> menuItemControllers;
44
45private:
46 /**
47 * Private constructor
48 * @param node node
49 */
51
52 /**
53 * @return menu open state
54 */
55 bool isOpen();
56
57 /**
58 * Determine menu item controllers
59 */
61
62 /**
63 * Unselect selection
64 */
65 void unselectSelection();
66
67 /**
68 * Select first menu item
69 */
70 void selectFirst();
71
72 /**
73 * Select next menu item
74 */
75 void selectNext();
76
77 /**
78 * Select previous menu item
79 */
80 void selectPrevious();
81
82 /**
83 * Handle current menu item keyboard event
84 * @param event event
85 */
87
88public:
89 // overridden methods
90 void initialize() override;
91 void dispose() override;
92 void postLayout() override;
93 void handleMouseEvent(GUINode* node, GUIMouseEvent* event) override;
94 void handleKeyboardEvent(GUIKeyboardEvent* event) override;
95 void tick() override;
96 void onFocusGained() override;
97 void onFocusLost() override;
98 bool hasValue() override;
99 const MutableString& getValue() override;
100 void setValue(const MutableString& value) override;
101 void onSubTreeChange() override;
102
103};
static STATIC_DLL_IMPEXT string CONDITION_UNSELECTED
void initialize() override
Initialize controller after element has been created.
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
void handleCurrentMenuItemKeyboardEvent(GUIKeyboardEvent *event)
Handle current menu item keyboard event.
void determineMenuItemControllers()
Determine menu item controllers.
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.
GUIContextMenuController(GUINode *node)
Private constructor.
vector< GUIContextMenuItemController * > menuItemControllers
GUI context menu element.
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