Fix generic wxSearchCtrl best size calculation.

The best size of its text control part was not calculated correctly any more
because a wrong best size was cached during wxSearchTextCtrl construction,
when the final class overridden DoGetBestSize() was not called.

Fix this by explicitly invalidating the best size at the end of constructor
for now even though it would be arguably better to fix this in some way not
requiring anything extra to be done to always take the overridden method into
account, especially as it used to work before. But it's not clear how exactly
to restore this so for now do at least fix wxSearchCtrl appearance.

Closes #14708.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-09-28 23:50:27 +00:00
parent 07d304d2aa
commit 241708ca47

View File

@@ -67,8 +67,9 @@ public:
SetHint(_("Search"));
// remove the default minsize, the searchctrl will have one instead
SetSizeHints(wxDefaultCoord,wxDefaultCoord);
// Ensure that our best size is recomputed using our overridden
// DoGetBestSize().
InvalidateBestSize();
}