Contents Up Previous Next

wxMenuBar: wxWindow

A menu bar is a series of menus accessible from the top of a frame. Selecting a title pulls down a menu; selecting a menu item causes a MenuSelection message to be passed to the frame with the menu item integer id as the only argument.

wxMenuBar::wxMenuBar
wxMenuBar::~wxMenuBar
wxMenuBar::Append
wxMenuBar::Check
wxMenuBar::Checked
wxMenuBar::Enable
wxMenuBar::EnableTop
wxMenuBar::FindMenuItem
wxMenuBar::FindItemById
wxMenuBar::GetHelpString
wxMenuBar::GetLabel
wxMenuBar::GetLabelTop
wxMenuBar::SetHelpString
wxMenuBar::SetLabel
wxMenuBar::SetLabelTop


wxMenuBar::wxMenuBar

void wxMenuBar(void)

void wxMenuBar(int n, wxMenu *menus[], char *titles[])

Construct a menu bar. In the second form, the calling program must have created an array of menus and an array of titles. Do not use the submenus again after this call.


wxMenuBar::~wxMenuBar

void ~wxMenuBar(void)

Destructor, destroying the menu bar and removing it from the parent frame (if any).


wxMenuBar::Append

void Append(wxMenu *menu, char *title)

Adds the item to the end of the menu bar. Do not use menu after this call: it will be deallocated by wxWindows.


wxMenuBar::Check

void Check(int id, Bool flag)

If flag is TRUE, checks the given menu item, else unchecks it. MS Windows, Motif only. Only use this when the menu bar has been associated with a frame; otherwise, use the wxMenu equivalent call.


wxMenuBar::Checked

Bool Checked(int id)

Returns TRUE if the given menu item is currently checked, FALSE otherwise.


wxMenuBar::Enable

void Enable(int id, Bool flag)

If flag is TRUE, enables the given menu item, else disables it (greys it). MS Windows, Motif only. Only use this when the menu bar has been associated with a frame; otherwise, use the wxMenu equivalent call.


wxMenuBar::EnableTop

void EnableTop(int pos, Bool flag)

If flag is TRUE, enables the menu at the given position, else disables it (greys it). Only use this when the menu bar has been associated with a frame.


wxMenuBar::FindMenuItem

int FindMenuItem(char *menuString, char *itemString)

Finds the menu item id for a menu name/menu item string pair, or -1 if none found. Any special menu codes are stripped out of source and target strings before matching.


wxMenuBar::FindItemById

wxMenuItem * FindItemById(int itemId)

Finds the menu item object associated with the given menu item identifier, returning NULL if not found.


wxMenuBar::GetHelpString

char * GetHelpString(int itemId)

Gets the help string associated with the menu item identifer (or NULL if there is no help string or the item was not found).


wxMenuBar::GetLabel

char * GetLabel(int itemId)

Returns a temporary pointer to the label of the given menu item. Use only after the menubar has been associated with a frame with wxFrame::SetMenuBar.


wxMenuBar::GetLabelTop

char * GetLabelTop(int pos)

Returns a temporary pointer to the label of the given top-level menu. pos is the position of a menu on the menu bar. Use only after the menubar has been associated with a frame with wxFrame::SetMenuBar.


wxMenuBar::SetHelpString

void SetHelpString(int itemId, char *helpString)

Sets the help string associated with the menu item identifer.


wxMenuBar::SetLabel

void SetLabel(int itemId, char *label)

Sets the label of the given menu item. Use only after the menubar has been associated with a frame with wxFrame::SetMenuBar.


wxMenuBar::SetLabelTop

void SetLabelTop(int pos, char *label)

Sets the label of the given top-level menu. pos is the position of a menu on the menu bar. Use only after the menubar has been associated with a frame with wxFrame::SetMenuBar.