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
This commit is contained in:
Vadim Zeitlin
2010-07-22 12:16:26 +00:00
parent 9bce7b7b13
commit 713c7336f2

View 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;