Fix generic wxSearchCtrl size/layout code.
Override DoGetBestClientSize() instead of DoGetBestSize(), as we're really computing just the size of our contents and like this we don't need to hard code platform-dependent border sizes in this control itself. Also use the client size in LayoutControls() for the same reason. This also makes it unnecessary to pass it the width and height as it can find them on its own. And x and y were never used in the first place, so remove them too. Finally, center the bitmaps vertically. Closes #16422. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -207,9 +207,8 @@ protected:
|
||||
virtual bool DoSaveFile(const wxString& file, int fileType) wxOVERRIDE;
|
||||
|
||||
// override the base class virtuals involved into geometry calculations
|
||||
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
||||
virtual wxSize DoGetBestClientSize() const wxOVERRIDE;
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
|
||||
virtual void LayoutControls(int x, int y, int width, int height);
|
||||
|
||||
virtual void RecalcBitmaps();
|
||||
|
||||
@@ -238,6 +237,9 @@ private:
|
||||
// Implement pure virtual function inherited from wxCompositeWindow.
|
||||
virtual wxWindowList GetCompositeWindowParts() const wxOVERRIDE;
|
||||
|
||||
// Position the child controls using the current window size.
|
||||
void LayoutControls();
|
||||
|
||||
#if wxUSE_MENUS
|
||||
void PopupSearchMenu();
|
||||
#endif // wxUSE_MENUS
|
||||
|
Reference in New Issue
Block a user