dabo Commit
Revision 5531
Date: 2009-11-18 11:35:45 -0800 (Wed, 18 Nov 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5531
Changed:
U trunk/dabo/ui/uiwx/dSpinner.py
Log:
Refactored the spin function, which hadn't been setting _userChanged in the
correct place, since setting Value results in an implicit flushValue().
This fixes the InteractiveChange event to fire correctly again.
Diff:
Modified: trunk/dabo/ui/uiwx/dSpinner.py
===================================================================
--- trunk/dabo/ui/uiwx/dSpinner.py 2009-11-15 15:50:01 UTC (rev 5530)
+++ trunk/dabo/ui/uiwx/dSpinner.py 2009-11-18 19:35:45 UTC (rev 5531)
@@ -151,12 +151,14 @@
newVal = self._applyIncrement(incrementFunc)
minn, maxx, margin = self._coerceTypes(newVal, self.Min,
self.Max, margin)
+ valueToSet = None
+
if direction == "up":
diff = newVal - maxx
if diff < margin:
- self._proxy_textbox.Value = newVal
+ valueToSet = newVal
elif self._spinWrap:
- self._proxy_textbox.Value = minn
+ valueToSet = minn
else:
ret = False
if ret:
@@ -166,9 +168,9 @@
else:
diff = newVal - minn
if diff > margin:
- self._proxy_textbox.Value = newVal
+ valueToSet = newVal
elif self._spinWrap:
- self._proxy_textbox.Value = maxx
+ valueToSet = maxx
else:
ret = False
if ret:
@@ -176,8 +178,10 @@
self.raiseEvent(dEvents.Spinner,
spinType=spinType)
self._checkBounds()
- self._userChanged = True
- self.flushValue()
+
+ if ret:
+ self._userChanged = True
+ self.Value = valueToSet
self.raiseEvent(dEvents.Hit, hitType=spinType)
return ret
_______________________________________________
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]