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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user