]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/framecmn.cpp
Fixed the drawing of the HRules so they don't try to iterate over all
[wxWidgets.git] / src / common / framecmn.cpp
index 9ec8339d2f591c1320bfcd71b24e8c693b92ce97..318b662f28f77703de453322573db475a7c858d4 100644 (file)
@@ -321,6 +321,13 @@ bool wxFrameBase::SendIconizeEvent(bool iconized)
     return GetEventHandler()->ProcessEvent(event);
 }
 
+void wxFrameBase::OnIdle(wxIdleEvent& WXUNUSED(event) )
+{
+#if wxUSE_MENUS
+    DoMenuUpdates();
+#endif // wxUSE_MENUS
+}
+
 // ----------------------------------------------------------------------------
 // status bar stuff
 // ----------------------------------------------------------------------------
@@ -449,16 +456,9 @@ wxToolBar* wxFrameBase::OnCreateToolBar(long style,
 #endif // wxUSE_TOOLBAR
 
 // ----------------------------------------------------------------------------
-// Menu UI updating
+// menus
 // ----------------------------------------------------------------------------
 
-void wxFrameBase::OnIdle(wxIdleEvent& WXUNUSED(event) )
-{
-#if wxUSE_MENUS
-    DoMenuUpdates();
-#endif // wxUSE_MENUS
-}
-
 #if wxUSE_MENUS
 
 // update all menus
@@ -510,4 +510,35 @@ void wxFrameBase::DoMenuUpdates(wxMenu* menu, wxWindow* focusWin)
     }
 }
 
+void wxFrameBase::DetachMenuBar()
+{
+    if ( m_frameMenuBar )
+    {
+        m_frameMenuBar->Detach();
+        m_frameMenuBar = NULL;
+    }
+}
+
+void wxFrameBase::AttachMenuBar(wxMenuBar *menubar)
+{
+    if ( menubar )
+    {
+        m_frameMenuBar = menubar;
+        menubar->Attach((wxFrame *)this);
+    }
+}
+
+void wxFrameBase::SetMenuBar(wxMenuBar *menubar)
+{
+    if ( menubar == GetMenuBar() )
+    {
+        // nothing to do
+        return;
+    }
+
+    DetachMenuBar();
+
+    AttachMenuBar(menubar);
+}
+
 #endif // wxUSE_MENUS