X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/87ff599d25a7401f620a2a413ac044f0e4803652..005198fa7d8e244f9c9c28263c8eca5a9ced8e16:/src/generic/statusbr.cpp diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp index 55eb58cc4f..c12bce49e7 100644 --- a/src/generic/statusbr.cpp +++ b/src/generic/statusbr.cpp @@ -109,6 +109,24 @@ bool wxStatusBarGeneric::Create(wxWindow *parent, return TRUE; } + +wxSize wxStatusBarGeneric::DoGetBestSize() const +{ + int width, height; + + // best width is the width of the parent + GetParent()->GetClientSize(&width, NULL); + + // best height is as calculated above in Create + wxClientDC dc((wxWindow*)this); + dc.SetFont(GetFont()); + wxCoord y; + dc.GetTextExtent(_T("X"), NULL, &y ); + height = (int)( (11*y)/10 + 2*GetBorderY()); + + return wxSize(width, height); +} + void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths) { wxASSERT_MSG( number >= 0, _T("negative number of fields in wxStatusBar?") );