From a4c2ca659e09031a967e0df64f2dc3f9b3977ac5 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 6 Feb 2003 23:57:38 +0000 Subject: [PATCH] Applied patch from Will Sadkin git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19143 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wxPython/lib/intctrl.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wxPython/wxPython/lib/intctrl.py b/wxPython/wxPython/lib/intctrl.py index 2fdb2d44be..0907ae90b2 100644 --- a/wxPython/wxPython/lib/intctrl.py +++ b/wxPython/wxPython/lib/intctrl.py @@ -295,10 +295,12 @@ class wxIntValidator( wxPyValidator ): elif set_to_zero: # select to "empty" numeric value wxCallAfter(ctrl.SetValue, new_value) + wxCallAfter(ctrl.SetInsertionPoint, 0) wxCallAfter(ctrl.SetSelection, 0, 1) elif set_to_minus_one: wxCallAfter(ctrl.SetValue, new_value) + wxCallAfter(ctrl.SetInsertionPoint, 1) wxCallAfter(ctrl.SetSelection, 1, 2) elif not internally_set: @@ -747,6 +749,7 @@ class wxIntCtrl(wxTextCtrl): if select_len == len(wxTextCtrl.GetValue(self)): if not self.IsNoneAllowed(): self.SetValue(0) + self.SetInsertionPoint(0) self.SetSelection(0,1) else: self.SetValue(None) @@ -842,6 +845,7 @@ if __name__ == '__main__': def OnClick(self, event): dlg = myDialog(self.panel, -1, "test wxIntCtrl") dlg.int_ctrl.SetValue(501) + dlg.int_ctrl.SetInsertionPoint(1) dlg.int_ctrl.SetSelection(1,2) rc = dlg.ShowModal() print 'final value', dlg.int_ctrl.GetValue()