X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3d7d51faea2c01a31fb00c32bb40497828600d0e..a2cffa18c952f435607fe0397d5258fa61d3da99:/wxPython/wx/lib/masked/combobox.py?ds=inline diff --git a/wxPython/wx/lib/masked/combobox.py b/wxPython/wx/lib/masked/combobox.py index 8a78f9b651..c42db0c945 100644 --- a/wxPython/wx/lib/masked/combobox.py +++ b/wxPython/wx/lib/masked/combobox.py @@ -219,7 +219,7 @@ class BaseMaskedComboBox( wx.ComboBox, MaskedEditMixin ): # make SetValue behave the same as if you had typed the value in: try: - value = self._Paste(value, raise_on_invalid=True, just_return_value=True) + value, replace_to = self._Paste(value, raise_on_invalid=True, just_return_value=True) if self._isFloat: self._isNeg = False # (clear current assumptions) value = self._adjustFloat(value) @@ -240,9 +240,9 @@ class BaseMaskedComboBox( wx.ComboBox, MaskedEditMixin ): raise self._SetValue(value) -#### dbg('queuing insertion after .SetValue', self._masklength) - wx.CallAfter(self._SetInsertionPoint, self._masklength) - wx.CallAfter(self._SetSelection, self._masklength, self._masklength) +#### dbg('queuing insertion after .SetValue', replace_to) + wx.CallAfter(self._SetInsertionPoint, replace_to) + wx.CallAfter(self._SetSelection, replace_to, replace_to) def _Refresh(self): @@ -506,6 +506,11 @@ class BaseMaskedComboBox( wx.ComboBox, MaskedEditMixin ): self._CheckValid() ## dbg('field._autoCompleteIndex:', match_index) ## dbg('self.GetSelection():', self.GetSelection()) + end = self._goEnd(getPosOnly=True) +## dbg('scheduling set of end position to:', end) + # work around bug in wx 2.5 + wx.CallAfter(self.SetInsertionPoint, 0) + wx.CallAfter(self.SetInsertionPoint, end) ## dbg(indent=0)