X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dcd223d1d14d7a8cf2f3b576b05fbc24606cc511..8757ab3623821c10158224e0c9ed245bd83851d5:/src/msw/statusbar.cpp diff --git a/src/msw/statusbar.cpp b/src/msw/statusbar.cpp index 9df8eb782a..3e374ca695 100644 --- a/src/msw/statusbar.cpp +++ b/src/msw/statusbar.cpp @@ -213,8 +213,11 @@ void wxStatusBar::MSWUpdateFieldsWidths() widthAvailable -= extraWidth*(count - 1); // extra space between fields widthAvailable -= MSWGetMetrics().textMargin; // and for the last field - if ( HasFlag(wxSTB_SIZEGRIP) ) - widthAvailable -= MSWGetMetrics().gripWidth; + // Deal with the grip: we shouldn't overflow onto the space occupied by it + // so the effectively available space is smaller. + const int gripWidth = HasFlag(wxSTB_SIZEGRIP) ? MSWGetMetrics().gripWidth + : 0; + widthAvailable -= gripWidth; // distribute the available space (client width) among the various fields: @@ -232,6 +235,11 @@ void wxStatusBar::MSWUpdateFieldsWidths() pWidths[i] = nCurPos; } + // The total width of the panes passed to Windows must be equal to the + // total width available, including the grip. Otherwise we get an extra + // separator line just before it. + pWidths[count - 1] += gripWidth; + if ( !StatusBar_SetParts(GetHwnd(), count, pWidths) ) { wxLogLastError("StatusBar_SetParts"); @@ -429,14 +437,6 @@ bool wxStatusBar::GetFieldRect(int i, wxRect& rect) const wxCopyRECTToRect(r, rect); - // Windows seems to under-report the size of the last field rectangle, - // presumably in order to prevent the buggy applications from overflowing - // onto the size grip but we want to return the real size to wx users - if ( HasFlag(wxSTB_SIZEGRIP) && i == (int)m_panes.GetCount() - 1 ) - { - rect.width += MSWGetMetrics().gripWidth - MSWGetBorderWidth(); - } - return true; }