Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a set of drop-down menus that are displayed in a horizontal row. More...
#include <omGUIMenuBar.h>
Public Member Functions | |
MenuBar () | |
Create a new menu bar with no name and no menu items. More... | |
~MenuBar () | |
Destroy a menu bar object and all state associated with it. More... | |
Size | getMenuCount () const |
Return the number of menus that this menu bar has. More... | |
Menu * | getMenu (Index index) const |
Get the menu at the specified index in this menu bar. More... | |
Bool | getMenuIndex (const Menu *item, Index &index) const |
Place the index of the specified menu in the output parameter and return if it was found. More... | |
Bool | addMenu (Menu *newMenu) |
Add the specified menu to the end of the list of menus, placing it at the right side of the menu bar. More... | |
Bool | insertMenu (Index index, Menu *newMenu) |
Insert the specified menu at the specified index in this menu bar. More... | |
Bool | setMenu (Index index, Menu *newMenu) |
Set the specified menu at the specified index in the list of menus. More... | |
Bool | removeMenu (const Menu *menu) |
Remove the specified menu from this menu bar. More... | |
Bool | removeMenuAtIndex (Index index) |
Remove the menu at the specified index in the menu list. More... | |
void | clearMenus () |
Remove all menus from this menu bar. More... | |
Window * | getParentWindow () const |
Return the window that is a parent of this menu bar. More... | |
Bool | hasParentWindow () const |
Return whether or not this menu bar belongs to a window. More... | |
virtual void * | getInternalPointer () const |
Get a pointer to this menu bar's platform-specific internal representation. More... | |
Public Member Functions inherited from om::gui::objects::GUIObject | |
virtual | ~GUIObject () |
Destroy a GUI element and release all resources associated with it. More... | |
A class that represents a set of drop-down menus that are displayed in a horizontal row.
om::gui::objects::MenuBar::MenuBar | ( | ) |
Create a new menu bar with no name and no menu items.
om::gui::objects::MenuBar::~MenuBar | ( | ) |
Destroy a menu bar object and all state associated with it.
The destructor for a menu bar should not be called until it is not being used as part of any active GUI.
Size om::gui::objects::MenuBar::getMenuCount | ( | ) | const |
Return the number of menus that this menu bar has.
Get the menu at the specified index in this menu bar.
If the specified index is invalid, a NULL pointer is returned.
index | - the index of the menu to be retrieved. |
Place the index of the specified menu in the output parameter and return if it was found.
If the menu bar contains the specified menu, it places the index of that menu in the output index parameter and returns TRUE. Otherwise, if the menu is not found, the method returns FALSE and no index is retrieved.
Add the specified menu to the end of the list of menus, placing it at the right side of the menu bar.
If the new menu pointer is NULL, the add operation is ignored and FALSE is returned. Otherwise, the menu is added and TRUE is returned, indicating success.
newMenu | - the menu to add to the end of the menu list. |
Insert the specified menu at the specified index in this menu bar.
If the new menu pointer is NULL or if the specified insertion index is greater than the number of menus in the menu bar, FALSE is returned indicating that the insertion operation failed. Otherwise, TRUE is returned and the menu is inserted at the specified index.
newMenu | - the menu to insert in the menu list. |
index | - the index in the menu list at which to insert the new menu. |
Set the specified menu at the specified index in the list of menus.
This method replaces the menu at the specified index with a new menu. If the new menu pointer is NULL, the set operation is ignored.
newMenu | - the menu to set in the menu item list. |
index | - the index at which to set the new item. |
Remove the specified menu from this menu bar.
If the menu pointer is NULL or if the specified menu is not contained in this menu bar, FALSE is returned indicating failure. Otherwise, that menu is removed and TRUE is returned.
menu | - the menu to remove from the menu list. |
Remove the menu at the specified index in the menu list.
If the specified index is invalid, FALSE is returned and the menu bar is unaltered. Otherwise, the menu at that index is removed and TRUE is returned.
index | - the index at which to remove a menu from the menu bar. |
void om::gui::objects::MenuBar::clearMenus | ( | ) |
Remove all menus from this menu bar.
|
inline |
Return the window that is a parent of this menu bar.
If NULL is returned, it indicates that the menu bar is not part of a window.
|
inline |
Return whether or not this menu bar belongs to a window.
|
virtual |
Get a pointer to this menu bar's platform-specific internal representation.
On Mac OS X, this method returns a pointer to a subclass of NSMenu which represents the menu bar.
On Windows, this method returns an HMENU that represents the menu bar.
Implements om::gui::objects::GUIObject.