wex v24.04.0
Static Public Member Functions | List of all members
wex::menus Class Reference

This class offers methods to handle menu commands. More...

#include <wex/ui/menus.h>

Static Public Member Functions

template<typename T >
static size_t add_commands (const pugi::xml_node &node, T &commands)
 Adds commands from xml to vector of menu commands.
 
template<typename T >
static size_t build_menu (const T &commands, int base_id, menu *menu)
 Builds menu from vector of menu commands.
 
template<typename T >
static bool load (const std::string &name, T &entries)
 Loads entries from xml document.
 
static const wex::path path ()
 Returns the xml filename.
 

Detailed Description

This class offers methods to handle menu commands.

Member Function Documentation

◆ add_commands()

template<typename T >
size_t wex::menus::add_commands ( const pugi::xml_node & node,
T & commands )
static

Adds commands from xml to vector of menu commands.

Returns number of commands added.

Parameters
nodenode with data
commandsthe commands to be filled

◆ build_menu()

template<typename T >
size_t wex::menus::build_menu ( const T & commands,
int base_id,
menu * menu )
static

Builds menu from vector of menu commands.

Returns number of items added to menu.

Parameters
commandsthe commands
base_idbase id for command
menumenu to build

◆ load()

template<typename T >
bool wex::menus::load ( const std::string & name,
T & entries )
static

Loads entries from xml document.

Returns false if document could not be loaded, or no entries were added.