From 6821401b1bfd6f5e47091d886d5a7b456829ec69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 6 Oct 2001 22:45:51 +0000 Subject: [PATCH] modified wxFrame/Univ to send wxSizeEvent when adding/removing bars (because client area changes) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/univ/frame.h | 15 ++++++++++++++- src/univ/framuniv.cpp | 27 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/include/wx/univ/frame.h b/include/wx/univ/frame.h index bfb03bf9a4..4ad4f8e2f5 100644 --- a/include/wx/univ/frame.h +++ b/include/wx/univ/frame.h @@ -46,15 +46,28 @@ public: virtual wxPoint GetClientAreaOrigin() const; virtual bool Enable(bool enable = TRUE); +#if wxUSE_STATUSBAR + virtual wxStatusBar* CreateStatusBar(int number = 1, + long style = wxST_SIZEGRIP, + wxWindowID id = 0, + const wxString& name = wxStatusLineNameStr); +#endif // wxUSE_STATUSBAR + + protected: void OnSize(wxSizeEvent& event); - + + // sends wxSizeEvent to itself (used after attaching xxxBar) + void SendSizeEvent(); + 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(); + virtual void DetachMenuBar(); + virtual void AttachMenuBar(wxMenuBar *menubar); #endif // wxUSE_MENUS #if wxUSE_STATUSBAR diff --git a/src/univ/framuniv.cpp b/src/univ/framuniv.cpp index f6b00d2b10..19b2c610cb 100644 --- a/src/univ/framuniv.cpp +++ b/src/univ/framuniv.cpp @@ -76,6 +76,13 @@ void wxFrame::OnSize(wxSizeEvent& event) event.Skip(); } +void wxFrame::SendSizeEvent() +{ + wxSizeEvent event(GetSize(), GetId()); + event.SetEventObject(this); + GetEventHandler()->ProcessEvent(event); +} + #if wxUSE_MENUS void wxFrame::PositionMenuBar() @@ -90,6 +97,18 @@ void wxFrame::PositionMenuBar() } } +void wxFrame::DetachMenuBar() +{ + wxFrameBase::DetachMenuBar(); + SendSizeEvent(); +} + +void wxFrame::AttachMenuBar(wxMenuBar *menubar) +{ + wxFrameBase::AttachMenuBar(menubar); + SendSizeEvent(); +} + #endif // wxUSE_MENUS #if wxUSE_STATUSBAR @@ -104,6 +123,14 @@ void wxFrame::PositionStatusBar() } } +wxStatusBar* wxFrame::CreateStatusBar(int number, long style, + wxWindowID id, const wxString& name) +{ + wxStatusBar *bar = wxFrameBase::CreateStatusBar(number, style, id, name); + SendSizeEvent(); + return bar; +} + #endif // wxUSE_STATUSBAR wxPoint wxFrame::GetClientAreaOrigin() const -- 2.45.2