NvUIPopupMenu Class Reference

The NvUIPopupMenu is a specialized container class that simulates a popup menu. More...

#include <NvUI.h>

Inheritance diagram for NvUIPopupMenu:

NvUIContainer NvUIElement

List of all members.

Public Member Functions

 NvUIPopupMenu (NvUIPopup *btn, float width, float height, NvUIGraphic *bg=NULL)
 Default constructor.
virtual ~NvUIPopupMenu ()
 Default destructor.
virtual NvUIEventResponse HandleEvent (const NvGestureEvent &ev, NvUST timeUST, NvUIElement *hasFocus)
 Override to ensure we take down the popup menu at the right times.


Detailed Description

The NvUIPopupMenu is a specialized container class that simulates a popup menu.

Note that this class itself does minimal work to make the 'menu magic' happen. It is really the contents of our container, the 'menu item' elements themselves, that control the real functionality and visuals of a given NvUIPopupMenu.

There is no default implementation of menu items or other substructure, aside from currently we add items vertically in order (a subclass could implement different layout for a specialized menu with known visual structure). The items should generally be NvUIButtons, but could also be static graphics for dividers, or static text for other status in the menu.

See also:
NvUIPopup

NvUIContainer


Constructor & Destructor Documentation

NvUIPopupMenu::NvUIPopupMenu ( NvUIPopup btn,
float  width,
float  height,
NvUIGraphic bg = NULL 
)

Default constructor.

Basically just sets up our NvUIContainer superclass for us.

Parameters:
btn The NvUIPopup that owns this popup menu.
width The base width of the menu.
height The base height of the menu (noting actual container height changes as items are added...).
bg [optional] Background graphic to display under the menu items themselves. For a menu, handy to have an NvUIGraphicFrame for the background element.
See also:
NvUIPopup

NvUIContainer


Member Function Documentation

virtual NvUIEventResponse NvUIPopupMenu::HandleEvent ( const NvGestureEvent ev,
NvUST  timeUST,
NvUIElement hasFocus 
) [virtual]

Override to ensure we take down the popup menu at the right times.

We first allow the normal inherited container handling to occur. If nothing in the container handles the event, and the event was a press or a release, we tell our NvUIPopup button to finish the popup.

If something in the container DID handle the event, and the event was a release, and there was NO reaction to the event, we presume there was a release inside the container but not inside an item, and thus also tell out button to finish the popup.

See also:
NvUIContainer

NvUIPopup

PopupFinish

Reimplemented from NvUIContainer.


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