]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/frame.cpp
added translation of mac system into language, adaption of search paths
[wxWidgets.git] / src / gtk / frame.cpp
index 18d58ae61ef13b81cebf44ffb91ec529be567d93..fb364d258e6130ab0898cac62a7e347015a1c104 100644 (file)
@@ -23,7 +23,8 @@
 #define XIconifyWindow XICONIFYWINDOW
 #endif
 
-#include "wx/frame.h"
+#include "wx/defs.h"
+
 #include "wx/dialog.h"
 #include "wx/control.h"
 #include "wx/app.h"
@@ -64,9 +65,7 @@ extern int g_openDialogs;
 // event tables
 // ----------------------------------------------------------------------------
 
-#ifdef __WXUNIVERSAL__
-    IMPLEMENT_DYNAMIC_CLASS(wxFrameGTK, wxWindow)
-#else
+#ifndef __WXUNIVERSAL__
     IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
 #endif
 
@@ -154,7 +153,8 @@ static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WX
     return TRUE;
 }
 
-#if wxUSE_MENUS
+#if wxUSE_MENUS_NATIVE
+
 //-----------------------------------------------------------------------------
 // "child_attached" of menu bar
 //-----------------------------------------------------------------------------
@@ -178,7 +178,8 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
     win->m_menuBarDetached = TRUE;
     win->GtkUpdateSize();
 }
-#endif // wxUSE_MENUS
+
+#endif // wxUSE_MENUS_NATIVE
 
 #if wxUSE_TOOLBAR
 //-----------------------------------------------------------------------------
@@ -602,7 +603,7 @@ wxFrameGTK::~wxFrameGTK()
     }
 }
 
-bool wxFrame::ShowFullScreen(bool show, long style )
+bool wxFrameGTK::ShowFullScreen(bool show, long style )
 {
     if (show == m_fsIsShowing) return FALSE; // return what?
 
@@ -1051,17 +1052,14 @@ void wxFrameGTK::OnInternalIdle()
 // menu/tool/status bar stuff
 // ----------------------------------------------------------------------------
 
-#if wxUSE_MENUS
+#if wxUSE_MENUS_NATIVE
 
-void wxFrameGTK::SetMenuBar( wxMenuBar *menuBar )
+void wxFrameGTK::DetachMenuBar()
 {
     wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
     wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") );
 
-    if (menuBar == m_frameMenuBar)
-        return;
-
-    if (m_frameMenuBar)
+    if ( m_frameMenuBar )
     {
         m_frameMenuBar->UnsetInvokingWindow( this );
 
@@ -1079,7 +1077,12 @@ void wxFrameGTK::SetMenuBar( wxMenuBar *menuBar )
         gtk_widget_unparent( m_frameMenuBar->m_widget );
     }
 
-    m_frameMenuBar = menuBar;
+    wxFrameBase::DetachMenuBar();
+}
+
+void wxFrameGTK::AttachMenuBar( wxMenuBar *menuBar )
+{
+    wxFrameBase::AttachMenuBar(menuBar);
 
     if (m_frameMenuBar)
     {
@@ -1109,7 +1112,7 @@ void wxFrameGTK::SetMenuBar( wxMenuBar *menuBar )
     m_sizeSet = FALSE;
 }
 
-#endif // wxUSE_MENUS
+#endif // wxUSE_MENUS_NATIVE
 
 #if wxUSE_TOOLBAR
 
@@ -1229,9 +1232,14 @@ void wxFrameGTK::Iconize( bool iconize )
 {
    if (iconize)
    {
-        XIconifyWindow( GDK_WINDOW_XDISPLAY( m_widget->window ),
-                        GDK_WINDOW_XWINDOW( m_widget->window ),
-                        DefaultScreen( GDK_DISPLAY() ) );
+       GdkWindow *window = m_widget->window;
+
+       // you should do it later, for example from OnCreate() handler
+       wxCHECK_RET( window, _T("frame not created yet - can't iconize") );
+
+       XIconifyWindow( GDK_WINDOW_XDISPLAY( window ),
+                       GDK_WINDOW_XWINDOW( window ),
+                       DefaultScreen( GDK_DISPLAY() ) );
    }
 }
 
@@ -1240,22 +1248,12 @@ bool wxFrameGTK::IsIconized() const
     return m_isIconized;
 }
 
-void wxFrame::SetIconizeState(bool iconize)
+void wxFrameGTK::SetIconizeState(bool iconize)
 {
     if ( iconize != m_isIconized )
     {
         m_isIconized = iconize;
         (void)SendIconizeEvent(iconize);
     }
-    else
-    {
-        // this is not supposed to happen if we're called only from
-        // gtk_frame_(un)map_callback!
-        
-        // RR: I don't understand this test. Upon startup, the frame is
-        //     not iconized by default, it has just not been created
-        //     yet.
-        ///wxFAIL_MSG( _T("unexpected call to SendIconizeEvent ignored") );
-    }
 }