Public Member Functions | Private Attributes
vgui_menu Class Reference

Representation of a menu for both pop-up and menubar menus. More...

#include <vgui_menu.h>

List of all members.

Public Member Functions

 vgui_menu ()
 Constructor - creates an empty menu.
 vgui_menu (vgui_menu const &)
 Constructor - creates a menu same as the given menu.
vgui_menuoperator= (vgui_menu const &)
 Make this menu equal to the given menu.
 ~vgui_menu ()
 Destructor - clears the menu.
void add (vcl_string const &, vgui_command_sptr c, vgui_key key=vgui_KEY_NULL, vgui_modifier modifiers=vgui_MODIFIER_NULL)
 Add given command to this menu.
void add (vcl_string const &, vgui_menu_callback_no_client_data f, vgui_key key=vgui_KEY_NULL, vgui_modifier modifiers=vgui_MODIFIER_NULL)
 Add given callback function to this menu.
void add (vcl_string const &, vgui_menu_callback f, void const *client_data, vgui_key key=vgui_KEY_NULL, vgui_modifier modifiers=vgui_MODIFIER_NULL)
 Add callback function with client data to this menu.
void add (vcl_string const &, vgui_menu const &, vgui_key key=vgui_KEY_NULL, vgui_modifier modifiers=vgui_MODIFIER_NULL)
 Add given submenu to this menu.
void separator ()
 Add separator to this menu.
void include (vgui_menu const &that)
 Add the given menu to the end of this menu.
void clear ()
 Empty this menu.
unsigned size () const
 Return the number of items in this menu.
vgui_menu_item const & operator[] (unsigned i) const
 Get the menu item using the [] index operator.

Private Attributes

vcl_vector< vgui_menu_itemitems

Detailed Description

Representation of a menu for both pop-up and menubar menus.

Building the menu:

NB. empty strings are not acceptable names.

Definition at line 98 of file vgui_menu.h.


Constructor & Destructor Documentation

vgui_menu::vgui_menu ( ) [inline]

Constructor - creates an empty menu.

Definition at line 104 of file vgui_menu.h.

vgui_menu::vgui_menu ( vgui_menu const &  that)

Constructor - creates a menu same as the given menu.

Definition at line 53 of file vgui_menu.cxx.

vgui_menu::~vgui_menu ( ) [inline]

Destructor - clears the menu.

Definition at line 113 of file vgui_menu.h.


Member Function Documentation

void vgui_menu::add ( vcl_string const &  n,
vgui_command_sptr  c,
vgui_key  key = vgui_KEY_NULL,
vgui_modifier  modifiers = vgui_MODIFIER_NULL 
)

Add given command to this menu.

Definition at line 71 of file vgui_menu.cxx.

void vgui_menu::add ( vcl_string const &  n,
vgui_menu_callback_no_client_data  f,
vgui_key  key = vgui_KEY_NULL,
vgui_modifier  modifiers = vgui_MODIFIER_NULL 
)

Add given callback function to this menu.

Definition at line 96 of file vgui_menu.cxx.

void vgui_menu::add ( vcl_string const &  n,
vgui_menu_callback  f,
void const *  client_data,
vgui_key  key = vgui_KEY_NULL,
vgui_modifier  modifiers = vgui_MODIFIER_NULL 
)

Add callback function with client data to this menu.

Definition at line 85 of file vgui_menu.cxx.

void vgui_menu::add ( vcl_string const &  n,
vgui_menu const &  m,
vgui_key  key = vgui_KEY_NULL,
vgui_modifier  modifiers = vgui_MODIFIER_NULL 
)

Add given submenu to this menu.

Definition at line 106 of file vgui_menu.cxx.

void vgui_menu::clear ( ) [inline]

Empty this menu.

Definition at line 147 of file vgui_menu.h.

void vgui_menu::include ( vgui_menu const &  that)

Add the given menu to the end of this menu.

Definition at line 127 of file vgui_menu.cxx.

vgui_menu & vgui_menu::operator= ( vgui_menu const &  that)

Make this menu equal to the given menu.

Definition at line 58 of file vgui_menu.cxx.

vgui_menu_item const& vgui_menu::operator[] ( unsigned  i) const [inline]

Get the menu item using the [] index operator.

Definition at line 153 of file vgui_menu.h.

void vgui_menu::separator ( )

Add separator to this menu.

Definition at line 120 of file vgui_menu.cxx.

unsigned vgui_menu::size ( ) const [inline]

Return the number of items in this menu.

Definition at line 150 of file vgui_menu.h.


Member Data Documentation

vcl_vector<vgui_menu_item> vgui_menu::items [private]

Definition at line 100 of file vgui_menu.h.


The documentation for this class was generated from the following files: