Only update status bar fields after they were created in wxMSW.

Postpone updating statu bar panes after they were actually created.

Setting the status bar fields contents before setting the number of them
failed resulting in debug error messages and the text not appearing in the
status bar.

Closes #13670.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-11-15 15:46:01 +00:00
parent 31fb3cfe02
commit a496a72d66

View File

@@ -229,12 +229,11 @@ 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;
DoUpdateStatusText(i);
}
// The total width of the panes passed to Windows must be equal to the
@@ -247,6 +246,12 @@ void wxStatusBar::MSWUpdateFieldsWidths()
wxLogLastError("StatusBar_SetParts");
}
// Now that all parts have been created, set their text.
for ( i = 0; i < count; i++ )
{
DoUpdateStatusText(i);
}
delete [] pWidths;
}