From a9152a05f8132181caa920309fba63c3784f8c71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 22 Sep 2001 11:56:23 +0000 Subject: [PATCH] fixed client area handling for wxFrame/Univ git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/univ/frame.h | 3 +++ src/univ/framuniv.cpp | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/wx/univ/frame.h b/include/wx/univ/frame.h index ab20d2f59e..9a64bb8733 100644 --- a/include/wx/univ/frame.h +++ b/include/wx/univ/frame.h @@ -49,6 +49,9 @@ public: protected: void OnSize(wxSizeEvent& event); + virtual void DoGetClientSize(int *width, int *height) const; + virtual void DoSetClientSize(int width, int height); + #if wxUSE_MENUS // override to update menu bar position when the frame size changes virtual void PositionMenuBar(); diff --git a/src/univ/framuniv.cpp b/src/univ/framuniv.cpp index 5beac71626..c1a2650051 100644 --- a/src/univ/framuniv.cpp +++ b/src/univ/framuniv.cpp @@ -103,6 +103,28 @@ wxPoint wxFrame::GetClientAreaOrigin() const return pt; } +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 +} + +void wxFrame::DoSetClientSize(int width, int height) +{ +#if wxUSE_MENUS + if ( m_frameMenuBar ) + { + height += m_frameMenuBar->GetSize().y; + } +#endif // wxUSE_MENUS + wxFrameBase::DoSetClientSize(width, height); +} + bool wxFrame::Enable(bool enable) { if (!wxFrameBase::Enable(enable)) -- 2.45.2