dabo Commit
Revision 6131
Date: 2010-10-22 15:20:55 -0700 (Fri, 22 Oct 2010)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6131
Changed:
U trunk/dabo/ui/uiwx/dSpinner.py
Log:
The textbox _onWxLostFocus() code wasn't being fired because it was
being handled and not skipped in dSpinner. This resulted in being able
to type, for a numeric field, "1200aa" and even though the Value would
still be Decimal("1200"), the display would still show the string "1200aa",
resulting in confusion.
I believe this change also does away with the need to explicitly
flushValue(), so I commented that out.
I've tested this with all my spinners on Linux. Will test on Mac and
Windows next.
Diff:
Modified: trunk/dabo/ui/uiwx/dSpinner.py
===================================================================
--- trunk/dabo/ui/uiwx/dSpinner.py 2010-10-22 13:06:01 UTC (rev 6130)
+++ trunk/dabo/ui/uiwx/dSpinner.py 2010-10-22 22:20:55 UTC (rev 6131)
@@ -236,16 +236,18 @@
else:
evt.Skip()
+
def _onLostFocus(self, evt):
"""We need to handle the case where the user types an invalid
value
into the textbox and then tabs/clicks away.
"""
- val = self.Value
pt = self._proxy_textbox
+ val = pt.Value
if (val > self.Max) or (val < self.Min):
- self.Value = pt._oldVal
- pt._oldVal = self.Value
- self.flushValue()
+ pt.Value = pt._oldVal
+ evt.Skip()
+ #pt._oldVal = self.Value
+ #self.flushValue()
def _numericStringVal(self, val):
"""If passed a string, attempts to convert it to the
appropriate numeric
_______________________________________________
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]