MaskedEditCtrl patch from Bill Tutt

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2013-02-16 04:01:33 +00:00
parent 087ebf6655
commit 851819da57

View File

@@ -3623,6 +3623,13 @@ class MaskedEditMixin:
## dbg(indent=0)
return False
# If the caller just wants the erased value without validation
# (because a just pressed key might make this string valid again)
# then return it.
if just_return_value:
## dbg(indent=0)
return newstr
# if erasure results in an invalid value, disallow it:
if self._ctrl_constraints._validRequired and not self.IsValid(newstr):
if not wx.Validator_IsSilent():
@@ -3630,10 +3637,6 @@ class MaskedEditMixin:
## dbg(indent=0)
return False
if just_return_value:
## dbg(indent=0)
return newstr
# else...
## dbg('setting value (later) to', newstr)
wx.CallAfter(self._SetValue, newstr)
@@ -4757,6 +4760,7 @@ class MaskedEditMixin:
return approved
else:
## dbg('%d is a !???! character; returning False', indent=0)
## dbg(indent=0)
return False