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

Offers a single menu item. More...

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

Public Types

enum  type_t {
  CHECK , EDIT , EDIT_INVERT , EXIT ,
  HISTORY , MENU , PANES , PRINT ,
  RADIO , SEPARATOR , SUBMENU , VCS
}
 The item types supported. More...
 

Public Member Functions

 menu_item (type_t=SEPARATOR)
 Default constructor, for a SEPARATOR.
 
 menu_item (wxWindowID id, const std::string &name=std::string(), const data::menu &data=data::menu())
 Constructor for a normal MENU item.
 
 menu_item (wxWindowID id, const std::string &name, type_t type, const data::menu &data=data::menu())
 Constructor for a checkable item.
 
 menu_item (menu *submenu, const std::string &name, wxWindowID id=wxID_ANY, const data::menu &data=data::menu())
 Constructor for a SUBMENU item.
 
 menu_item (const path &p, frame *frame, bool show_modal=true, const data::menu &data=data::menu())
 Constructor for a VCS submenu item.
 
 menu_item (wxWindowID id, file_history &history, const data::menu &data=data::menu())
 Constructor for HISTORY menu item.
 
 menu_item (const frame *frame)
 Constructor for PANES menu items.
 
void append (wex::menu *menu) const
 Appends this item(s) to menu.
 
auto & data () const
 Returns data.
 
auto id () const
 Returns menu item id.
 
bool is_modal () const
 Returns modality.
 
auto & name () const
 Returns menu item name.
 
const auto & path () const
 Returns path.
 
auto type () const
 Returns menu item type.
 

Detailed Description

Offers a single menu item.

Member Enumeration Documentation

◆ type_t

The item types supported.

Enumerator
CHECK 

a check menu item

EDIT 

edit menu items

EDIT_INVERT 

edit invert menu items

EXIT 

exit menu item

HISTORY 

file_history menu items

MENU 

a normal menu item

PANES 

toggle panes from managed frame menu items

PRINT 

print menu items

RADIO 

a radio menu item

SEPARATOR 

a separator menu item If previous item was a separator, it ignores this one.

If no items have yet been appended, it ignores this one.

SUBMENU 

a submenu item

VCS 

vcs menu items

Constructor & Destructor Documentation

◆ menu_item() [1/6]

wex::menu_item::menu_item ( wxWindowID id,
const std::string & name = std::string(),
const data::menu & data = data::menu() )

Constructor for a normal MENU item.

Parameters
idmenu item id
namemenu name or text
datamenu data

◆ menu_item() [2/6]

wex::menu_item::menu_item ( wxWindowID id,
const std::string & name,
type_t type,
const data::menu & data = data::menu() )

Constructor for a checkable item.

Parameters
idmenu item id
namemenu name or text
typeConstructor for a CHECK or RADIO item.
datamenu data

◆ menu_item() [3/6]

wex::menu_item::menu_item ( menu * submenu,
const std::string & name,
wxWindowID id = wxID_ANY,
const data::menu & data = data::menu() )

Constructor for a SUBMENU item.

Parameters
submenumenu submenu
namemenu name or text
idmenu item id
datamenu data

◆ menu_item() [4/6]

wex::menu_item::menu_item ( const path & p,
frame * frame,
bool show_modal = true,
const data::menu & data = data::menu() )

Constructor for a VCS submenu item.

Parameters
pif a filename is specified the menu is built as a submenu, otherwise as menu items.
frameframe
show_modalshows modal dialog if necessary
datamenu data

◆ menu_item() [5/6]

wex::menu_item::menu_item ( wxWindowID id,
file_history & history,
const data::menu & data = data::menu() )

Constructor for HISTORY menu item.

Parameters
idmenu item id
historyobject for maintaining / retrieving history
datamenu data

◆ menu_item() [6/6]

wex::menu_item::menu_item ( const frame * frame)

Constructor for PANES menu items.

Parameters
frameframe to supply toggled panes