dabo Commit
Revision 3544
Date: 2007-10-22 08:39:28 -0700 (Mon, 22 Oct 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/3544

Changed:
U   trunk/dabo/ui/uiwx/dTextBoxMixin.py

Log:
Corrected the problem with text controls losing their selection information 
when they lose focus. Ticket # [1104]


Diff:
Modified: trunk/dabo/ui/uiwx/dTextBoxMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dTextBoxMixin.py 2007-10-21 21:03:01 UTC (rev 3543)
+++ trunk/dabo/ui/uiwx/dTextBoxMixin.py 2007-10-22 15:39:28 UTC (rev 3544)
@@ -25,6 +25,7 @@
        def __init__(self, preClass, parent, properties=None, 
attProperties=None, *args, **kwargs):
                self._forceCase = None
                self._inForceCase = False
+               self._inFlush = False
                self._textLength = None
                self._inTextLength = False
                self._flushOnLostFocus = True  ## see 
dabo.ui.dDataControlMixinBase::flushValue()
@@ -42,16 +43,23 @@
                # This resets the value to the string representation as Python 
shows it. Also, we
                # must save and restore the InsertionPosition because wxGtk at 
least resets it to
                # 0 upon SetValue().
+               if self._inFlush:
+                       return
+               self._inFlush = True
                insPos = self.InsertionPosition
+               startPos = self.SelectionStart
+               endPos = self.SelectionEnd
                setter = self.SetValue
                if hasattr(self, "ChangeValue"):
                        setter = self.ChangeValue
                setter(self.getStringValue(self.Value))
                self.InsertionPosition = insPos
-               
+               self.SelectionStart = startPos
+               self.SelectionEnd = endPos
                # Now that the dabo Value is set properly, the default behavior 
that flushes 
                # the value to the bizobj can be called:
                super(dTextBoxMixinBase, self).flushValue()
+               self._inFlush = False
                
        
        def getStringValue(self, val):




_______________________________________________
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/dabo-dev/[EMAIL PROTECTED]

Reply via email to