]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dialog.cpp
mini frame rewrite (titlebar still missing)
[wxWidgets.git] / src / gtk / dialog.cpp
index 822015862d24be615ad48589ae3bfa07b84f37a0..2bb5127425209927780dd287c4b9b6c613764ab9 100644 (file)
@@ -145,6 +145,29 @@ bool wxDialog::Create( wxWindow *parent,
 
     gtk_widget_realize( m_widget );
 
+    /* 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_ALL;
+    long func = (long) GDK_FUNC_ALL;
+    if ((m_windowStyle & wxCAPTION) == 0)
+       decor |= GDK_DECOR_TITLE;
+/*
+    if ((m_windowStyle & wxMINIMIZE) == 0)
+       func |= GDK_FUNC_MINIMIZE;
+    if ((m_windowStyle & wxMAXIMIZE) == 0)
+       func |= GDK_FUNC_MAXIMIZE;
+*/
+    if ((m_windowStyle & wxSYSTEM_MENU) == 0)
+       decor |= GDK_DECOR_MENU;
+    if ((m_windowStyle & wxMINIMIZE_BOX) == 0)
+       decor |= GDK_DECOR_MINIMIZE;
+    if ((m_windowStyle & wxMAXIMIZE_BOX) == 0)
+       decor |= GDK_DECOR_MAXIMIZE;
+    if ((m_windowStyle & wxRESIZE_BORDER) == 0)
+       func |= GDK_FUNC_RESIZE;
+    gdk_window_set_decorations(m_widget->window, (GdkWMDecoration)decor);
+    gdk_window_set_functions(m_widget->window, (GdkWMFunction)func);
+      
     gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
         GTK_SIGNAL_FUNC(gtk_dialog_size_callback), (gpointer)this );
 
@@ -236,17 +259,17 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event)
     // sure to destroy the dialog.
     // The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog.
 
-    static wxList closing;
+    static wxList s_closing;
 
-    if (closing.Member(this))
+    if (s_closing.Member(this))
         return;   // no loops
 
-    closing.Append(this);
+    s_closing.Append(this);
 
     wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
     cancelEvent.SetEventObject( this );
     GetEventHandler()->ProcessEvent(cancelEvent);
-    closing.DeleteObject(this);
+    s_closing.DeleteObject(this);
 }
 
 bool wxDialog::Destroy()