From fe67b68d7acf32cdffcb358ea124ba7d28a0386d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 19 Jan 2014 13:15:38 +0000 Subject: [PATCH] Focus generic spin control when its spin button is pressed. This is consistent with the behaviour of the native control under MSW and GTK and generally makes sense as otherwise focus could remain on a completely unrelated control. Closes #15885. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/spinctlg.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index 3da88c9404..cc88bf177f 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -404,6 +404,10 @@ void wxSpinCtrlGenericBase::OnSpinButton(wxSpinEvent& event) { event.Skip(); + // Pressing the spin button should also give the focus to the text part of + // the control, at least this is how the native control behaves under MSW. + SetFocus(); + // Sync the textctrl since the user expects that the button will modify // what they see in the textctrl. SyncSpinToText(SendEvent_None);