The Battle for Wesnoth  1.19.5+dev
Public Member Functions | Public Attributes | List of all members
hotkey::ui_command Struct Reference

Used as the main paramneter for can_execute_command/do_execute_command These functions are used to execute hotkeys but also to execute menu items, (Most menu items point to the same action as a hotkey but not all) More...

#include <command_executor.hpp>

Public Member Functions

 ui_command (hotkey::HOTKEY_COMMAND hotkey_command, std::string_view id, int index=-1)
 
 ui_command (const hotkey::hotkey_command &cmd, int index=-1)
 
 ui_command (std::string_view id, int index=-1)
 

Public Attributes

hotkey::HOTKEY_COMMAND hotkey_command
 The hotkey::HOTKEY_COMMAND associated with this action, HOTKEY_NULL for actions that don't allow hotkey binding. More...
 
std::string id
 The string command, never empty, describes the action uniquely. when the action is the result of a menu click. More...
 
int index
 When this action was the result of a menu click, this is the index of the clicked item in the menu. More...
 

Detailed Description

Used as the main paramneter for can_execute_command/do_execute_command These functions are used to execute hotkeys but also to execute menu items, (Most menu items point to the same action as a hotkey but not all)

Definition at line 31 of file command_executor.hpp.

Constructor & Destructor Documentation

◆ ui_command() [1/3]

hotkey::ui_command::ui_command ( hotkey::HOTKEY_COMMAND  hotkey_command,
std::string_view  id,
int  index = -1 
)
inline

Definition at line 44 of file command_executor.hpp.

◆ ui_command() [2/3]

hotkey::ui_command::ui_command ( const hotkey::hotkey_command cmd,
int  index = -1 
)
inlineexplicit

Definition at line 49 of file command_executor.hpp.

◆ ui_command() [3/3]

hotkey::ui_command::ui_command ( std::string_view  id,
int  index = -1 
)
inlineexplicit

Member Data Documentation

◆ hotkey_command

hotkey::HOTKEY_COMMAND hotkey::ui_command::hotkey_command

◆ id

std::string hotkey::ui_command::id

The string command, never empty, describes the action uniquely. when the action is the result of a menu click.

Definition at line 41 of file command_executor.hpp.

Referenced by playsingle_controller::hotkey_handler::can_execute_command(), and play_controller::hotkey_handler::do_execute_command().

◆ index

int hotkey::ui_command::index

When this action was the result of a menu click, this is the index of the clicked item in the menu.

Definition at line 43 of file command_executor.hpp.

Referenced by editor::editor_controller::can_execute_command(), editor::editor_controller::do_execute_command(), and editor::editor_controller::get_action_state().


The documentation for this struct was generated from the following file: