Panda3D
Public Member Functions | Public Attributes

DirectOptionMenu Class Reference

Inheritance diagram for DirectOptionMenu:
DirectButton DirectFrame DirectGuiWidget DirectGuiBase

List of all members.

Public Member Functions

def __init__
def commandFunc
def get
def hidePopupMenu
def index
def selectHighlightedIndex
def set
def setItems
def showPopupMenu

Public Attributes

 cancelFrame
 highlightedIndex
 initFrameSize
 maxHeight
 maxWidth
 maxX
 maxZ
 minX
 minZ
 popupMarker
 popupMenu
 selectedIndex

Detailed Description

DirectOptionMenu(parent) - Create a DirectButton which pops up a
menu which can be used to select from a list of items.
Execute button command (passing the selected item through) if defined
To cancel the popup menu click anywhere on the screen outside of the
popup menu.  No command is executed in this case.

Constructor & Destructor Documentation

def __init__ (   self,
  parent = None,
  kw 
)

Reimplemented from DirectButton.


Member Function Documentation

def commandFunc (   self,
  event 
)
Override popup menu button's command func
Command is executed in response to selecting menu items

Reimplemented from DirectButton.

def get (   self)
Get currently selected item 
def hidePopupMenu (   self,
  event = None 
)
Put away popup and cancel frame 
def index (   self,
  index 
)
def selectHighlightedIndex (   self,
  event = None 
)
Check to see if item is highlighted (by cursor being within
that item).  If so, selected it.  If not, do nothing
def set (   self,
  index,
  fCommand = 1 
)
def setItems (   self)
self['items'] = itemList
Create new popup menu to reflect specified set of items
def showPopupMenu (   self,
  event = None 
)
Make popup visible and try to position it just to right of
mouse click with currently selected item aligned with button.
Adjust popup position if default position puts it outside of
visible screen region

Member Data Documentation

 All Classes Namespaces Functions Variables Properties