dabo Commit
Revision 5486
Date: 2009-10-23 15:05:03 -0700 (Fri, 23 Oct 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5486
Changed:
U trunk/dabo/ui/uiwx/dSpinner.py
Log:
I'm making a dSpinner subclass for entering fractional numbers. To do this I
need to drop in my TxtFraction subclass of dTextBox to use instead of the
default proxy textbox in dSpinner.
I did this by allowing the textbox class to be set in the dSpinner constructor.
Diff:
Modified: trunk/dabo/ui/uiwx/dSpinner.py
===================================================================
--- trunk/dabo/ui/uiwx/dSpinner.py 2009-10-23 12:30:51 UTC (rev 5485)
+++ trunk/dabo/ui/uiwx/dSpinner.py 2009-10-23 22:05:03 UTC (rev 5486)
@@ -36,12 +36,11 @@
# self.raiseEvent(dEvents.Spinner, spinType="button")
-
class dSpinner(dabo.ui.dDataPanel):
"""Control for allowing a user to increment a value by discreet steps
across a range
of valid values.
"""
- def __init__(self, parent, properties=None, attProperties=None, *args,
**kwargs):
+ def __init__(self, parent, properties=None, attProperties=None,
TextBoxClass=None, *args, **kwargs):
self.__constructed = False
self._spinWrap = False
self._min = 0
@@ -56,7 +55,9 @@
attProperties=attProperties, *args, **kwargs)
self._baseClass = dSpinner
# Create the child controls
- self._proxy_textbox = dabo.ui.dTextBox(self, Value=val,
Width=32,
+ if TextBoxClass is None:
+ TextBoxClass = dabo.ui.dTextBox
+ self._proxy_textbox = TextBoxClass(self, Value=val, Width=32,
StrictNumericEntry=False, _EventTarget=self)
self._proxy_spinner = _dSpinButton(parent=self,
_EventTarget=self)
self.__constructed = True
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]