]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/frame.cpp
default font for dialog
[wxWidgets.git] / src / gtk / frame.cpp
index 13d018c53b6ab980107ce6d2ee2449696e0c9cac..6f7ffa47a8ea1ef453f74a34a874e22b9c876185 100644 (file)
@@ -216,7 +216,7 @@ gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *ev
 
     if (!win->m_hasVMT)
         return FALSE;
-
+    
 #if (GTK_MINOR_VERSION > 0)
     int x = 0;
     int y = 0;
@@ -253,37 +253,46 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
        position in "realize" */
     gtk_widget_set_uposition( widget, win->m_x, win->m_y );
 
-    /* all this is for Motif Window Manager "hints" and is supposed to be
-       recognized by other WM as well. not tested. */
-    long decor = (long) GDK_DECOR_BORDER;
-    long func = (long) GDK_FUNC_MOVE;
-
-    if ((win->GetWindowStyle() & wxCAPTION) != 0)
-        decor |= GDK_DECOR_TITLE;
-    if ((win->GetWindowStyle() & wxSYSTEM_MENU) != 0)
-    {
-       decor |= GDK_DECOR_MENU;
-       func |= GDK_FUNC_CLOSE;
-    }
-    if ((win->GetWindowStyle() & wxMINIMIZE_BOX) != 0)
+    if ((win->m_miniEdge > 0) || (win->HasFlag(wxSIMPLE_BORDER)))
     {
-        func |= GDK_FUNC_MINIMIZE;
-        decor |= GDK_DECOR_MINIMIZE;
+        /* This is a mini-frame or a borderless frame. */
+        gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)0 );
+        gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)0 );
     }
-    if ((win->GetWindowStyle() & wxMAXIMIZE_BOX) != 0)
-    {
-        func |= GDK_FUNC_MAXIMIZE;
-        decor |= GDK_DECOR_MAXIMIZE;
-    }
-    if ((win->GetWindowStyle() & wxRESIZE_BORDER) != 0)
+    else
     {
-       func |= GDK_FUNC_RESIZE;
-       decor |= GDK_DECOR_RESIZEH;
+        /* All this is for Motif Window Manager "hints" and is supposed to be
+           recognized by other WM as well. Not tested. */
+        long decor = (long) GDK_DECOR_BORDER;
+        long func = (long) GDK_FUNC_MOVE;
+
+        if ((win->GetWindowStyle() & wxCAPTION) != 0)
+            decor |= GDK_DECOR_TITLE;
+        if ((win->GetWindowStyle() & wxSYSTEM_MENU) != 0)
+        {
+            decor |= GDK_DECOR_MENU;
+            func |= GDK_FUNC_CLOSE;
+        }
+        if ((win->GetWindowStyle() & wxMINIMIZE_BOX) != 0)
+        {
+            func |= GDK_FUNC_MINIMIZE;
+            decor |= GDK_DECOR_MINIMIZE;
+        }
+        if ((win->GetWindowStyle() & wxMAXIMIZE_BOX) != 0)
+        {
+            func |= GDK_FUNC_MAXIMIZE;
+            decor |= GDK_DECOR_MAXIMIZE;
+        }
+        if ((win->GetWindowStyle() & wxRESIZE_BORDER) != 0)
+        {
+           func |= GDK_FUNC_RESIZE;
+           decor |= GDK_DECOR_RESIZEH;
+        }
+        
+        gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
+        gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);
     }
 
-    gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
-    gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);
-
     /* GTK's shrinking/growing policy */
     if ((win->GetWindowStyle() & wxRESIZE_BORDER) == 0)
         gtk_window_set_policy(GTK_WINDOW(win->m_widget), 0, 0, 1);
@@ -431,10 +440,12 @@ bool wxFrame::Create( wxWindow *parent,
     m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
 
     GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
-    if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
 
     m_widget = gtk_window_new( win_type );
 
+    if ((m_parent) && (HasFlag(wxFRAME_FLOAT_ON_PARENT)) && (GTK_IS_WINDOW(m_parent->m_widget)))
+        gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
+
     if (!name.IsEmpty())
         gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() );