From: Václav Slavík Date: Mon, 24 Sep 2001 18:01:13 +0000 (+0000) Subject: statusbar handling X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d08e6e59ed021b0ecfcbf0760347836d6cc45d11?ds=inline statusbar handling git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/univ/frame.h b/include/wx/univ/frame.h index 9a64bb8733..bfb03bf9a4 100644 --- a/include/wx/univ/frame.h +++ b/include/wx/univ/frame.h @@ -57,6 +57,11 @@ protected: virtual void PositionMenuBar(); #endif // wxUSE_MENUS +#if wxUSE_STATUSBAR + // override to update statusbar position when the frame size changes + virtual void PositionStatusBar(); +#endif // wxUSE_MENUS + DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxFrame) }; diff --git a/src/univ/framuniv.cpp b/src/univ/framuniv.cpp index 798ac4558d..f6b00d2b10 100644 --- a/src/univ/framuniv.cpp +++ b/src/univ/framuniv.cpp @@ -31,6 +31,7 @@ #include "wx/menu.h" #ifndef WX_PRECOMP #include "wx/frame.h" + #include "wx/statusbr.h" #endif // WX_PRECOMP // ============================================================================ @@ -68,6 +69,9 @@ void wxFrame::OnSize(wxSizeEvent& event) #if wxUSE_MENUS PositionMenuBar(); #endif // wxUSE_MENUS +#if wxUSE_STATUSBAR + PositionStatusBar(); +#endif // wxUSE_STATUSBAR event.Skip(); } @@ -88,6 +92,20 @@ void wxFrame::PositionMenuBar() #endif // wxUSE_MENUS +#if wxUSE_STATUSBAR + +void wxFrame::PositionStatusBar() +{ + if ( m_frameStatusBar ) + { + wxCoord heightBar = m_frameStatusBar->GetSize().y; + m_frameStatusBar->SetSize(0, GetClientSize().y, + GetClientSize().x, heightBar); + } +} + +#endif // wxUSE_STATUSBAR + wxPoint wxFrame::GetClientAreaOrigin() const { wxPoint pt = wxFrameBase::GetClientAreaOrigin(); @@ -105,12 +123,20 @@ wxPoint wxFrame::GetClientAreaOrigin() const void wxFrame::DoGetClientSize(int *width, int *height) const { wxFrameBase::DoGetClientSize(width, height); + #if wxUSE_MENUS if ( m_frameMenuBar && height ) { (*height) -= m_frameMenuBar->GetSize().y; } #endif // wxUSE_MENUS + +#if wxUSE_STATUSBAR + if ( m_frameStatusBar && height ) + { + (*height) -= m_frameStatusBar->GetSize().y; + } +#endif // wxUSE_STATUSBAR } void wxFrame::DoSetClientSize(int width, int height) @@ -121,6 +147,14 @@ void wxFrame::DoSetClientSize(int width, int height) height += m_frameMenuBar->GetSize().y; } #endif // wxUSE_MENUS + +#if wxUSE_STATUSBAR + if ( m_frameStatusBar ) + { + height += m_frameStatusBar->GetSize().y; + } +#endif // wxUSE_STATUSBAR + wxFrameBase::DoSetClientSize(width, height); }