class XGMenu

Declared in <XMenu.h>

This defines a single menu. This is an abstraction for a single menu in the menu bar.


Construction/Destruction

XGMenu::XGMenu
XGMenu::XGMenu
XGMenu::XGMenu
XGMenu::~XGMenu

Menu Attributes

XGMenu::DeleteItem
XGMenu::GetLength
XGMenu::InsertItem

Item Attributes

XGMenu::GetItemID
XGMenu::GetSubMenu
XGMenu::GetText
XGMenu::SetItemID
XGMenu::SetMenu

Check/Select attributes

XGMenu::SetCheckmark
XGMenu::SetEnabled


Construction/Destruction

XGMenu::XGMenu

Usage: void XGListView::ScrollInRange(long index)

The Macintosh version of this constructs this menu using the menu handle provided. If the 'dup' flag is set, it indicates that this menu handle is 'duplicated'; that is, the handle should not necessarly be deleted when I'm disposed of.

XGMenu::XGMenu

Usage: XGMenu::XGMenu(HMENU mh)

The Windows version of this class constructs this menu object from the menu handle provided.

XGMenu::XGMenu

Usage: XGMenu::XGMenu(unsigned char**ptr):fMenuData(sizeof(XGSMenuItem))

The X version of this routine constructs this menu object from the resource data pointed to by ptr.

XGMenu::~XGMenu

Usage: XGMenu::~XGMenu()

Destructor for this thing. Note that I don't dispose of the menu (except in the case of MS Windows, when the fInstalled bit is clear) because I presume on the Macintosh menus live forever, and on Windows, they are destroyed elsewhere.

Menu Attributes

XGMenu::DeleteItem

Usage: void XGMenu::DeleteItem(long index)

Delete a single item from the menu

XGMenu::GetLength

Usage: long XGMenu::GetLength(void)const

Return the number of elements in this thing

XGMenu::InsertItem

Usage: void XGMenu::InsertItem(long index)

This inserts a new (untitled) item into the menu.

Item Attributes

XGMenu::GetItemID

Usage: short XGMenu::GetItemID(long index)const

Get the command ID

XGMenu::GetSubMenu

Usage: XGMenu*XGMenu::GetSubMenu(long index)const

Get the menu which is the submenu of this menu item If one doesn't exist, this returns NULL

XGMenu::GetText

Usage: void XGMenu::GetText(long index,char*text)const

Get the text from this menu item. Treat null string as separator

XGMenu::SetItemID

Usage: void XGMenu::SetItemID(long index,short id)

Set the command ID

XGMenu::SetMenu

Usage: void XGMenu::SetText(long index,const char*text)

Set the menu item text to the text specified

Check/Select attributes

XGMenu::SetCheckmark

Usage: void XGMenu::SetCheckmark(long index,short mark)

Set the checkmark to the mark specified. Used internally by YAAF to check or uncheck this item.

XGMenu::SetEnabled

Usage: void XGMenu::SetEnabled(long index,bool enable)

Set this menu item as enabled. Used internally by YAAF to enable or disable this menu item.