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

@@ -2112,6 +2112,36 @@ void wxWindowMSW::DoSetClientSize(int width, int height)
}
}
wxSize wxWindowMSW::DoGetBorderSize() const
{
wxCoord border;
switch ( GetBorder() )
{
case wxBORDER_STATIC:
case wxBORDER_SIMPLE:
border = 1;
break;
case wxBORDER_SUNKEN:
border = 2;
break;
case wxBORDER_RAISED:
case wxBORDER_DOUBLE:
border = 3;
break;
default:
wxFAIL_MSG( _T("unknown border style") );
// fall through
case wxBORDER_NONE:
border = 0;
}
return 2*wxSize(border, border);
}
// ---------------------------------------------------------------------------
// text metrics
// ---------------------------------------------------------------------------