]> git.saurik.com Git - wxWidgets.git/commitdiff
don't show the status bar after restoring normal view after full screen if it had...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Nov 2004 12:53:34 +0000 (12:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Nov 2004 12:53:34 +0000 (12:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/frame.h
src/msw/frame.cpp

index 17fae5715a4b3db6df90070130e65763bcea46f5..7decd43e5c82708b5ace52b90be2cad9a8022a04 100644 (file)
@@ -142,11 +142,6 @@ protected:
     static bool           m_useNativeStatusBar;
 #endif // wxUSE_STATUSBAR
 
-    // Data to save/restore when calling ShowFullScreen
-    int                   m_fsStatusBarFields; // 0 for no status bar
-    int                   m_fsStatusBarHeight;
-    int                   m_fsToolBarHeight;
-
 private:
 #if wxUSE_TOOLTIPS
     WXHWND                m_hwndToolTip;
index edc5c5c22c5d5e3d2b39cb0ae5f8b23896069c78..6a1c68a3ec0bc61250a520e3f32bb90003aca2dd 100644 (file)
@@ -173,11 +173,6 @@ void wxFrame::Init()
     m_hwndToolTip = 0;
 #endif
 
-    // Data to save/restore when calling ShowFullScreen
-    m_fsStatusBarFields = 0;
-    m_fsStatusBarHeight = 0;
-    m_fsToolBarHeight = 0;
-
     m_wasMinimized = false;
 }
 
@@ -439,92 +434,75 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
 // Pass true to show full screen, false to restore.
 bool wxFrame::ShowFullScreen(bool show, long style)
 {
+    // TODO-CE: add support for CE
+#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
     if ( IsFullScreen() == show )
         return false;
 
     if (show)
     {
+        // zap the toolbar, menubar, and statusbar if needed
+        //
+        // TODO: hide commandbar for WINCE_WITH_COMMANDBAR
 #if wxUSE_TOOLBAR
-
-#if defined(WINCE_WITH_COMMANDBAR)
-        // TODO: hide commandbar
-#else
         wxToolBar *theToolBar = GetToolBar();
-        if (theToolBar)
-            theToolBar->GetSize(NULL, &m_fsToolBarHeight);
-
-        // zap the toolbar, menubar, and statusbar
 
         if ((style & wxFULLSCREEN_NOTOOLBAR) && theToolBar)
         {
-            theToolBar->SetSize(wxDefaultCoord,0);
-            theToolBar->Show(false);
+            if ( theToolBar->IsShown() )
+            {
+                theToolBar->SetSize(wxDefaultCoord,0);
+                theToolBar->Show(false);
+            }
+            else // prevent it from being restored later
+            {
+                style &= ~wxFULLSCREEN_NOTOOLBAR;
+            }
         }
-#endif // __WXWINCE__
 #endif // wxUSE_TOOLBAR
 
-#if defined(__WXMICROWIN__)
-#elif defined(__WXWINCE__)
-        // TODO: make it work for WinCE
-#else
         if (style & wxFULLSCREEN_NOMENUBAR)
             SetMenu((HWND)GetHWND(), (HMENU) NULL);
-#endif
 
 #if wxUSE_STATUSBAR
         wxStatusBar *theStatusBar = GetStatusBar();
-        if (theStatusBar)
-            theStatusBar->GetSize(NULL, &m_fsStatusBarHeight);
 
         // Save the number of fields in the statusbar
         if ((style & wxFULLSCREEN_NOSTATUSBAR) && theStatusBar)
         {
-            //m_fsStatusBarFields = theStatusBar->GetFieldsCount();
-            //SetStatusBar((wxStatusBar*) NULL);
-            //delete theStatusBar;
-            theStatusBar->Show(false);
+            if ( theStatusBar->IsShown() )
+                theStatusBar->Show(false);
+            else
+                style &= ~wxFULLSCREEN_NOSTATUSBAR;
         }
-        else
-            m_fsStatusBarFields = 0;
 #endif // wxUSE_STATUSBAR
     }
-    else
+    else // restore to normal
     {
+        // restore the toolbar, menubar, and statusbar if we had hid them
 #if wxUSE_TOOLBAR
-#if defined(WINCE_WITHOUT_COMMANDBAR)
-        // TODO: show commandbar
-#else
         wxToolBar *theToolBar = GetToolBar();
 
-        // restore the toolbar, menubar, and statusbar
-        if (theToolBar && (m_fsStyle & wxFULLSCREEN_NOTOOLBAR))
+        if ((m_fsStyle & wxFULLSCREEN_NOTOOLBAR) && theToolBar)
         {
-            theToolBar->SetSize(wxDefaultCoord, m_fsToolBarHeight);
             theToolBar->Show(true);
         }
-#endif // __WXWINCE__
 #endif // wxUSE_TOOLBAR
 
+        if ((m_fsStyle & wxFULLSCREEN_NOMENUBAR) && m_hMenu)
+            ::SetMenu(GetHwnd(), (HMENU)m_hMenu);
+
 #if wxUSE_STATUSBAR
-        if ( m_fsStyle & wxFULLSCREEN_NOSTATUSBAR )
+        wxStatusBar *theStatusBar = GetStatusBar();
+
+        if ((m_fsStyle & wxFULLSCREEN_NOSTATUSBAR) && theStatusBar)
         {
-            //CreateStatusBar(m_fsStatusBarFields);
-            if (GetStatusBar())
-            {
-                GetStatusBar()->Show(true);
-                PositionStatusBar();
-            }
+            theStatusBar->Show(true);
+            PositionStatusBar();
         }
 #endif // wxUSE_STATUSBAR
-
-#if defined(__WXMICROWIN__)
-#elif defined(__WXWINCE__)
-        // TODO: make it work for WinCE
-#else
-        if ((m_fsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0))
-            SetMenu((HWND)GetHWND(), (HMENU)m_hMenu);
-#endif
     }
+#endif // !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
 
     return wxFrameBase::ShowFullScreen(show, style);
 }