Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
DirectDialog Class Reference
Inheritance diagram for DirectDialog:

## Public Member Functions
| __init__ (self, parent=None, **kw)
| buttonCommand (self, value, event=None)
| cleanup (self)
| configureDialog (self)
| destroy (self)
| hide (self)
| setMessage (self, message)
| show (self)
Public Member Functions inherited from DirectFrame
| __init__ (self, parent=None, **kw)
| clearGeom (self)
| clearImage (self)
| clearText (self)
| setGeom (self, geom=None)
| setImage (self, image=None)
| setText (self, text=None)
Public Member Functions inherited from DirectGuiWidget
| __init__ (self, parent=None, **kw)
| copyOptions (self, other)
| disableEdit (self)
| editStart (self, event)
| editStop (self, event)
| enableEdit (self)
| frameInitialiseFunc (self)
| getBounds (self, state=0)
| getCenter (self)
| getFrameType (self, state=0)
| getHeight (self)
| getWidth (self)
| guiDragTask (self, state)
| guiScaleTask (self, state)
| printConfig (self, indent=0)
| resetFrameSize (self)
| setBorderUvWidth (self)
| setBorderWidth (self)
| setFrameColor (self)
| setFrameSize (self, fClearFrame=0)
| setFrameTexture (self)
| setFrameVisibleScale (self)
| setProp (self, propString, value)
| setRelief (self, fSetStyle=1)
| setState (self)
| taskName (self, idString)
| uniqueName (self, idString)
| updateFrameStyle (self)
Public Member Functions inherited from DirectGuiBase
| __init__ (self)
| __setitem__ (self, key, value)
| addoptions (self, optionDefs, optionkeywords)
| bind (self, event, command, extraArgs=[])
| cget (self, option)
| component (self, name)
| components (self)
| configure (self, option=None, **kw)
| createcomponent (self, componentName, componentAliases, componentGroup, widgetClass, *widgetArgs, **kw)
| defineoptions (self, keywords, optionDefs, dynamicGroups=())
| destroycomponent (self, name)
| hascomponent (self, component)
| initialiseoptions (self, myClass)
| isinitoption (self, option)
| options (self)
| postInitialiseFunc (self)
| unbind (self, event)
Public Member Functions inherited from DirectObject
| __init__ (self)
| accept (self, event, method, extraArgs=[])
| acceptOnce (self, event, method, extraArgs=[])
| addTask (self, *args, **kwargs)
| detectLeaks (self)
| doMethodLater (self, *args, **kwargs)
| getAllAccepting (self)
| ignore (self, event)
| ignoreAll (self)
| isAccepting (self, event)
| isIgnoring (self, event)
| removeAllTasks (self)
| removeTask (self, taskOrName)

## Public Attributes
| buttonCommand = [value])
list | buttonList = []
| configureDialog
| numButtons
Public Attributes inherited from DirectGuiWidget
list | bounds = self['frameSize']
| editStart
| editStop
| ll
| printConfig
| stateNodePath = self.guiDict.get(parts[-1])
| ur
Public Attributes inherited from DirectGuiBase
int | fInit = 1
str | guiId = 'guiObject'
list | postInitialiseFuncList = []

## Static Public Attributes
dict | AllDialogs = {}
int | PanelIndex = 0
Static Public Attributes inherited from DirectFrame
tuple | DefDynGroups = ('text', 'geom', 'image')
Static Public Attributes inherited from DirectGuiWidget
float | gridSpacing = 0.05
dict | guiDict = {}
| guiEdit = ShowBaseGlobal.config.GetBool('direct-gui-edit', False)
| inactiveInitState = DGG.NORMAL
int | snapToGrid = 0
Static Public Attributes inherited from DirectObject
| accept_once = acceptOnce
| add_task = addTask
| detect_leaks = detectLeaks
| do_method_later = doMethodLater
| get_all_accepting = getAllAccepting
| ignore_all = ignoreAll
| is_accepting = isAccepting
| is_ignoring = isIgnoring
| remove_all_tasks = removeAllTasks
| remove_task = removeTask

## Additional Inherited Members
Protected Member Functions inherited from DirectObject
| _addTask (self, task)
| _clearTask (self, task)
Protected Attributes inherited from DirectGuiBase
dict | _constructorKeywords = tmp
tuple | _dynamicGroups = ()
dict | _optionInfo = {}
Protected Attributes inherited from DirectObject
dict | _taskList = {}

## Constructor & Destructor Documentation

## ◆ __init__()

__init__ | ( |  | self,
|  |  | parent = None,
|  | ** | kw )

    Creates a popup dialog to alert and/or interact with user.
    Some of the main keywords that can be used to customize the dialog:

    Parameters:
        text (str): Text message/query displayed to user
        geom: Geometry to be displayed in dialog
        buttonTextList: List of text to show on each button
        buttonGeomList: List of geometry to show on each button
        buttonImageList: List of images to show on each button
        buttonValueList: List of values sent to dialog command for
            each button.  If value is [] then the ordinal rank of
            the button is used as its value.
        buttonHotKeyList: List of hotkeys to bind to each button.
            Typing the hotkey is equivalent to pressing the
            corresponding button.
        suppressKeys: Set to true if you wish to suppress keys
            (i.e. Dialog eats key event), false if you wish Dialog
            to pass along key event.
        buttonSize: 4-tuple used to specify custom size for each
            button (to make bigger then geom/text for example)
        pad: Space between border and interior graphics
        topPad: Extra space added above text/geom/image
        midPad: Extra space added between text/buttons
        sidePad: Extra space added to either side of text/buttons
        buttonPadSF: Scale factor used to expand/contract button
            horizontal spacing
        command: Callback command used when a button is pressed.
            Value supplied to command depends on values in
            buttonValueList.

    Note:
        The number of buttons on the dialog depends on the maximum
        length of any button[Text|Geom|Image|Value]List specified.
        Values of None are substituted for lists that are shorter
        than the max length

## Member Function Documentation

## ◆ buttonCommand()

buttonCommand | ( |  | self,
|  |  | value,
|  |  | event = None )

## ◆ cleanup()

cleanup | ( |  | self | ) |

## ◆ configureDialog()

configureDialog | ( |  | self | ) |

## ◆ destroy()

destroy | ( |  | self | ) |

Reimplemented from DirectFrame.

## ◆ hide()

hide | ( |  | self | ) |

## ◆ setMessage()

setMessage | ( |  | self,
|  |  | message )

## ◆ show()

show | ( |  | self | ) |

## Member Data Documentation

## ◆ AllDialogs

dict AllDialogs = {}
| static

## ◆ buttonCommand

buttonCommand = [value])

## ◆ buttonList

list buttonList = []

## ◆ configureDialog

configureDialog

Initial value:
= self.createcomponent(
name, (), "button",
DirectButton, (self,),
text = text,
geom = geom,
image = image,
suppressKeys = self['suppressKeys'],
frameSize = self['buttonSize'],
command = lambda s = self, v = value: s.buttonCommand(v)
)

## ◆ numButtons

numButtons

Initial value:
= max(len(self['buttonTextList']),
len(self['buttonGeomList']),
len(self['buttonImageList']),
len(self['buttonValueList']))

## ◆ PanelIndex

int PanelIndex = 0
| static