From bdc68939fb4cdf8e8b05c0f46f33fead906cc265 Mon Sep 17 00:00:00 2001 From: Gilles Depeyrot Date: Fri, 22 Nov 2002 07:13:39 +0000 Subject: [PATCH] remove OnSize handler which is in fact not needed now that width caching is based on caching the client width changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/statusbr.h | 1 - src/generic/statusbr.cpp | 15 ++------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/include/wx/generic/statusbr.h b/include/wx/generic/statusbr.h index 4452f353ad..fe00d93e30 100644 --- a/include/wx/generic/statusbr.h +++ b/include/wx/generic/statusbr.h @@ -92,7 +92,6 @@ public: void SetBorderY(int y); void OnPaint(wxPaintEvent& event); - void OnSize(wxSizeEvent& event); void OnLeftDown(wxMouseEvent& event); void OnRightDown(wxMouseEvent& event); diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp index 6926a245ae..00588ff0f6 100644 --- a/src/generic/statusbr.cpp +++ b/src/generic/statusbr.cpp @@ -49,7 +49,6 @@ BEGIN_EVENT_TABLE(wxStatusBarGeneric, wxWindow) EVT_PAINT(wxStatusBarGeneric::OnPaint) - EVT_SIZE(wxStatusBarGeneric::OnSize) EVT_LEFT_DOWN(wxStatusBarGeneric::OnLeftDown) EVT_RIGHT_DOWN(wxStatusBarGeneric::OnRightDown) EVT_SYS_COLOUR_CHANGED(wxStatusBarGeneric::OnSysColourChanged) @@ -299,10 +298,8 @@ bool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const GetClientSize(&width, &height); #endif - // we cache m_widthsAbs between calls normally but it's cleared when the - // status widths change so recompute it if needed and also if client width - // has changed to take into account the fact that derived OnSize is run - // before cache has been cleared in own OnSize + // we cache m_widthsAbs between calls and recompute it if client + // width has changed (or when it is initially empty) if ( m_widthsAbs.IsEmpty() || (m_lastClientWidth != width) ) { wxConstCast(this, wxStatusBarGeneric)-> @@ -383,14 +380,6 @@ void wxStatusBarGeneric::SetMinHeight(int height) } } -void wxStatusBarGeneric::OnSize(wxSizeEvent& event) -{ - // have to recompute the widths in pixels - m_widthsAbs.Empty(); - - event.Skip(); -} - void wxStatusBarGeneric::OnLeftDown(wxMouseEvent& event) { #ifdef __WXGTK20__