]> git.saurik.com Git - wxWidgets.git/commitdiff
modified wxFrame/Univ to send wxSizeEvent when adding/removing bars (because client...
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 6 Oct 2001 22:45:51 +0000 (22:45 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 6 Oct 2001 22:45:51 +0000 (22:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/univ/frame.h
src/univ/framuniv.cpp

index bfb03bf9a47d852ea57e6956fb443f800668cb37..4ad4f8e2f5115f1064b38bddee4e7953958d706f 100644 (file)
@@ -46,15 +46,28 @@ public:
     virtual wxPoint GetClientAreaOrigin() const;
     virtual bool Enable(bool enable = TRUE);
 
     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);
 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 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
 #endif // wxUSE_MENUS
 
 #if wxUSE_STATUSBAR
index f6b00d2b102d82e77059efa50f580a8727c30510..19b2c610cb47ae582c0c169da08ee2a820fdba95 100644 (file)
@@ -76,6 +76,13 @@ void wxFrame::OnSize(wxSizeEvent& event)
     event.Skip();
 }
 
     event.Skip();
 }
 
+void wxFrame::SendSizeEvent()
+{    
+    wxSizeEvent event(GetSize(), GetId());
+    event.SetEventObject(this);
+    GetEventHandler()->ProcessEvent(event);
+}
+
 #if wxUSE_MENUS
 
 void wxFrame::PositionMenuBar()
 #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
 #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
 #endif // wxUSE_STATUSBAR
 
 wxPoint wxFrame::GetClientAreaOrigin() const