Fix HasFocus() for composite controls.
Comparing the result of DoFindFocus() with the main window of composite control doesn't work as it can return a child window so HasFocus() still returned false for a composite control such as generic wxListCtrl even when it did have focus. Just use FindFocus() instead of DoFindFocus() to fix this. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3328,9 +3328,7 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, WindowOrder move)
|
||||
|
||||
bool wxWindowBase::HasFocus() const
|
||||
{
|
||||
wxWindowBase *win = DoFindFocus();
|
||||
return win == this ||
|
||||
win == wxConstCast(this, wxWindowBase)->GetMainWindowOfCompositeControl();
|
||||
return FindFocus() == this;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user