]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/frame.cpp
Added some docs
[wxWidgets.git] / src / gtk / frame.cpp
index 22ac5af1c2b9f5986a465d9c797d434d03ae4f7d..a8f5c7644d956805469e637648633ce65e087e65 100644 (file)
@@ -411,6 +411,7 @@ bool wxFrame::Create( wxWindow *parent,
     wxTopLevelWindows.Append( this );
 
     m_needParent = FALSE;
+    m_fsIsShowing = FALSE;
 
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
@@ -512,6 +513,48 @@ wxFrame::~wxFrame()
     }
 }
 
+bool wxFrame::ShowFullScreen(bool show, long style )
+{
+    if (show == m_fsIsShowing) return FALSE; // return what?
+
+    m_fsIsShowing = show;
+    
+    if (show)
+    {
+        m_fsSaveStyle = m_windowStyle;
+        m_fsSaveFlag = style;
+        GetPosition( &m_fsSaveFrame.x, &m_fsSaveFrame.y );
+        GetSize( &m_fsSaveFrame.width, &m_fsSaveFrame.height );
+        
+        gtk_widget_hide( m_widget );
+        gtk_widget_unrealize( m_widget );
+        
+        m_windowStyle = wxSIMPLE_BORDER;
+        
+        int x;
+        int y;
+        wxDisplaySize( &x, &y );
+        SetSize( 0, 0, x, y );
+        
+        gtk_widget_realize( m_widget );
+        gtk_widget_show( m_widget );
+    }
+    else
+    {
+        gtk_widget_hide( m_widget );
+        gtk_widget_unrealize( m_widget );
+    
+        m_windowStyle = m_fsSaveStyle;
+        
+        SetSize( m_fsSaveFrame.x, m_fsSaveFrame.y, m_fsSaveFrame.width, m_fsSaveFrame.height );
+        
+        gtk_widget_realize( m_widget );
+        gtk_widget_show( m_widget );
+    }
+    
+    return TRUE;
+}
+
 // ----------------------------------------------------------------------------
 // overridden wxWindow methods
 // ----------------------------------------------------------------------------
@@ -627,12 +670,12 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const
 
 #if wxUSE_STATUSBAR
         /* status bar */
-        if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT;
+        if (m_frameStatusBar && m_frameStatusBar->IsShown()) (*height) -= wxSTATUS_HEIGHT;
 #endif // wxUSE_STATUSBAR
 
 #if wxUSE_TOOLBAR
         /* tool bar */
-        if (m_frameToolBar)
+        if (m_frameToolBar && m_frameToolBar->IsShown())
         {
             if (m_toolBarDetached)
             {
@@ -678,12 +721,12 @@ void wxFrame::DoSetClientSize( int width, int height )
 
 #if wxUSE_STATUSBAR
         /* status bar */
-        if (m_frameStatusBar) height += wxSTATUS_HEIGHT;
+        if (m_frameStatusBar && m_frameStatusBar->IsShown()) height += wxSTATUS_HEIGHT;
 #endif
 
 #if wxUSE_TOOLBAR
         /* tool bar */
-        if (m_frameToolBar)
+        if (m_frameToolBar && m_frameToolBar->IsShown())
         {
             if (m_toolBarDetached)
             {
@@ -781,7 +824,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
         }
 
 #if wxUSE_TOOLBAR
-        if ((m_frameToolBar) &&
+        if ((m_frameToolBar) && m_frameToolBar->IsShown() &&
             (m_frameToolBar->m_widget->parent == m_mainWidget))
         {
             int xx = m_miniEdge;
@@ -837,7 +880,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
     }
 
 #if wxUSE_STATUSBAR
-    if (m_frameStatusBar)
+    if (m_frameStatusBar && m_frameStatusBar->IsShown())
     {
         int xx = 0 + m_miniEdge;
         int yy = m_height - wxSTATUS_HEIGHT - m_miniEdge - client_area_y_offset;