Fix wxSearchCtrl::HasFocus() in the generic version.

Override GetMainWindowOfCompositeControl() in the windows composing the
generic wxSearchCtrl to ensure that HasFocus() correctly returns true for the
entire control when any of them has focus.

Add a trivial unit test to check that this really works and facilitate adding
more tests for this class later.

Closes #14970.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-01-20 02:09:44 +00:00
parent f1a062a1fa
commit 09ca8913fa
12 changed files with 262 additions and 83 deletions

View File

@@ -72,6 +72,10 @@ public:
InvalidateBestSize();
}
virtual wxWindow* GetMainWindowOfCompositeControl()
{
return m_search;
}
// provide access to the base class protected methods to wxSearchCtrl which
// needs to forward to them
@@ -182,6 +186,11 @@ public:
// is really no reason for it to be able to get focus from keyboard.
virtual bool AcceptsFocusFromKeyboard() const { return false; }
virtual wxWindow* GetMainWindowOfCompositeControl()
{
return m_search;
}
protected:
wxSize DoGetBestSize() const
{