X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/208f99c3e398e7ddf95016fff5e67883714fff54..0fff3dfcbbbe99a7a2046093f8b245ce87bbe583:/src/msw/statusbar.cpp diff --git a/src/msw/statusbar.cpp b/src/msw/statusbar.cpp index e694abf247..b82db9553b 100644 --- a/src/msw/statusbar.cpp +++ b/src/msw/statusbar.cpp @@ -176,10 +176,6 @@ void wxStatusBar::SetFieldsCount(int nFields, const int *widths) // this is a Windows limitation wxASSERT_MSG( (nFields > 0) && (nFields < 255), "too many fields" ); - wxStatusBarBase::SetFieldsCount(nFields, widths); - - MSWUpdateFieldsWidths(); - // keep in synch also our m_tooltips array // reset all current tooltips @@ -189,7 +185,11 @@ void wxStatusBar::SetFieldsCount(int nFields, const int *widths) } // shrink/expand the array: - m_tooltips.resize(m_panes.GetCount(), NULL); + m_tooltips.resize(nFields, NULL); + + wxStatusBarBase::SetFieldsCount(nFields, widths); + + MSWUpdateFieldsWidths(); } void wxStatusBar::SetStatusWidths(int n, const int widths[]) @@ -233,6 +233,8 @@ void wxStatusBar::MSWUpdateFieldsWidths() { nCurPos += widthsAbs[i] + extraWidth; pWidths[i] = nCurPos; + + DoUpdateStatusText(i); } // The total width of the panes passed to Windows must be equal to the @@ -246,9 +248,6 @@ void wxStatusBar::MSWUpdateFieldsWidths() } delete [] pWidths; - - - // FIXME: we may want to call DoUpdateStatusText() here since we may need to (de)ellipsize status texts } void wxStatusBar::DoUpdateStatusText(int nField) @@ -374,7 +373,7 @@ int wxStatusBar::MSWGetBorderWidth() const /* static */ const wxStatusBar::MSWMetrics& wxStatusBar::MSWGetMetrics() { - static MSWMetrics s_metrics = { 0 }; + static MSWMetrics s_metrics = { 0, 0 }; if ( !s_metrics.textMargin ) { // Grip size should be self explanatory (the only problem with it is