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

GUI drop down controller. More...

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

Inheritance diagram for GUIDropDownController:
Inheritance graph
Collaboration diagram for GUIDropDownController:
Collaboration graph

Public Member Functions

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 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

 GUIDropDownController (GUINode *node)
 Private constructor. More...
 
bool isOpen ()
 
void unselect ()
 Unselect. More...
 
void select (int idx)
 Select by index. More...
 
void select (GUIElementNode *selectedDropDownOptionElementNode)
 Select by option element node. More...
 
void toggleOpenState ()
 Toggle open state. More...
 
void determineDropDownOptionControllers ()
 Determine drop down option controllers. More...
 
void selectNext ()
 Select next node. More...
 
void selectPrevious ()
 Select previous. More...
 
void selectLast ()
 Select last. More...
 
void doSearch ()
 Do search. More...
 

Private Attributes

vector< GUIDropDownOptionController * > dropDownOptionControllers
 
bool open
 
bool disabled
 
GUIParentNodedropDownContainerNode { nullptr }
 
GUIElementNodearrowNode { nullptr }
 
GUIElementNodetextElementNode { nullptr }
 
MutableString value
 
string search
 
int selectedDropDownOptionControllerIdx { -1 }
 
int lastSelectedDropDownOptionControllerIdx { -1 }
 

Static Private Attributes

static STATIC_DLL_IMPEXT string CONDITION_DISABLED = "disabled"
 
static STATIC_DLL_IMPEXT string CONDITION_ENABLED = "enabled"
 
static STATIC_DLL_IMPEXT string CONDITION_OPENED = "opened"
 
static STATIC_DLL_IMPEXT string CONDITION_CLOSED = "closed"
 

Friends

class GUIDropDown
 
class GUIDropDownOptionController
 

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 drop down controller.

Author
Andreas Drewke
Version
$Id$

Definition at line 30 of file GUIDropDownController.h.

Constructor & Destructor Documentation

◆ GUIDropDownController()

GUIDropDownController ( GUINode node)
private

Private constructor.

Parameters
nodenode

Definition at line 43 of file GUIDropDownController.cpp.

Member Function Documentation

◆ determineDropDownOptionControllers()

void determineDropDownOptionControllers ( )
private

Determine drop down option controllers.

Definition at line 140 of file GUIDropDownController.cpp.

◆ dispose()

void dispose ( )
overridevirtual

Dispose controller.

Implements GUINodeController.

Definition at line 84 of file GUIDropDownController.cpp.

◆ doSearch()

void doSearch ( )
private

Do search.

Definition at line 216 of file GUIDropDownController.cpp.

◆ getValue()

const MutableString & getValue ( )
overridevirtual
Returns
value

Implements GUINodeController.

Definition at line 355 of file GUIDropDownController.cpp.

◆ handleKeyboardEvent()

void handleKeyboardEvent ( GUIKeyboardEvent event)
overridevirtual

Handle keyboard event.

Parameters
eventevent

Implements GUINodeController.

Definition at line 266 of file GUIDropDownController.cpp.

◆ handleMouseEvent()

void handleMouseEvent ( GUINode node,
GUIMouseEvent event 
)
overridevirtual

Handle mouse event.

Parameters
nodenode
eventevent

Implements GUINodeController.

Definition at line 242 of file GUIDropDownController.cpp.

◆ hasValue()

bool hasValue ( )
overridevirtual
Returns
has value

Implements GUINodeController.

Definition at line 350 of file GUIDropDownController.cpp.

◆ initialize()

void initialize ( )
overridevirtual

Initialize controller after element has been created.

Implements GUINodeController.

Definition at line 69 of file GUIDropDownController.cpp.

◆ isDisabled()

bool isDisabled ( )
overridevirtual
Returns
is disabled

Implements GUINodeController.

Definition at line 50 of file GUIDropDownController.cpp.

◆ isOpen()

bool isOpen ( )
private
Returns
drop down open state

Definition at line 93 of file GUIDropDownController.cpp.

◆ onFocusGained()

void onFocusGained ( )
overridevirtual

On focus gained.

Implements GUINodeController.

Definition at line 339 of file GUIDropDownController.cpp.

◆ onFocusLost()

void onFocusLost ( )
overridevirtual

On focus lost.

Implements GUINodeController.

Definition at line 343 of file GUIDropDownController.cpp.

◆ onSubTreeChange()

void onSubTreeChange ( )
overridevirtual

On sub tree change.

Implements GUINodeController.

Definition at line 376 of file GUIDropDownController.cpp.

◆ postLayout()

void postLayout ( )
overridevirtual

Post layout event.

Implements GUINodeController.

Definition at line 89 of file GUIDropDownController.cpp.

◆ select() [1/2]

void select ( GUIElementNode selectedDropDownOptionElementNode)
private

Select by option element node.

Parameters
selectedDropDownOptionElementNodeselected drop down option element node

Definition at line 113 of file GUIDropDownController.cpp.

◆ select() [2/2]

void select ( int  idx)
private

Select by index.

Parameters
idxindex

Definition at line 104 of file GUIDropDownController.cpp.

◆ selectLast()

void selectLast ( )
private

Select last.

Definition at line 203 of file GUIDropDownController.cpp.

◆ selectNext()

void selectNext ( )
private

Select next node.

Definition at line 152 of file GUIDropDownController.cpp.

◆ selectPrevious()

void selectPrevious ( )
private

Select previous.

Definition at line 175 of file GUIDropDownController.cpp.

◆ setDisabled()

void setDisabled ( bool  disabled)
overridevirtual

Set disabled.

Parameters
disableddisabled

Implements GUINodeController.

Definition at line 55 of file GUIDropDownController.cpp.

◆ setValue()

void setValue ( const MutableString value)
overridevirtual

Set value.

Parameters
valuevalue

Implements GUINodeController.

Definition at line 362 of file GUIDropDownController.cpp.

◆ tick()

void tick ( )
overridevirtual

Tick method will be executed once per frame.

Implements GUINodeController.

Definition at line 333 of file GUIDropDownController.cpp.

◆ toggleOpenState()

void toggleOpenState ( )
private

Toggle open state.

Definition at line 126 of file GUIDropDownController.cpp.

◆ unselect()

void unselect ( )
private

Unselect.

Definition at line 98 of file GUIDropDownController.cpp.

Friends And Related Function Documentation

◆ GUIDropDown

friend class GUIDropDown
friend

Definition at line 33 of file GUIDropDownController.h.

◆ GUIDropDownOptionController

friend class GUIDropDownOptionController
friend

Definition at line 34 of file GUIDropDownController.h.

Member Data Documentation

◆ arrowNode

GUIElementNode* arrowNode { nullptr }
private

Definition at line 45 of file GUIDropDownController.h.

◆ CONDITION_CLOSED

string CONDITION_CLOSED = "closed"
staticprivate

Definition at line 40 of file GUIDropDownController.h.

◆ CONDITION_DISABLED

string CONDITION_DISABLED = "disabled"
staticprivate

Definition at line 37 of file GUIDropDownController.h.

◆ CONDITION_ENABLED

string CONDITION_ENABLED = "enabled"
staticprivate

Definition at line 38 of file GUIDropDownController.h.

◆ CONDITION_OPENED

string CONDITION_OPENED = "opened"
staticprivate

Definition at line 39 of file GUIDropDownController.h.

◆ disabled

bool disabled
private

Definition at line 43 of file GUIDropDownController.h.

◆ dropDownContainerNode

GUIParentNode* dropDownContainerNode { nullptr }
private

Definition at line 44 of file GUIDropDownController.h.

◆ dropDownOptionControllers

vector<GUIDropDownOptionController*> dropDownOptionControllers
private

Definition at line 41 of file GUIDropDownController.h.

◆ lastSelectedDropDownOptionControllerIdx

int lastSelectedDropDownOptionControllerIdx { -1 }
private

Definition at line 50 of file GUIDropDownController.h.

◆ open

bool open
private

Definition at line 42 of file GUIDropDownController.h.

◆ search

string search
private

Definition at line 48 of file GUIDropDownController.h.

◆ selectedDropDownOptionControllerIdx

int selectedDropDownOptionControllerIdx { -1 }
private

Definition at line 49 of file GUIDropDownController.h.

◆ textElementNode

GUIElementNode* textElementNode { nullptr }
private

Definition at line 46 of file GUIDropDownController.h.

◆ value

MutableString value
private

Definition at line 47 of file GUIDropDownController.h.


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