Correct HasFocus() to work with subwindows of a composite control.
When a subwindow (i.e. one that overrides GetMainWindowOfCompositeControl() to return a parent window) has focus, HasFocus() should return true for it too, in addition to returning true for the main window. This completes the fix of r69788. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3328,7 +3328,9 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, WindowOrder move)
|
|||||||
|
|
||||||
bool wxWindowBase::HasFocus() const
|
bool wxWindowBase::HasFocus() const
|
||||||
{
|
{
|
||||||
return FindFocus() == this;
|
wxWindowBase* const win = DoFindFocus();
|
||||||
|
return win &&
|
||||||
|
(this == win || this == win->GetMainWindowOfCompositeControl());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user