Fix focus behaviour of the spin control under MSW
Override MSWGetFocusHwnd for wxSpinCtrl to focus the right subwindow. So the correct window will be used in wxWindowMSW::SetFocusFromKbd and the spin controls content will be selected on TAB key.
This commit is contained in:
@@ -522,6 +522,13 @@ void wxSpinCtrl::SetLayoutDirection(wxLayoutDirection dir)
|
||||
SetSize(-1, -1, -1, -1, wxSIZE_AUTO | wxSIZE_FORCE);
|
||||
}
|
||||
|
||||
WXHWND wxSpinCtrl::MSWGetFocusHWND() const
|
||||
{
|
||||
// Return the buddy hwnd because it shuld be focused instead of the
|
||||
// wxSpinCtrl itself.
|
||||
return m_hwndBuddy;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSpinButton methods
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -653,11 +660,6 @@ bool wxSpinCtrl::Enable(bool enable)
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::SetFocus()
|
||||
{
|
||||
::SetFocus(GetBuddyHwnd());
|
||||
}
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
|
||||
void wxSpinCtrl::DoSetToolTip(wxToolTip *tip)
|
||||
|
||||
Reference in New Issue
Block a user