]> git.saurik.com Git - wxWidgets.git/commitdiff
simplify client size calculation
authorPaul Cornett <paulcor@bullseye.com>
Sun, 20 May 2007 02:35:15 +0000 (02:35 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sun, 20 May 2007 02:35:15 +0000 (02:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/frame.cpp

index 754e601fc54935a1827bf86e5a24c27963ef45e0..c535e66b930c3b93d53eb2e232485431257795d8 100644 (file)
@@ -209,52 +209,40 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const
 {
     wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
 
-    wxTopLevelWindow::DoGetClientSize( width, height );
+    wxFrameBase::DoGetClientSize(width, height);
 
     if (height)
     {
 #if wxUSE_MENUS_NATIVE
         // menu bar
-        if (m_frameMenuBar && !(m_fsIsShowing && (m_fsSaveFlag & wxFULLSCREEN_NOMENUBAR) != 0))
+        if (m_frameMenuBar &&
+            GTK_WIDGET_VISIBLE(m_frameMenuBar->m_widget) && !m_menuBarDetached)
         {
-            if (!m_menuBarDetached)
-                (*height) -= m_menuBarHeight;
-            else
-                (*height) -= wxPLACE_HOLDER;
+            *height -= m_menuBarHeight;
         }
 #endif // wxUSE_MENUS_NATIVE
 
 #if wxUSE_STATUSBAR
         // status bar
-        if (m_frameStatusBar && m_frameStatusBar->IsShown() &&
-            !(m_fsIsShowing && (m_fsSaveFlag & wxFULLSCREEN_NOSTATUSBAR) != 0))
-            (*height) -= wxSTATUS_HEIGHT;
+        if (m_frameStatusBar && GTK_WIDGET_VISIBLE(m_frameStatusBar->m_widget))
+            *height -= wxSTATUS_HEIGHT;
 #endif // wxUSE_STATUSBAR
     }
 
 #if wxUSE_TOOLBAR
     // tool bar
-    if (m_frameToolBar && m_frameToolBar->IsShown())
+    if (m_frameToolBar &&
+        GTK_WIDGET_VISIBLE(m_frameToolBar->m_widget) && !m_toolBarDetached)
     {
-        if (m_toolBarDetached)
+        if (m_frameToolBar->IsVertical())
         {
-            if (height != NULL)
-                *height -= wxPLACE_HOLDER;
+            if (width)
+                *width -= m_frameToolBar->GetSize().x;
         }
         else
         {
-            int x, y;
-            m_frameToolBar->GetSize( &x, &y );
-            if ( m_frameToolBar->IsVertical() )
-            {
-                if (width != NULL)
-                    *width -= x;
-            }
-            else
-            {
-                if (height != NULL)
-                    *height -= y;
-            }
+            if (height)
+                *height -= m_frameToolBar->GetSize().y;
         }
     }
 #endif // wxUSE_TOOLBAR