wex v24.10.0
Public Member Functions | List of all members
wex::menu_commands< T > Class Template Reference

This class offers a collection (vector) of menu commands, where the exact type of each command is templatized. More...

#include <wex/ui/menu-commands.h>

Public Member Functions

 menu_commands (const std::string &name=std::string(), const std::vector< T > &commands={})
 Default constructor.
 
 menu_commands (const pugi::xml_node &node)
 Constructor using xml node.
 
const T find (const std::string &name) const
 Returns the menu command equal to name specified.
 
const auto & flags_key () const
 Returns the flags key.
 
const auto get_command () const
 Returns the current command.
 
const auto & get_commands () const
 Returns all the commands.
 
const auto & name () const
 Returns the name for this group of commands.
 
bool set_command (int command_no)
 Sets the current command.
 

Detailed Description

template<class T>
class wex::menu_commands< T >

This class offers a collection (vector) of menu commands, where the exact type of each command is templatized.

Member Function Documentation

◆ find()

template<class T >
const T wex::menu_commands< T >::find ( const std::string & name) const
inline

Returns the menu command equal to name specified.

or empty command if name could not be found.

◆ set_command()

template<class T >
bool wex::menu_commands< T >::set_command ( int command_no)
inline

Sets the current command.

Returns true if command was set.

Parameters
command_noa command no from commands