SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
UIDropdownCommand Class Reference

Command class for handling dropdown selection events. More...

#include <UIDropdownCommand.h>

Inheritance diagram for UIDropdownCommand:
Inheritance graph

Public Member Functions

 UIDropdownCommand (Dropdown *d, int idx, UICommand *userCmd=nullptr)
 Constructor for UIDropdownCommand.
 
void Execute () override
 Executes the command.
 
- Public Member Functions inherited from UICommand
virtual ~UICommand () override=default
 Virtual destructor.
 
void SetUIComponent (UIComponent *p, UIComponentType t)
 Associates this command with a UIComponent and its type.
 
UIComponentGetUIComponent () const
 Gets the associated UIComponent.
 
UIComponentType GetType () const
 Gets the type of the associated UIComponent.
 
- Public Member Functions inherited from CommandBase
virtual ~CommandBase ()=default
 Destructor for CommandBase.
 

Private Attributes

Dropdowndropdown
 Pointer to the associated Dropdown object.
 
int index
 Index of the option in the dropdown.
 
UICommanduserCommand
 Optional user command to execute when the option is selected.
 

Detailed Description

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:

Dropdown* dropdown = new Dropdown("DropdownTexture");
dropdown->SetOnSelectCommand(0, new MyCommand());
Definition Dropdown.h:14
Dropdown * dropdown
Pointer to the associated Dropdown object.
Definition UIDropdownCommand.h:39

Constructor & Destructor Documentation

◆ UIDropdownCommand()

UIDropdownCommand::UIDropdownCommand ( Dropdown * d,
int idx,
UICommand * userCmd = nullptr )

Constructor for UIDropdownCommand.

Parameters
dPointer to the Dropdown object.
idxIndex of the option in the dropdown.
userCmdOptional user command to execute when the option is selected.

Member Function Documentation

◆ Execute()

void UIDropdownCommand::Execute ( )
overridevirtual

Executes the command.

Implements UICommand.


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