TDME2 1.9.121
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
GUIContextMenuController Class Referencefinal

GUI context menu controller. More...

#include <tdme/gui/elements/GUIContextMenuController.h>

Inheritance diagram for GUIContextMenuController:
Inheritance graph
Collaboration diagram for GUIContextMenuController:
Collaboration graph

Public Member Functions

void initialize () override
 Initialize controller after element has been created. More...
 
void dispose () override
 Dispose controller. More...
 
void postLayout () override
 Post layout event. More...
 
void handleMouseEvent (GUINode *node, GUIMouseEvent *event) override
 Handle mouse event. More...
 
void handleKeyboardEvent (GUIKeyboardEvent *event) override
 Handle keyboard event. More...
 
void tick () override
 Tick method will be executed once per frame. More...
 
void onFocusGained () override
 On focus gained. More...
 
void onFocusLost () override
 On focus lost. More...
 
bool hasValue () override
 
const MutableStringgetValue () override
 
void setValue (const MutableString &value) override
 Set value. More...
 
void onSubTreeChange () override
 On sub tree change. More...
 
- Public Member Functions inherited from GUIElementController
bool isDisabled () override
 
void setDisabled (bool disabled) override
 Set disabled. More...
 
void initialize () override
 Initialize controller after element has been created. More...
 
void dispose () override
 Dispose controller. More...
 
void postLayout () override
 Post layout event. More...
 
void handleMouseEvent (GUINode *node, GUIMouseEvent *event) override
 Handle mouse event. More...
 
void handleKeyboardEvent (GUIKeyboardEvent *event) override
 Handle keyboard event. More...
 
void tick () override
 Tick method will be executed once per frame. More...
 
void onFocusGained () override
 On focus gained. More...
 
void onFocusLost () override
 On focus lost. More...
 
bool hasValue () override
 
const MutableStringgetValue () override
 
void setValue (const MutableString &value) override
 Set value. More...
 
void onSubTreeChange () override
 On sub tree change. More...
 
- Public Member Functions inherited from GUINodeController
virtual ~GUINodeController ()
 Destructor. More...
 
virtual GUINodegetNode ()
 
virtual void initialize ()=0
 Initialize controller after element has been created. More...
 
virtual void dispose ()=0
 Dispose controller. More...
 
virtual void postLayout ()=0
 Post layout event. More...
 
virtual void handleMouseEvent (GUINode *node, GUIMouseEvent *event)=0
 Handle mouse event. More...
 
virtual void handleKeyboardEvent (GUIKeyboardEvent *event)=0
 Handle keyboard event. More...
 
virtual void tick ()=0
 Tick method will be executed once per frame. More...
 
virtual void onFocusGained ()=0
 On focus gained. More...
 
virtual void onFocusLost ()=0
 On focus lost. More...
 
virtual bool hasValue ()=0
 
virtual const MutableStringgetValue ()=0
 
virtual void setValue (const MutableString &value)=0
 Set value. More...
 
virtual bool isDisabled ()=0
 
virtual void setDisabled (bool disabled)=0
 Set disabled. More...
 
virtual void onSubTreeChange ()=0
 On sub tree change. More...
 

Private Member Functions

 GUIContextMenuController (GUINode *node)
 Private constructor. More...
 
bool isOpen ()
 
void determineMenuItemControllers ()
 Determine menu item controllers. More...
 
void unselectSelection ()
 Unselect selection. More...
 
void selectFirst ()
 Select first menu item. More...
 
void selectNext ()
 Select next menu item. More...
 
void selectPrevious ()
 Select previous menu item. More...
 
void handleCurrentMenuItemKeyboardEvent (GUIKeyboardEvent *event)
 Handle current menu item keyboard event. More...
 

Private Attributes

vector< GUIContextMenuItemController * > menuItemControllers
 
MutableString value
 
int selectedMenuItemControllerIdx { -1 }
 

Static Private Attributes

static STATIC_DLL_IMPEXT string CONDITION_OPENED
 
static STATIC_DLL_IMPEXT string CONDITION_CLOSED
 
static STATIC_DLL_IMPEXT string CONDITION_SELECTED
 
static STATIC_DLL_IMPEXT string CONDITION_UNSELECTED
 

Friends

class GUIContextMenu
 
class GUIContextMenuItemController
 

Additional Inherited Members

- Protected Member Functions inherited from GUIElementController
 GUIElementController (GUINode *node)
 Constructor. More...
 
- Protected Member Functions inherited from GUINodeController
 GUINodeController (GUINode *node)
 Private constructor. More...
 
- Protected Attributes inherited from GUINodeController
GUINodenode { nullptr }
 
- Static Protected Attributes inherited from GUIElementController
static STATIC_DLL_IMPEXT string CONDITION_DISABLED = "disabled"
 
static STATIC_DLL_IMPEXT string CONDITION_ENABLED = "enabled"
 

Detailed Description

GUI context menu controller.

Author
Andreas Drewke
Version
$Id$

Definition at line 30 of file GUIContextMenuController.h.

Constructor & Destructor Documentation

◆ GUIContextMenuController()

GUIContextMenuController ( GUINode node)
private

Private constructor.

Parameters
nodenode

Definition at line 32 of file GUIContextMenuController.cpp.

Member Function Documentation

◆ determineMenuItemControllers()

void determineMenuItemControllers ( )
private

Determine menu item controllers.

Definition at line 52 of file GUIContextMenuController.cpp.

◆ dispose()

void dispose ( )
overridevirtual

Dispose controller.

Implements GUINodeController.

Definition at line 43 of file GUIContextMenuController.cpp.

◆ getValue()

const MutableString & getValue ( )
overridevirtual
Returns
value

Implements GUINodeController.

Definition at line 178 of file GUIContextMenuController.cpp.

◆ handleCurrentMenuItemKeyboardEvent()

void handleCurrentMenuItemKeyboardEvent ( GUIKeyboardEvent event)
private

Handle current menu item keyboard event.

Parameters
eventevent

Definition at line 126 of file GUIContextMenuController.cpp.

◆ handleKeyboardEvent()

void handleKeyboardEvent ( GUIKeyboardEvent event)
overridevirtual

Handle keyboard event.

Parameters
eventevent

Implements GUINodeController.

Definition at line 138 of file GUIContextMenuController.cpp.

◆ handleMouseEvent()

void handleMouseEvent ( GUINode node,
GUIMouseEvent event 
)
overridevirtual

Handle mouse event.

Parameters
nodenode
eventevent

Implements GUINodeController.

Definition at line 133 of file GUIContextMenuController.cpp.

◆ hasValue()

bool hasValue ( )
overridevirtual
Returns
has value

Implements GUINodeController.

Definition at line 173 of file GUIContextMenuController.cpp.

◆ initialize()

void initialize ( )
overridevirtual

Initialize controller after element has been created.

Implements GUINodeController.

Definition at line 37 of file GUIContextMenuController.cpp.

◆ isOpen()

bool isOpen ( )
private
Returns
menu open state

◆ onFocusGained()

void onFocusGained ( )
overridevirtual

On focus gained.

Implements GUINodeController.

Definition at line 165 of file GUIContextMenuController.cpp.

◆ onFocusLost()

void onFocusLost ( )
overridevirtual

On focus lost.

Implements GUINodeController.

Definition at line 169 of file GUIContextMenuController.cpp.

◆ onSubTreeChange()

void onSubTreeChange ( )
overridevirtual

On sub tree change.

Implements GUINodeController.

Definition at line 189 of file GUIContextMenuController.cpp.

◆ postLayout()

void postLayout ( )
overridevirtual

Post layout event.

Implements GUINodeController.

Definition at line 48 of file GUIContextMenuController.cpp.

◆ selectFirst()

void selectFirst ( )
private

Select first menu item.

Definition at line 74 of file GUIContextMenuController.cpp.

◆ selectNext()

void selectNext ( )
private

Select next menu item.

Definition at line 82 of file GUIContextMenuController.cpp.

◆ selectPrevious()

void selectPrevious ( )
private

Select previous menu item.

Definition at line 104 of file GUIContextMenuController.cpp.

◆ setValue()

void setValue ( const MutableString value)
overridevirtual

Set value.

Parameters
valuevalue

Implements GUINodeController.

Definition at line 184 of file GUIContextMenuController.cpp.

◆ tick()

void tick ( )
overridevirtual

Tick method will be executed once per frame.

Implements GUINodeController.

Definition at line 160 of file GUIContextMenuController.cpp.

◆ unselectSelection()

void unselectSelection ( )
private

Unselect selection.

Definition at line 67 of file GUIContextMenuController.cpp.

Friends And Related Function Documentation

◆ GUIContextMenu

friend class GUIContextMenu
friend

Definition at line 33 of file GUIContextMenuController.h.

◆ GUIContextMenuItemController

friend class GUIContextMenuItemController
friend

Definition at line 34 of file GUIContextMenuController.h.

Member Data Documentation

◆ CONDITION_CLOSED

STATIC_DLL_IMPEXT string CONDITION_CLOSED
staticprivate

Definition at line 38 of file GUIContextMenuController.h.

◆ CONDITION_OPENED

STATIC_DLL_IMPEXT string CONDITION_OPENED
staticprivate

Definition at line 37 of file GUIContextMenuController.h.

◆ CONDITION_SELECTED

STATIC_DLL_IMPEXT string CONDITION_SELECTED
staticprivate

Definition at line 39 of file GUIContextMenuController.h.

◆ CONDITION_UNSELECTED

STATIC_DLL_IMPEXT string CONDITION_UNSELECTED
staticprivate

Definition at line 40 of file GUIContextMenuController.h.

◆ menuItemControllers

vector<GUIContextMenuItemController*> menuItemControllers
private

Definition at line 41 of file GUIContextMenuController.h.

◆ selectedMenuItemControllerIdx

int selectedMenuItemControllerIdx { -1 }
private

Definition at line 43 of file GUIContextMenuController.h.

◆ value

MutableString value
private

Definition at line 42 of file GUIContextMenuController.h.


The documentation for this class was generated from the following files: