Added DoGetClientBestSize() and use it for a couple of controls in wxMSW.
DoGetClientBestSize() returns the best size of the client area, without accounting for the border which is done by GetBestSize() itself and DoGetBorderSize() called from it. Use DoGetClientBestSize() in wxStaticText (where it was done insideDoGetBestSize() before) and in wxListBox, to fix its height calculation. Also use correct height of listbox items as returned by the control itself instead of trying to guess it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -133,6 +133,8 @@ public:
|
||||
virtual bool CanApplyThemeBorder() const { return false; }
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
|
||||
virtual void DoClear();
|
||||
virtual void DoDeleteOneItem(unsigned int n);
|
||||
|
||||
@@ -155,8 +157,6 @@ protected:
|
||||
|
||||
unsigned int m_noItems;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
// control items
|
||||
wxListBoxItemsArray m_aItems;
|
||||
|
@@ -46,7 +46,7 @@ protected:
|
||||
// implement/override some base class virtuals
|
||||
virtual void DoSetSize(int x, int y, int w, int h,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
|
||||
virtual wxString DoGetLabel() const;
|
||||
virtual void DoSetLabel(const wxString& str);
|
||||
|
@@ -501,6 +501,8 @@ protected:
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
|
||||
virtual wxSize DoGetBorderSize() const;
|
||||
|
||||
virtual void DoCaptureMouse();
|
||||
virtual void DoReleaseMouse();
|
||||
|
||||
|
Reference in New Issue
Block a user