Command class for handling dropdown selection events. More...
#include <UIDropdownCommand.h>
Public Member Functions | |
UIDropdownCommand (Dropdown *d, int idx, UICommand *userCmd=nullptr) | |
Constructor for UIDropdownCommand. | |
void | Execute () override |
Executes the command. | |
![]() | |
virtual | ~UICommand () override=default |
Virtual destructor. | |
void | SetUIComponent (UIComponent *p, UIComponentType t) |
Associates this command with a UIComponent and its type. | |
UIComponent * | GetUIComponent () const |
Gets the associated UIComponent. | |
UIComponentType | GetType () const |
Gets the type of the associated UIComponent. | |
![]() | |
virtual | ~CommandBase ()=default |
Destructor for CommandBase. | |
Private Attributes | |
Dropdown * | dropdown |
Pointer to the associated Dropdown object. | |
int | index |
Index of the option in the dropdown. | |
UICommand * | userCommand |
Optional user command to execute when the option is selected. | |
Command class for handling dropdown selection events.
The UIDropdownCommand class is used to handle the selection of options in a dropdown menu. It extends the UICommand class and provides functionality to execute a command when an option is selected or when the dropdown is toggled.
Example usage:
Constructor for UIDropdownCommand.
d | Pointer to the Dropdown object. |
idx | Index of the option in the dropdown. |
userCmd | Optional user command to execute when the option is selected. |
|
overridevirtual |
Executes the command.
Implements UICommand.