[Home] [Prev] [Next] [Up]
XGMenuBar class
Menu bar manipulation class
Usage:
#include <XMenu.h>
class XGMenuBar;
Description
This class allows manipulation of a menu bar. Normally you wouldn't create one of these, but you would use the various methods to alter the menu bar's contents.
Menu Manipulation
long XGMenuBar::GetNumMenus(void)
This returns the number of menus in the top level of this menu bar.
long XGMenuBar::GetMenu(short index)
This gets the specified menu by a zero-based index. The value returned is a random identifier; this token is used to identify the specified menu elsewhere.
Menu Item Manipulation
short XGMenuBar::GetNumItems(long menu)
This returns the number of items in the specified menu
void XGMenuBar::SetItemID(long menu, short index, long id)
This sets the command ID for the menu item in the menu specified.
long XGMenuBar::GetItemID(long menu, short index)
This gets the command ID for the menu item specified.
void XGMenuBar::SetItemText(long menu, short index, char *label)
This changes the label of the item to the label specified.
void XGMenuBar::GetItemText(long menu, short index, char *label)
This gets the label of the menu item specified.
void XGMenuBar::SetItemShortcut(long menu, short index, char accel)
This sets the item's accelerator to the one specified. Note: only works on the Macintosh. I've got to figure out a way to do this on Windows.
char XGMenuBar::GetItemShortcut(long menu, short index)
This gets the item's accelerator. Note: only works on the Macintosh.
long XGMenuBar::GetSubMenu(long menu, short index)
This gets the submenu for the item specified. If no pop-up or submenu is associated with this menu item, this returns 0.
Menu Item Insertion/Deletion
void XGMenuBar::InsertMenuItem(long menu, short index)
This inserts a blank menu item before the (zero-based) index specified in the menu provided. If index is equal to the number of items in this thing, this appends a blank item after all other items.
void XGMenuBar::DeleteMenuBar(long menu, short index)
This deletes the menu item specified.