]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/statusbar.cpp
Remove double buffering from wxWebViewIE as this is handled by the web browser contro...
[wxWidgets.git] / src / msw / statusbar.cpp
index a63dcc4fb61b9b3967b15801186ec9191164b797..7bfb81bc9d0955626854b5a110752af24477e575 100644 (file)
@@ -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[])
@@ -229,7 +229,8 @@ void wxStatusBar::MSWUpdateFieldsWidths()
     int *pWidths = new int[count];
 
     int nCurPos = 0;
-    for ( int i = 0; i < count; i++ )
+    int i;
+    for ( i = 0; i < count; i++ )
     {
         nCurPos += widthsAbs[i] + extraWidth;
         pWidths[i] = nCurPos;
@@ -245,10 +246,13 @@ void wxStatusBar::MSWUpdateFieldsWidths()
         wxLogLastError("StatusBar_SetParts");
     }
 
-    delete [] pWidths;
-
+    // Now that all parts have been created, set their text.
+    for ( i = 0; i < count; i++ )
+    {
+        DoUpdateStatusText(i);
+    }
 
-    // FIXME: we may want to call DoUpdateStatusText() here since we may need to (de)ellipsize status texts
+    delete [] pWidths;
 }
 
 void wxStatusBar::DoUpdateStatusText(int nField)