Patch from Will Sadkin:

- Fixed intra-right-insert-field erase.
- Allowed right-insert in ipaddrctrl subfields.
- Made _SetValue() place cursor after last non-blank character inserted,
  rather than end of mask.
- Fixed combobox autoselect behavior to work similarly as above, so that
  said selection will only select the non-empty text, as per request.
- Fixed some incorrect undo behavior for right-insert fields
- Allowed derived classes (eg. numctrl) to pass modified values for undo
  processing (to handle/ignore grouping chars properly.)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-06-19 16:25:55 +00:00
parent f8167d6ee2
commit 5f280eaa57
5 changed files with 308 additions and 58 deletions

View File

@@ -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)