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:
Vadim Zeitlin
2009-06-22 20:36:13 +00:00
parent 8c6c5778c2
commit 743b426605
8 changed files with 72 additions and 49 deletions

View File

@@ -1633,6 +1633,11 @@ protected:
// same size as it would have after a call to Fit()
virtual wxSize DoGetBestSize() const;
// this method can be overridden instead of DoGetBestSize() if it computes
// the best size of the client area of the window only, excluding borders
// (GetBorderSize() will be used to add them)
virtual wxSize DoGetBestClientSize() const { return wxDefaultSize; }
// this is the virtual function to be overriden in any derived class which
// wants to change how SetSize() or Move() works - it is called by all
// versions of these functions in the base class
@@ -1647,6 +1652,19 @@ protected:
int maxW, int maxH,
int incW, int incH );
// return the total size of the window borders, i.e. the sum of the widths
// of the left and the right border in the x component of the returned size
// and the sum of the heights of the top and bottom borders in the y one
//
// NB: this is new/temporary API only implemented by wxMSW so far and
// subject to change, don't use
virtual wxSize DoGetBorderSize() const
{
wxFAIL_MSG( "must be overridden if called" );
return wxDefaultSize;
}
// move the window to the specified location and resize it: this is called
// from both DoSetSize() and DoSetClientSize() and would usually just
// reposition this window except for composite controls which will want to