]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix explicitly setting focus to generic wxSpinCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Jul 2010 12:16:26 +0000 (12:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Jul 2010 12:16:26 +0000 (12:16 +0000)
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

index 4360c9395c382d9627e2c258006d2be04e6d9dc3..19a78bb8812e1fcd3e2d8fdedaeb60c9a7378b7a 100644 (file)
@@ -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;