Update the field widths on demand in wxStatusBarGeneric.

This ensures that the value returned from GetFieldRect() is always up to date,
even when this method is called from the user-defined wxEVT_SIZE handler, i.e.
before our own OnSize() could run.

Also remove the now unneeded hack with calling the base class OnSize() from
the statbar sample.

Closes #14268.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-05-05 11:22:09 +00:00
parent 71940de693
commit 8e8d910979
3 changed files with 30 additions and 22 deletions

View File

@@ -947,11 +947,6 @@ void MyStatusBar::OnSize(wxSizeEvent& event)
return;
#endif
// TEMPORARY HACK: TODO find a more general solution
#ifdef wxStatusBarGeneric
wxStatusBar::OnSize(event);
#endif
wxRect rect;
if (!GetFieldRect(Field_Checkbox, rect))
{