wex v24.10.0
Public Types | Public Member Functions | List of all members
wex::menu_command Class Reference

This class contains a single menu command. More...

#include <wex/core/menu-command.h>

Inheritance diagram for wex::menu_command:
Inheritance graph
[legend]

Public Types

enum  include { INCLUDE_SUBCOMMAND = 0 , INCLUDE_ACCELL }
 The command flags as used by get_command. More...
 
enum  {
  IS_LINES = 0 , IS_ASKED , IS_POPUP , IS_MAIN ,
  IS_SELECTED , IS_VISUAL , SEPARATOR , ELLIPSES
}
 The command type flags as read from xml file. More...
 
typedef std::bitset< 2 > include_t
 A typedef containing command flags.
 
typedef std::bitset< 8 > type_t
 A typedef containing type flags.
 

Public Member Functions

 menu_command (const pugi::xml_node &node=pugi::xml_node())
 Default constructor using xml node.
 
bool ask_flags () const
 Returns true if flags are requested for this command.
 
const std::string & control () const
 Returns the control key.
 
const std::string & flags () const
 Returns the flags.
 
const std::string get_command (include_t type=include_t().set(INCLUDE_SUBCOMMAND)) const
 Returns the command (and subcommand and accelerators if necessary).
 
const std::string & submenu () const
 Returns the submenu.
 
bool is_help () const
 Returns true if this is a help like command.
 
const type_ttype () const
 Returns the type.
 
const std::string & text () const
 Returns the menu text.
 
bool use_subcommand () const
 Returns true if a subcommand can be used for this command.
 

Detailed Description

This class contains a single menu command.

The menu command is meant to be used as command as e.g. vcs or debug command directly.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The command type flags as read from xml file.

Enumerator
IS_LINES 

command supports lines

IS_ASKED 

command is followed by an ellipses if asked

IS_POPUP 

command in popup menu

IS_MAIN 

command in main menu

IS_SELECTED 

command only shown if text selected

IS_VISUAL 

command only shown if visual mode

SEPARATOR 

command is followed by a separator

ELLIPSES 

command is followed by an ellipses

◆ include

The command flags as used by get_command.

Enumerator
INCLUDE_SUBCOMMAND 

includes a possible subcommand

INCLUDE_ACCELL 

includes accelerator

Member Function Documentation

◆ ask_flags()

bool wex::menu_command::ask_flags ( ) const
inline

Returns true if flags are requested for this command.

All commands, except help, and if the flags are present in menus.xml, support flags.