]> git.saurik.com Git - wxWidgets.git/commitdiff
* Add bool parameter to WindowDidResignKey indicating whether the menu bar
authorDavid Elliott <dfe@tgwbd.org>
Mon, 6 Oct 2003 18:54:59 +0000 (18:54 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Mon, 6 Oct 2003 18:54:59 +0000 (18:54 +0000)
  should be changed to the common menubar or remain installed.
* Add back some assertions to ensure the code is working as intended.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/mbarman.h
src/cocoa/mbarman.mm

index f21dac789953c7b494385e48ad4b82f8f897b1c8..52a8c058c7a8719e11f42d035d3a39ca35cdf48f 100644 (file)
@@ -43,7 +43,7 @@ public:
     void SetMainMenuBar(wxMenuBar* menubar);
     void CocoaInternalIdle();
     void WindowDidBecomeKey(wxTopLevelWindowNative *win);
-    void WindowDidResignKey(wxTopLevelWindowNative *win);
+    void WindowDidResignKey(wxTopLevelWindowNative *win, bool uninstallMenuBar = true);
     void WindowDidBecomeMain(wxTopLevelWindowNative *win);
     void WindowDidResignMain(wxTopLevelWindowNative *win);
     void UpdateWindowMenuBar(wxTopLevelWindowNative *win);
index b2b916054d5b8d502a20357107665708c960901c..ecdd3d3c164007ded940f679c7483f89a656f2cb 100644 (file)
@@ -161,21 +161,22 @@ void wxMenuBarManager::InstallMainMenu()
 
 void wxMenuBarManager::WindowDidBecomeKey(wxTopLevelWindowNative *win)
 {
-//    wxASSERT(!m_windowKey);
+    wxASSERT(!m_windowKey);
     m_windowKey = win;
     InstallMenuBarForWindow(win);
 }
 
-void wxMenuBarManager::WindowDidResignKey(wxTopLevelWindowNative *win)
+void wxMenuBarManager::WindowDidResignKey(wxTopLevelWindowNative *win, bool uninstallMenuBar)
 {
     wxASSERT(m_windowKey==win);
     m_windowKey = NULL;
-    SetMenuBar(NULL);
+    if(uninstallMenuBar)
+        SetMenuBar(NULL);
 }
 
 void wxMenuBarManager::WindowDidBecomeMain(wxTopLevelWindowNative *win)
 {
-//    wxASSERT(!m_windowMain);
+    wxASSERT(!m_windowMain);
     m_windowMain = win;
 }