From 713c7336f2c96b1deddd24ec38b2a094705635b9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 22 Jul 2010 12:16:26 +0000 Subject: [PATCH] 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 --- include/wx/generic/spinctlg.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.45.2