Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::gui::objects::MenuBar Class Reference

A class that represents a set of drop-down menus that are displayed in a horizontal row. More...

#include <omGUIMenuBar.h>

Inheritance diagram for om::gui::objects::MenuBar:
om::gui::objects::GUIObject

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...
 
MenugetMenu (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...
 
WindowgetParentWindow () 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...
 

Detailed Description

A class that represents a set of drop-down menus that are displayed in a horizontal row.

Constructor & Destructor Documentation

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.

Member Function Documentation

Size om::gui::objects::MenuBar::getMenuCount ( ) const

Return the number of menus that this menu bar has.

Menu* om::gui::objects::MenuBar::getMenu ( Index  index) const

Get the menu at the specified index in this menu bar.

If the specified index is invalid, a NULL pointer is returned.

Parameters
index- the index of the menu to be retrieved.
Returns
a pointer to the menu at the specified index.
Bool om::gui::objects::MenuBar::getMenuIndex ( const Menu item,
Index index 
) const

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.

Bool om::gui::objects::MenuBar::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.

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.

Parameters
newMenu- the menu to add to the end of the menu list.
Bool om::gui::objects::MenuBar::insertMenu ( Index  index,
Menu newMenu 
)

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.

Parameters
newMenu- the menu to insert in the menu list.
index- the index in the menu list at which to insert the new menu.
Bool om::gui::objects::MenuBar::setMenu ( Index  index,
Menu newMenu 
)

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.

Parameters
newMenu- the menu to set in the menu item list.
index- the index at which to set the new item.
Bool om::gui::objects::MenuBar::removeMenu ( const Menu menu)

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.

Parameters
menu- the menu to remove from the menu list.
Returns
whether or not the remove operation was successful.
Bool om::gui::objects::MenuBar::removeMenuAtIndex ( Index  index)

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.

Parameters
index- the index at which to remove a menu from the menu bar.
Returns
whether or not the remove operation was successful.
void om::gui::objects::MenuBar::clearMenus ( )

Remove all menus from this menu bar.

Window* om::gui::objects::MenuBar::getParentWindow ( ) const
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.

Bool om::gui::objects::MenuBar::hasParentWindow ( ) const
inline

Return whether or not this menu bar belongs to a window.

virtual void* om::gui::objects::MenuBar::getInternalPointer ( ) const
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.


The documentation for this class was generated from the following file: