dabo Commit
Revision 6742
Date: 2011-08-06 04:16:39 -0700 (Sat, 06 Aug 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6742
Changed:
U trunk/dabo/ui/dDataControlMixinBase.py
Log:
- Added global _inFlush attribute handling.
- Move text selection to after the value update happens.
Diff:
Modified: trunk/dabo/ui/dDataControlMixinBase.py
===================================================================
--- trunk/dabo/ui/dDataControlMixinBase.py 2011-08-06 08:47:02 UTC (rev
6741)
+++ trunk/dabo/ui/dDataControlMixinBase.py 2011-08-06 11:16:39 UTC (rev
6742)
@@ -63,9 +63,10 @@
def _gotFocus(self):
# self._oldVal will be compared to self.Value in flushValue()
- if not self._fldValidFailed:
- self._oldVal = self.Value
- self._fldValidFailed = False
+ if not getattr(self, "_inFlush", False):
+ if not self._fldValidFailed:
+ self._oldVal = self.Value
+ self._fldValidFailed = False
try:
if self.SelectOnEntry:
self.selectAll()
@@ -98,13 +99,14 @@
"""Update control's value to match the current value from the
source."""
# We need to do the data handling stuff before calling super()
self.__dataUpdate()
+ # Update selection after Value property update.
+ if getattr(self, "SelectOnEntry", False) and
self.Form.ActiveControl == self:
+ self.selectAll()
super(dDataControlMixinBase, self).update()
def __dataUpdate(self):
"""This handles all the value updating from the data source."""
- if getattr(self, "SelectOnEntry", False) and
self.Form.ActiveControl == self:
- self.selectAll()
if not self.DataField or not (self.DataSource or
isinstance(self.DataSource, dabo.dPref)):
return
if self._DesignerMode:
_______________________________________________
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]