X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1ca21594f7d0a28c4b3721088dbb0206b563bf8b..c13c38d48497cf8d3e02457b91cccc55d4b84dd2:/src/generic/statusbr.cpp diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp index da2df835a7..372a82a5c5 100644 --- a/src/generic/statusbr.cpp +++ b/src/generic/statusbr.cpp @@ -104,7 +104,7 @@ bool wxStatusBarGeneric::Create(wxWindow *parent, int height = (int)( (11*y)/10 + 2*GetBorderY()); - SetSize(wxDefaultPosition.x, wxDefaultPosition.y, wxDefaultSize.x, height); + SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height); SetFieldsCount(1); @@ -140,12 +140,13 @@ void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths) for (i = m_nFields - 1; i >= number; --i) m_statusStrings.RemoveAt(i); - m_nFields = number; + // forget the old cached pixel widths + m_widthsAbs.Empty(); + + wxStatusBarBase::SetFieldsCount(number, widths); wxASSERT_MSG( m_nFields == (int)m_statusStrings.GetCount(), _T("This really should never happen, can we do away with m_nFields here?") ); - - SetStatusWidths(number, widths); } void wxStatusBarGeneric::SetStatusText(const wxString& text, int number) @@ -269,43 +270,52 @@ void wxStatusBarGeneric::DrawField(wxDC& dc, int i) wxRect rect; GetFieldRect(i, rect); - // Draw border - // Have grey background, plus 3-d border - - // One black rectangle. - // Inside this, left and top sides - dark grey. Bottom and right - - // white. - - dc.SetPen(m_hilightPen); - -#ifndef __WXPM__ - - // Right and bottom white lines - dc.DrawLine(rect.x + rect.width, rect.y, - rect.x + rect.width, rect.y + rect.height); - dc.DrawLine(rect.x + rect.width, rect.y + rect.height, - rect.x, rect.y + rect.height); + int style = wxSB_NORMAL; + if (m_statusStyles) + style = m_statusStyles[i]; - dc.SetPen(m_mediumShadowPen); - - // Left and top grey lines - dc.DrawLine(rect.x, rect.y + rect.height, - rect.x, rect.y); - dc.DrawLine(rect.x, rect.y, - rect.x + rect.width, rect.y); -#else - - dc.DrawLine(rect.x + rect.width, rect.height + 2, - rect.x, rect.height + 2); - dc.DrawLine(rect.x + rect.width, rect.y, - rect.x + rect.width, rect.y + rect.height); - - dc.SetPen(m_mediumShadowPen); - dc.DrawLine(rect.x, rect.y, - rect.x + rect.width, rect.y); - dc.DrawLine(rect.x, rect.y + rect.height, - rect.x, rect.y); + if (style != wxSB_FLAT) + { + // Draw border + // For wxSB_NORMAL: + // Have grey background, plus 3-d border - + // One black rectangle. + // Inside this, left and top sides - dark grey. Bottom and right - + // white. + // Reverse it for wxSB_RAISED + + dc.SetPen((style == wxSB_RAISED) ? m_mediumShadowPen : m_hilightPen); + + #ifndef __WXPM__ + + // Right and bottom lines + dc.DrawLine(rect.x + rect.width, rect.y, + rect.x + rect.width, rect.y + rect.height); + dc.DrawLine(rect.x + rect.width, rect.y + rect.height, + rect.x, rect.y + rect.height); + + dc.SetPen((style == wxSB_RAISED) ? m_hilightPen : m_mediumShadowPen); + + // Left and top lines + dc.DrawLine(rect.x, rect.y + rect.height, + rect.x, rect.y); + dc.DrawLine(rect.x, rect.y, + rect.x + rect.width, rect.y); + #else + + dc.DrawLine(rect.x + rect.width, rect.height + 2, + rect.x, rect.height + 2); + dc.DrawLine(rect.x + rect.width, rect.y, + rect.x + rect.width, rect.y + rect.height); + + dc.SetPen((style == wxSB_RAISED) ? m_hilightPen : m_mediumShadowPen); + dc.DrawLine(rect.x, rect.y, + rect.x + rect.width, rect.y); + dc.DrawLine(rect.x, rect.y + rect.height, + rect.x, rect.y); #endif + } DrawFieldText(dc, i); } @@ -380,7 +390,6 @@ void wxStatusBarGeneric::InitColours() void wxStatusBarGeneric::OnSysColourChanged(wxSysColourChangedEvent& event) { InitColours(); - Refresh(); // Propagate the event to the non-top-level children wxWindow::OnSysColourChanged(event); @@ -396,7 +405,7 @@ void wxStatusBarGeneric::SetMinHeight(int height) if ( height > (11*y)/10 ) { - SetSize(wxDefaultPosition.x, wxDefaultPosition.y, wxDefaultSize.x, height + 2*m_borderY); + SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height + 2*m_borderY); } }