Update status bar fields widths from WM_SIZE handler.

Doing it immediately after calling ::SetWindowPos(), as we used to do, didn't
work correctly (presumably because the status bar fields widths were not
updated yet internally) and resulted in not updating the ellipsized fields
values when "Show window contents while dragging" Windows option was off.
Doing it when we get WM_SIZE works in this case too.

Closes #13257.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-06-07 22:49:51 +00:00
parent 007d2de3c4
commit 208f99c3e3

View File

@@ -502,9 +502,6 @@ void wxStatusBar::DoMoveWindow(int x, int y, int width, int height)
);
}
// adjust fields widths to the new size
MSWUpdateFieldsWidths();
// we have to trigger wxSizeEvent if there are children window in status
// bar because GetFieldRect returned incorrect (not updated) values up to
// here, which almost certainly resulted in incorrectly redrawn statusbar
@@ -595,15 +592,21 @@ wxStatusBar::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
}
#endif
bool needsEllipsization = HasFlag(wxSTB_ELLIPSIZE_START) ||
HasFlag(wxSTB_ELLIPSIZE_MIDDLE) ||
HasFlag(wxSTB_ELLIPSIZE_END);
if ( nMsg == WM_SIZE && needsEllipsization )
if ( nMsg == WM_SIZE )
{
for (int i=0; i<GetFieldsCount(); i++)
DoUpdateStatusText(i);
// re-set the field text, in case we need to ellipsize
// (or de-ellipsize) some parts of it
MSWUpdateFieldsWidths();
if ( HasFlag(wxSTB_ELLIPSIZE_START) ||
HasFlag(wxSTB_ELLIPSIZE_MIDDLE) ||
HasFlag(wxSTB_ELLIPSIZE_END) )
{
for (int i=0; i<GetFieldsCount(); i++)
{
// re-set the field text, in case we need to ellipsize
// (or de-ellipsize) some parts of it
DoUpdateStatusText(i);
}
}
}
return wxStatusBarBase::MSWWindowProc(nMsg, wParam, lParam);