From: Vadim Zeitlin Date: Thu, 22 Jul 2010 12:16:26 +0000 (+0000) Subject: Fix explicitly setting focus to generic wxSpinCtrl. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/713c7336f2c96b1deddd24ec38b2a094705635b9 Fix explicitly setting focus to generic wxSpinCtrl. The control itself can't accept focus as its window is disabled so set the focus to its text part instead if SetFocus() is explicitly called. Closes #12259. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/spinctlg.h b/include/wx/generic/spinctlg.h index 4360c9395c..19a78bb881 100644 --- a/include/wx/generic/spinctlg.h +++ b/include/wx/generic/spinctlg.h @@ -93,8 +93,10 @@ public: void OnTextChar(wxKeyEvent& event); // this window itself is used only as a container for its sub windows so it - // shouldn't accept the focus at all + // shouldn't accept the focus at all and any attempts to explicitly set + // focus to it should give focus to its text constol part virtual bool AcceptsFocus() const { return false; } + virtual void SetFocus() { if ( m_textCtrl ) m_textCtrl->SetFocus(); } friend class wxSpinCtrlTextGeneric;