wex v25.10.0
wex::menu Class Reference

Adds artid, edit, printing and tool menu items to wxMenu. More...

#include <wex/ui/menu.h>

Public Types

enum  {
  IS_EMPTY = 0 , IS_LINES , IS_POPUP , IS_READ_ONLY ,
  IS_SELECTED , IS_VISUAL , ALLOW_CLEAR , CAN_PASTE
}
 The menu flags. More...
typedef std::bitset< 8 > menu_t
 A typedef containing menu flags.
typedef std::vector< menu_itemmenu_items_t
 A typedef.

Public Member Functions

 menu (menu_t style=menu_t_def(), const menu_items_t &items={{}})
 Default constructor.
 menu (const menu_items_t &items, menu_t style=menu_t_def())
 Constructor with a vector of items.
 menu (const std::string &title, menu_t style)
 Construct a menu with a title.
size_t append (const menu_items_t &items)
 Appends a vector of items.
auto & style () const
 Returns the style.
auto & style ()
 Sets the style.

Static Public Member Functions

static menu_t menu_t_def ()
 Returns default menu flags.

Detailed Description

Adds artid, edit, printing and tool menu items to wxMenu.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The menu flags.

Enumerator
IS_EMPTY 

control is empty

IS_LINES 

the control supports lines

IS_POPUP 

menu should appear as popup, instead of main menu

IS_READ_ONLY 

readonly control

IS_SELECTED 

text is selected somewhere on the control

IS_VISUAL 

the control has visual mode

ALLOW_CLEAR 

add clear item in menu

CAN_PASTE 

add paste item in menu

Member Function Documentation

◆ append()

size_t wex::menu::append ( const menu_items_t & items)

Appends a vector of items.

Returns number of items appended.