X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/71e030352d74e4e6aed28cfcb0ea6edf3d17af6e..5541d1fda4b73af86e42b2f43724f0c063a352d0:/src/univ/statusbr.cpp diff --git a/src/univ/statusbr.cpp b/src/univ/statusbr.cpp index 679e664bce..a4a98d952d 100644 --- a/src/univ/statusbr.cpp +++ b/src/univ/statusbr.cpp @@ -30,9 +30,12 @@ #if wxUSE_STATUSBAR #ifndef WX_PRECOMP + #include "wx/settings.h" + #include "wx/dcclient.h" #endif #include "wx/statusbr.h" +#include "wx/toplevel.h" #include "wx/univ/renderer.h" @@ -83,12 +86,11 @@ bool wxStatusBarUniv::Create(wxWindow *parent, wxRect wxStatusBarUniv::GetTotalFieldRect(wxCoord *borderBetweenFields) { - // determine the space we have for the fields - wxSize sizeBorders = m_renderer->GetStatusBarBorders(borderBetweenFields); - wxRect rect = GetClientRect(); // no, don't do this - the borders are meant to be inside this rect + // wxSize sizeBorders = + m_renderer->GetStatusBarBorders(borderBetweenFields); //rect.Deflate(sizeBorders.x, sizeBorders.y); // recalc the field widths if needed @@ -111,7 +113,7 @@ void wxStatusBarUniv::DoDraw(wxControlRenderer *renderer) // prepare the DC wxDC& dc = renderer->GetDC(); - dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); + dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); // do draw the fields int flags = IsEnabled() ? 0 : wxCONTROL_DISABLED; @@ -121,12 +123,15 @@ void wxStatusBarUniv::DoDraw(wxControlRenderer *renderer) if ( IsExposed(rect) ) { + wxTopLevelWindow *parentTLW = wxDynamicCast(GetParent(), wxTopLevelWindow); + // the size grip may be drawn only on the last field and only if we // have the corresponding style and even then only if we really can // resize this frame if ( n == m_nFields - 1 && HasFlag(wxST_SIZEGRIP) && - GetParent()->HasFlag(wxRESIZE_BORDER) ) + GetParent()->HasFlag(wxRESIZE_BORDER) && + parentTLW && !parentTLW->IsMaximized() ) { // NB: we use wxCONTROL_ISDEFAULT for this because it doesn't // have any meaning for the status bar otherwise anyhow @@ -185,9 +190,8 @@ wxString wxStatusBarUniv::GetStatusText(int number) const void wxStatusBarUniv::SetFieldsCount(int number, const int *widths) { - wxStatusBarBase::SetFieldsCount(number, widths); - m_statusText.SetCount(number); + wxStatusBarBase::SetFieldsCount(number, widths); m_widthsAbs.Empty(); } @@ -243,7 +247,7 @@ bool wxStatusBarUniv::GetFieldRect(int n, wxRect& rect) const wxCoord wxStatusBarUniv::GetHeight() const { wxClientDC dc(wxConstCast(this, wxStatusBarUniv)); - dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); + dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); return dc.GetCharHeight() + 2*GetBorderY(); }