Panda3D
Public Member Functions | Public Attributes | List of all members
DirectOptionMenu Class Reference
Inheritance diagram for DirectOptionMenu:
DirectButton DirectFrame DirectGuiWidget DirectGuiBase

Public Member Functions

def __init__ (self, parent=None, kw)
 
def commandFunc (self, event)
 
def get (self)
 
def hidePopupMenu (self, event=None)
 
def index (self, index)
 
def selectHighlightedIndex (self, event=None)
 
def set (self, index, fCommand=1)
 
def setItems (self)
 
def showPopupMenu (self, event=None)
 
- Public Member Functions inherited from DirectButton
def __init__ (self, parent=None, kw)
 
def commandFunc (self, event)
 
def setClickSound (self)
 
def setCommandButtons (self)
 
def setRolloverSound (self)
 
- Public Member Functions inherited from DirectFrame
def __init__ (self, parent=None, kw)
 
def destroy (self)
 
def setGeom (self)
 
def setImage (self)
 
def setText (self)
 
- Public Member Functions inherited from DirectGuiWidget
def __init__ (self, parent=None, kw)
 
def copyOptions (self, other)
 
def destroy (self)
 
def disableEdit (self)
 
def editStart (self, event)
 
def editStop (self, event)
 
def enableEdit (self)
 
def frameInitialiseFunc (self)
 
def getBounds (self, state=0)
 
def getCenter (self)
 
def getFrameType (self, state=0)
 
def getHeight (self)
 
def getWidth (self)
 
def guiDragTask (self, state)
 
def guiScaleTask (self, state)
 
def printConfig (self, indent=0)
 
def resetFrameSize (self)
 
def setBorderUvWidth (self)
 
def setBorderWidth (self)
 
def setFrameColor (self)
 
def setFrameSize (self, fClearFrame=0)
 
def setFrameTexture (self)
 
def setFrameVisibleScale (self)
 
def setProp (self, propString, value)
 
def setRelief (self, fSetStyle=1)
 
def setState (self)
 
def taskName (self, idString)
 
def uniqueName (self, idString)
 
def updateFrameStyle (self)
 
- Public Member Functions inherited from DirectGuiBase
def __init__ (self)
 
def __setitem__ (self, key, value)
 
def addoptions (self, optionDefs, optionkeywords)
 
def bind (self, event, command, extraArgs=[])
 
def cget (self, option)
 
def component (self, name)
 
def components (self)
 
def configure (self, option=None, kw)
 
def createcomponent (self, componentName, componentAliases, componentGroup, widgetClass, widgetArgs, kw)
 
def defineoptions (self, keywords, optionDefs, dynamicGroups=())
 
def destroy (self)
 
def destroycomponent (self, name)
 
def hascomponent (self, component)
 
def initialiseoptions (self, myClass)
 
def isinitoption (self, option)
 
def options (self)
 
def postInitialiseFunc (self)
 
def unbind (self, event)
 

Public Attributes

 cancelFrame
 
 highlightedIndex
 
 initFrameSize
 
 maxHeight
 
 maxWidth
 
 maxX
 
 maxZ
 
 minX
 
 minZ
 
 popupMarker
 
 popupMenu
 
 selectedIndex
 
- Public Attributes inherited from DirectGuiWidget
 bounds
 
 frameStyle
 
 guiId
 
 guiItem
 
 ll
 
 stateNodePath
 
 ur
 
- Public Attributes inherited from DirectGuiBase
 fInit
 
 guiId
 
 postInitialiseFuncList
 

Additional Inherited Members

- Static Public Attributes inherited from DirectFrame
tuple DefDynGroups = ('text', 'geom', 'image')
 
- Static Public Attributes inherited from DirectGuiWidget
float gridSpacing = 0.05
 
dictionary guiDict = {}
 
 guiEdit = get_config_showbase().GetBool('direct-gui-edit', 0)
 
 inactiveInitState = DGG.NORMAL
 
int snapToGrid = 0
 

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

◆ __init__()

def __init__ (   self,
  parent = None,
  kw 
)

Member Function Documentation

◆ commandFunc()

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

◆ get()

def get (   self)
Get currently selected item 

◆ hidePopupMenu()

def hidePopupMenu (   self,
  event = None 
)
Put away popup and cancel frame 

◆ index()

def index (   self,
  index 
)

◆ selectHighlightedIndex()

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

◆ set()

def set (   self,
  index,
  fCommand = 1 
)

◆ setItems()

def setItems (   self)
self['items'] = itemList
Create new popup menu to reflect specified set of items

◆ showPopupMenu()

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

◆ cancelFrame

cancelFrame

◆ highlightedIndex

highlightedIndex

◆ initFrameSize

initFrameSize

◆ maxHeight

maxHeight

◆ maxWidth

maxWidth

◆ maxX

maxX

◆ maxZ

maxZ

◆ minX

minX

◆ minZ

minZ

◆ popupMarker

popupMarker

◆ popupMenu

popupMenu

◆ selectedIndex

selectedIndex