Crazy Eddies GUI System: CEGUI::MenuBase Class Reference

Crazy Eddies GUI System 0.7.6

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
CEGUI::MenuBase Class Reference

Abstract base class for menus. More...

Inheritance diagram for CEGUI::MenuBase:
[legend]
Collaboration diagram for CEGUI::MenuBase:
[legend]

List of all members.

## Public Member Functions
float | getItemSpacing (void) const
| Get the item spacing for this menu.
bool | isMultiplePopupsAllowed (void) const
| Return whether this menu allows multiple popup menus to open at the same time.
bool | getAutoCloseNestedPopups (void) const
| Return whether this menu should close all its open child popups, when it gets hidden.
MenuItem * | getPopupMenuItem (void) const
| Get currently opened MenuItem in this menu. Returns NULL if no menu item is open.
void | setItemSpacing (float spacing)
| Set the item spacing for this menu.
void | changePopupMenuItem (MenuItem *item)
| Change the currently open MenuItem in this menu.
void | setAllowMultiplePopups (bool setting)
| Set whether this menu allows multiple popup menus to be opened simultaneously.
void | setAutoCloseNestedPopups (bool setting)
| Set whether the menu should close all its open child popups, when it gets hidden.
void | setPopupMenuItemClosing ()
| tells the current popup that it should start its closing timer.
| MenuBase (const String &type, const String &name)
| Constructor for MenuBase objects.
virtual | ~MenuBase (void)
| Destructor for MenuBase objects.
## Static Public Attributes
static const String | EventNamespace
| Namespace for global events.
static const String | EventPopupOpened
static const String | EventPopupClosed
## Protected Member Functions
virtual void | onPopupOpened (WindowEventArgs &e)
| handler invoked internally when the a MenuItem attached to this menu opens its popup.
virtual void | onPopupClosed (WindowEventArgs &e)
| handler invoked internally when the a MenuItem attached to this menu closes its popup.
virtual void | onChildRemoved (WindowEventArgs &e)
| Handler called when a child window is removed from this window.
virtual void | onHidden (WindowEventArgs &e)
| Handler called when the window is hidden.
virtual bool | testClassName_impl (const String &class_name) const
| Return whether this window was inherited from the given class name at some point in the inheritance hierarchy.
## Protected Attributes
float | d_itemSpacing
| The spacing in pixels between items.
MenuItem * | d_popupItem
| The currently open MenuItem. NULL if no item is open. If multiple popups are allowed, this means nothing.
bool | d_allowMultiplePopups
| true if multiple popup menus are allowed simultaneously. false if not.
bool | d_autoCloseNestedPopups
| true if the menu should close all its open child popups, when it gets hidden

## Detailed Description

Abstract base class for menus.

## Member Function Documentation

void CEGUI::MenuBase::changePopupMenuItem | ( | MenuItem * | item | ) |

Change the currently open MenuItem in this menu.

Parameters:

  item | Pointer to a MenuItem to open or NULL to close any opened.

bool CEGUI::MenuBase::getAutoCloseNestedPopups | ( | void |  | ) | const`[inline]`

Return whether this menu should close all its open child popups, when it gets hidden.

Returns:
  true if the menu should close all its open child popups, when it gets hidden

float CEGUI::MenuBase::getItemSpacing | ( | void |  | ) | const`[inline]`

Get the item spacing for this menu.

Returns:
  A float value with the current item spacing for this menu

MenuItem* CEGUI::MenuBase::getPopupMenuItem | ( | void |  | ) | const`[inline]`

Get currently opened MenuItem in this menu. Returns NULL if no menu item is open.

Returns:
  Pointer to the MenuItem currently open.

bool CEGUI::MenuBase::isMultiplePopupsAllowed | ( | void |  | ) | const`[inline]`

Return whether this menu allows multiple popup menus to open at the same time.

Returns:
  true if this menu allows multiple popup menus to be opened simultaneously. false if not

virtual void CEGUI::MenuBase::onChildRemoved | ( | WindowEventArgs & | e | ) | `[protected, virtual]`

Handler called when a child window is removed from this window.

Parameters:

  e | WindowEventArgs object whose 'window' pointer field is set the window that has been removed.

Reimplemented from CEGUI::Window.

virtual void CEGUI::MenuBase::onHidden | ( | WindowEventArgs & | e | ) | `[protected, virtual]`

Handler called when the window is hidden.

Parameters:

  e | WindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::PopupMenu.

virtual bool CEGUI::MenuBase::testClassName_impl | ( | const String & | class_name | ) | const`[inline, protected, virtual]`

Return whether this window was inherited from the given class name at some point in the inheritance hierarchy.

Parameters:

  class_name | The class name that is to be checked.

Returns:
  true if this window was inherited from class_name. false if not.

Reimplemented from CEGUI::ItemListBase.

Reimplemented in CEGUI::Menubar, and CEGUI::PopupMenu.

References CEGUI::ItemListBase::testClassName_impl().

Referenced by CEGUI::PopupMenu::testClassName_impl(), and CEGUI::Menubar::testClassName_impl().

## Member Data Documentation

const String CEGUI::MenuBase::EventPopupClosed`[static]`

Event fired when a MenuItem attached to this menu closed a PopupMenu. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the PopupMenu that was closed.

const String CEGUI::MenuBase::EventPopupOpened`[static]`

Event fired when a MenuItem attached to this menu opened a PopupMenu. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the PopupMenu that was opened.