Inheritance diagram for CP_Menu:
Public Member Functions | |
virtual CP_CommandNo | GetCommandNo (SInt16 inMenuItemIndex) |
OSMenu | GetOSMenu () |
OSMenu | GetMenuItems () |
SInt16 | GetID () |
UInt16 | GetMenuItemCount () |
CP_String | GetItemText (SInt16 inMenuItemIndex) |
void | AppendItem (const CP_String &inMenuItem, CP_CommandNo inCommand=CP_CMD_NoCommand) |
void | AppendItem (const CP_String &inItemText, CP_CommandNo inCommand) |
void | AppendSeparator () |
void | DeleteItem (UInt16 inItemIndex) |
void | DeleteItem (UInt16 inItemIndex) |
CP_MenuItems_Array * | GetMenuItemsArray () |
void | UpdateCommandStatus (CP_M_CommandHandler *inCommandHandler) |
Constructor / Destructor | |
CP_Menu () | |
Constructor. | |
CP_Menu (SInt16 inMenuID, const CP_String &inMenuTitle, bool inPopup=false) | |
CP_Menu (const CP_String &inMenuTitle) | |
CP_Menu (SInt16 inMenuID, const CP_String &inMenuTitle, OSMenu inOSMenu) | |
virtual | ~CP_Menu () throw () |
Destructor. | |
Constructor / Destructor | |
CP_Menu (OSMenu innMenu) | |
Constructor. | |
Commands | |
virtual CP_CommandNo | GetCommandNo (SInt16 inMenuItemIndex) |
Getters | |
OSMenu | GetOSMenu () |
SInt16 | GetID () |
SInt16 | GetMenuItemCount () |
CP_String | GetItemText (SInt16 inItemIndex) |
CP_String | GetTitle () const |
CP_CommandNo | GetCommand (SInt16 inItemIndex) |
SInt16 | GetCommandItemIndex (const CP_CommandNo inCommand) |
Getters | |
OSMenu | GetOSMenu () |
SInt16 | GetID () |
SInt16 | GetMenuItemCount () |
CP_String | GetItemText (SInt16 inItemIndex) |
CP_String | GetTitle () const |
CP_CommandNo | GetCommand (SInt16 inItemIndex) |
SInt16 | GetCommandItemIndex (const CP_CommandNo inCommand) |
Items | |
void | AppendItem (const CP_String &inItemText, CP_CommandNo inCommand) |
void | DeleteItem (UInt16 inItemIndex) |
Setters | |
void | SetTitle (const CP_String &inTitle) |
Setters | |
void | SetTitle (const CP_String &inTitle) |
void | SetItemMark (CP_CommandNo inCommand, SInt16 inItemMark, bool inHasMark) |
void | SetItemMark (SInt16 inIndex, SInt16 inItemMark, bool inHasMark) |
Setters | |
void | SetTitle (const CP_String &inTitle) |
Setters | |
void | SetTitle (const CP_String &inTitle) |
Commands | |
virtual CP_CommandNo | GetCommandNo (SInt16 inMenuItemIndex) |
Getters | |
OSMenu | GetOSMenu () |
SInt16 | GetMenuItemCount () |
CP_String | GetTitle () const |
SInt16 | GetID () |
CP_CommandNo | GetCommand (SInt16 inItemIndex) |
SInt16 | GetCommandItemIndex (const CP_CommandNo inCommand) |
CP_String | GetItemText (SInt16 inItemIndex) |
Items | |
void | AppendItem (const CP_String &inItemText, CP_CommandNo inCommand) |
void | DeleteItem (UInt16 inItemIndex) |
Setters | |
void | SetTitle (const CP_String &inTitle) |
void | SetItemMark (CP_CommandNo inCommand, SInt16 inItemMark, bool inHasMark) |
void | SetItemMark (SInt16 inIndex, SInt16 inItemMark, bool inHasMark) |
Getters | |
OSMenu | GetOSMenu () |
SInt16 | GetMenuItemCount () |
CP_String | GetTitle () const |
SInt16 | GetID () |
CP_CommandNo | GetCommand (SInt16 inItemIndex) |
SInt16 | GetCommandItemIndex (const CP_CommandNo inCommand) |
CP_String | GetItemText (SInt16 inItemIndex) |
Setters | |
void | SetTitle (const CP_String &inTitle) |
Protected Member Functions | |
void | LoadOSMenu (SInt16 inMenuID, bool inPopup) |
OSMenu | |
void | LoadOSMenu (SInt16 inMenuID, bool inPopup=false) |
Initialization | |
void | LoadOSMenu (SInt16 inMenuID, bool inPopup=false) |
void | LoadAsPopup (SInt16 inMenuID) |
OSMenu | |
void | LoadOSMenu (SInt16 inMenuID, bool inPopup=false) |
Initialization | |
void | LoadOSMenu (SInt16 inMenuID, bool inPopup=false) |
void | LoadAsPopup (SInt16 inMenuID) |
Protected Attributes | |
SInt16 | fMenuID |
OSMenu | fOSMenu |
CP_CommandsNo_Array * | fCommands |
CP_CommandsNo_Array * | fCommands |
OSMenu | fMenuItems |
CP_MenuItems_Array * | fMenuItemStructs_Linux |
CP_MenuImp_List | fSubMenus |
CP_String | fMenuTitle |
The menu class is also reference counted in case the menu is used in more than one place, and the underlying OS shares a copy of the native menu.
|
Constructor. This creates an empty menu. You will need to do the actual creation of the underlying OSMenu before being able to use this object. |
|
Constructor. This version creates the underlying OSMenu from the passed in menu resource id.
|
|
|
|
Constructor. This version creates the underlying OSMenu from the passed in menu resource id.
|
|
Destructor. |
|
|
|
Return the CP_COMMAND for the passed in inMenuItem. If the inMenuItem does not correspond to an item in this menu, CP_CMD_NoCommand is returned. |
|
|
|
Return the MacOS platform menu reference.
|
|
Return the MacOS platform menu reference.
|
|
Return the Windows platform menu reference.
|
|
|
|
Return the ID of this menu.
|
|
Return the ID of this menu.
|
|
Return the ID of this menu.
|
|
Returns the number of menu items in this menu. If this is an Apple menu, then 1 is returned for the count.
|
|
|
|
|
|
|
|
|
|
|
|
Appends the passed in item to this menu.
|
|
|
|
|
|
|
|
Delets the menu item with the passed in inItemIndex which is 1 based, and should be between 1 and the number of items in this menu.
|
|
|
|
|
|
|
|
Sets the menu title from the passed in string.
|
|
|
|
|
|
Loads the MacOS menu reference with the passed in resource id. If no menu can be found a CP_ThrowIfResFail exception is thrown. Under MacOSX if this is a menu with the id of kCP_FileMenuID a check will be made if there is a Quit item at the end of the menu, and if so it and its separator line (if any) will be removed from this menu. Under MacOSX the edit menu is also checked for a preference item, and it will be removed like the above file menus quit item.
|
|
|
|
|
|
Returns the menu title as a CP_String.
|
|
|
|
|
|
|
|
|
|
|
|
Sets/remove the menu items mark to the passed in inItemMark.
|
|
Sets/remove the menu items mark to the passed in inItemMark.
|
|
Update the status of all of the commands in this menu.
|
|
|
|
Add a reference to our object, returning the new reference count.
|
|
Remove a reference to our object, returning the new reference count. If the count is 0, then this object is also deleted, and 0 is returned.
|
|
Add the object to the topmost auto-release pool. This will ensure that the object is eventually released.
|
|
Returns the current ref count.
|
|
|
|
Menu id of this menu. |
|
MacOS menu reference. |
|
Windows menu reference. |
|
Table of commands for each menu item. |
|
List of structures we maintain about each item in the menu, used to map between CPLAT information for a menu, and the GtkWidget |
|
MacOS menu reference. |
|
Table of commands for each menu item. |