PopupMenu

Engine/source/gui/editor/popupMenu.h

More...

Private Types

Parent 

Protected Attributes

If true, we treat all the items in the same check group as a radio item, so we uncheck everything else in the group if an item is checked If false, then we don't clear other selections.

bool

Public Functions

bool

Returns true iff this menu contains an item that matches

iD
.

checkItem(S32 pos, bool checked)

implemented on a per-platform basis.

checkRadioItem(S32 firstPos, S32 lastPos, S32 checkPos)

All items at positions firstPos through lastPos are unchecked, and the item at checkPos is checked.

Clears all items.

enableItem(S32 pos, bool enable)

implemented on a per-platform basis.

Returns the number of items in the menu.

Gets the text of a given item.

bool
handleSelect(U32 command, const char * text)

A menu item in this menu has been selected by id.

handleSelectEvent(U32 popID, U32 command)

Helper function to allow menu selections from signal events.

insertItem(S32 pos, const char * title, const char * accelerator, const char * cmd, S32 bitmapIndex)

Set to true if any menu or submenu handles a selection event.

insertSubMenu(S32 pos, const char * title, PopupMenu * submenu)

pass NULL for

title
to insert a separator returns the menu item's ID, or -1 on failure.

bool
bool
bool

Called when the object is added to the sim.

bool

Callback for when message objects are received.

bool
onMessageReceived(StringTableEntry queue, const char * msg, const char * data)

Callback for when messages are received.

Called when the object is removed from the sim.

removeItem(S32 itemPos)

remove the menu item at

itemPos
if the item has a submenu, it is removed from the mSubmenus list.

bool
setItem(S32 pos, const char * title, const char * accelerator, const char * cmd)

Sets the name title and accelerator for an existing item.

setVisible(bool isVis)
showPopup(GuiCanvas * owner, S32 x, S32 y)

Displays this menu as a popup menu and blocks until the user has selected an item.

Public Static Functions

Detailed Description

Private Types

typedef SimObject Parent 

Public Friends

Protected Attributes

StringTableEntry mBarTitle 
S32 mBitmapIndex 
RectI mBounds 
bool mDrawBitmapOnly 
bool mDrawBorder 
bool mIsSubmenu 
GuiMenuBar * mMenuBarCtrl 
Vector< MenuItem > mMenuItems 
bool mRadioSelection 
GuiPopupMenuTextListCtrl * mTextList 

If true, we treat all the items in the same check group as a radio item, so we uncheck everything else in the group if an item is checked If false, then we don't clear other selections.

bool mVisible 

Public Static Attributes

PopupMenuEvent smPopupMenuEvent 
bool smSelectionEventHandled 

Public Functions

PopupMenu()

~PopupMenu()

canHandleID(U32 iD)

Returns true iff this menu contains an item that matches

iD
.

implemented on a per-platform basis. TODO: factor out common code

checkItem(S32 pos, bool checked)

implemented on a per-platform basis.

checkRadioItem(S32 firstPos, S32 lastPos, S32 checkPos)

All items at positions firstPos through lastPos are unchecked, and the item at checkPos is checked.

implemented on a per-platform basis.

clearItems()

Clears all items.

DECLARE_CONOBJECT(PopupMenu )

enableItem(S32 pos, bool enable)

implemented on a per-platform basis.

getItemCount()

Returns the number of items in the menu.

getItemText(S32 pos)

Gets the text of a given item.

getMenuBarCtrl()

handleSelect(U32 command, const char * text)

A menu item in this menu has been selected by id.

Submenus are given a chance to respond to the command first. If no submenu can handle the command id, this menu handles it. The script callback this::onSelectItem( position, text) is called. If

text
is null, then the text arg passed to script is the text of the selected menu item. implemented on a per-platform basis. TODO: factor out common code

handleSelectEvent(U32 popID, U32 command)

Helper function to allow menu selections from signal events.

Wraps canHandleID() and handleSelect() in one function without changing their internal functionality, so it should work regardless of platform.

hidePopup()

hidePopupSubmenus()

insertItem(S32 pos, const char * title, const char * accelerator, const char * cmd, S32 bitmapIndex)

Set to true if any menu or submenu handles a selection event.

pass NULL for

title
to insert a separator returns the menu item's ID, or -1 on failure. implementd on a per-platform basis. TODO: factor out common code

insertSubMenu(S32 pos, const char * title, PopupMenu * submenu)

pass NULL for

title
to insert a separator returns the menu item's ID, or -1 on failure.

adds the submenu to the mSubmenus vector. implemented on a per-platform basis. TODO: factor out common code

isItemChecked(S32 pos)

isVisible()

onAdd()

Reimplemented from: SimObject

onMenuSelect()

onMessageObjectReceived(StringTableEntry queue, Message * msg)

Reimplemented from: Dispatcher::IMessageListener

onMessageReceived(StringTableEntry queue, const char * msg, const char * data)

Reimplemented from: Dispatcher::IMessageListener

onRemove()

Reimplemented from: SimObject

removeItem(S32 itemPos)

remove the menu item at

itemPos
if the item has a submenu, it is removed from the mSubmenus list.

implemented on a per-platform basis. TODO: factor out common code

setItem(S32 pos, const char * title, const char * accelerator, const char * cmd)

Sets the name title and accelerator for an existing item.

setVisible(bool isVis)

showPopup(GuiCanvas * owner, S32 x, S32 y)

Displays this menu as a popup menu and blocks until the user has selected an item.

Parameters:

canvas

the owner to show this popup associated with

x

window local x coordinate at which to display the popup menu

y

window local y coordinate at which to display the popup menu implemented on a per-platform basis.

Public Static Functions

initPersistFields()