return GetEventHandler()->ProcessEvent(event);
}
+void wxFrameBase::OnIdle(wxIdleEvent& WXUNUSED(event) )
+{
+#if wxUSE_MENUS
+ DoMenuUpdates();
+#endif // wxUSE_MENUS
+}
+
// ----------------------------------------------------------------------------
// status bar stuff
// ----------------------------------------------------------------------------
bool wxFrameBase::ShowMenuHelp(wxStatusBar *statbar, int menuId)
{
+#if wxUSE_MENUS
if ( !statbar )
return FALSE;
statbar->SetStatusText(helpString);
return !helpString.IsEmpty();
+#else // !wxUSE_MENUS
+ return FALSE;
+#endif // wxUSE_MENUS/!wxUSE_MENUS
}
#endif // wxUSE_STATUSBAR
#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
}
}
+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