From 3142a673e723ececb8ce25d2bbfefcd7643d02b4 Mon Sep 17 00:00:00 2001 From: Mark Mine Date: Sat, 16 Mar 2002 00:31:53 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/gui/DirectGuiGlobals.py | 9 +++----- direct/src/showbase/PythonUtil.py | 35 +++++++++++++++--------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/direct/src/gui/DirectGuiGlobals.py b/direct/src/gui/DirectGuiGlobals.py index f7dac252c1..db43634474 100644 --- a/direct/src/gui/DirectGuiGlobals.py +++ b/direct/src/gui/DirectGuiGlobals.py @@ -77,8 +77,7 @@ panel = None def getDefaultRolloverSound(): global defaultRolloverSound if defaultRolloverSound == None: - defaultRolloverSound = base.loadSfx( - "phase_3/audio/sfx/GUI_rollover.mp3") + defaultRolloverSound = base.loadSfx("audio/sfx/GUI_rollover.mp3") return defaultRolloverSound def setDefaultRolloverSound(newSound): @@ -88,8 +87,7 @@ def setDefaultRolloverSound(newSound): def getDefaultClickSound(): global defaultClickSound if defaultClickSound == None: - defaultClickSound = base.loadSfx( - "phase_3/audio/sfx/GUI_create_toon_fwd.mp3") + defaultClickSound = base.loadSfx("audio/sfx/GUI_click.mp3") return defaultClickSound def setDefaultClickSound(newSound): @@ -109,8 +107,7 @@ def setDefaultFont(newFont): def getDefaultDialogGeom(): global defaultDialogGeom if defaultDialogGeom == None: - defaultDialogGeom = loader.loadModelOnce( - 'phase_3/models/gui/dialog_box_gui') + defaultDialogGeom = loader.loadModelOnce('models/gui/dialog_box_gui') return defaultDialogGeom def setDefaultDialogGeom(newDialogGeom): diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 58c52f17cc..2e3744e919 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -271,7 +271,7 @@ def doc(obj): (isinstance(obj, types.FunctionType)): print obj.__doc__ -def adjust(command = None, parent = None, **kw): +def adjust(command = None, dim = 1, parent = None, **kw): """ adjust(command = None, parent = None, **kw) Popup and entry scale to adjust a parameter @@ -284,29 +284,28 @@ def adjust(command = None, parent = None, **kw): text: The label on the slider These values can be accessed and/or changed after the fact - >>> es = adjust() - >>> es['min'] + >>> vg = adjust() + >>> vg['min'] 0.0 - >>> es['min'] = 10.0 - >>> es['min'] + >>> vg['min'] = 10.0 + >>> vg['min'] 10.0 """ # Make sure we enable Tk - import TkGlobal - import Tkinter - import Slider - import Pmw - # Create toplevel if needed - if not parent: - parent = Tkinter.Toplevel() - parent.title('Parameter Adjust') + import Valuator # Set command if specified if command: - kw['command'] = command - es = apply(Slider.Slider, (parent,), kw) - es.pack(expand = 1, fill = 'x') - es.parent = parent - return es + kw['command'] = lambda x: apply(command, x) + if parent is None: + kw['title'] = command.__name__ + kw['dim'] = dim + # Create toplevel if needed + if not parent: + vg = apply(Valuator.ValuatorGroupPanel, (parent,), kw) + else: + vg = apply(Valuator.ValuatorGroup,(parent,), kw) + vg.pack(expand = 1, fill = 'x') + return vg def intersection(a, b): """