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:
@@ -190,7 +190,7 @@ class BaseMaskedTextCtrl( wx.TextCtrl, 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)
|
||||
@@ -206,16 +206,17 @@ class BaseMaskedTextCtrl( wx.TextCtrl, MaskedEditMixin ):
|
||||
dateparts[0] = self._adjustDate(dateparts[0], fixcentury=True)
|
||||
value = string.join(dateparts, ' ')
|
||||
## dbg('adjusted value: "%s"' % value)
|
||||
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)
|
||||
else:
|
||||
## dbg('exception thrown', indent=0)
|
||||
raise
|
||||
|
||||
self._SetValue(value) # note: to preserve similar capability, .SetValue()
|
||||
# does not change IsModified()
|
||||
#### 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)
|
||||
# set selection to last char replaced by paste
|
||||
wx.CallAfter(self._SetInsertionPoint, replace_to)
|
||||
wx.CallAfter(self._SetSelection, replace_to, replace_to)
|
||||
## dbg(indent=0)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user