From: Vadim Zeitlin Date: Fri, 28 Sep 2012 23:50:27 +0000 (+0000) Subject: Fix generic wxSearchCtrl best size calculation. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/241708ca470d899db7ac0f8ef80114d1e3d2ceb6?hp=07d304d2aad643454a6c087a9215e2fc4d8f07f4 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 --- diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index 7310b9158a..4bbf12d12a 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -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(); }