]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/dialog.cpp
let's not forget that \& has lower priority than == in C
[wxWidgets.git] / src / gtk1 / dialog.cpp
index 138fb5e769864fe9c47ddc12d8b4cea15feb588c..42360a061364878769c0c01813159f362874bb29 100644 (file)
@@ -38,33 +38,6 @@ extern bool g_isIdle;
 
 extern wxList wxPendingDelete;
 
-/*
-//-----------------------------------------------------------------------------
-// instruct X to set the WM hint for positioning
-//-----------------------------------------------------------------------------
-
-extern "C" {
-
-static void gdk_window_set_position_hint( GdkWindow *window, gint x, gint y )
-{
-  GdkWindowPrivate *priv;
-  XSizeHints size_hints;
-  
-  g_return_if_fail (window != NULL);
-  
-  priv = (GdkWindowPrivate*) window;
-  if (priv->destroyed) return;
-  
-  size_hints.flags = PPosition;
-  size_hints.x = x;
-  size_hints.y = y;
-   
-  XSetWMNormalHints (priv->xdisplay, priv->xwindow, &size_hints);
-}
-
-}
-*/
-
 //-----------------------------------------------------------------------------
 // "delete_event"
 //-----------------------------------------------------------------------------
@@ -150,9 +123,18 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
        position in "realize" and "map" */
     gtk_widget_set_uposition( widget, win->m_x, win->m_y );
 
-/*
-    gdk_window_set_position_hint( widget->window, win->m_x, win->m_y );
-*/
+    /* set size hints */
+    gint flag =        GDK_HINT_POS;
+    if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
+    if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
+    if (flag)
+    {
+        gdk_window_set_hints( win->m_widget->window, 
+                             win->m_x, win->m_y,
+                             win->GetMinWidth(), win->GetMinHeight(),
+                             win->GetMaxWidth(), win->GetMaxHeight(),
+                             flag );
+    }
 
     /* reset the icon */
     if (win->m_icon != wxNullIcon)
@@ -264,6 +246,7 @@ void wxDialog::Init()
     m_returnCode = 0;
     m_sizeSet = FALSE;
     m_modalShowing = FALSE;
+    m_isFrame = TRUE;
 }
 
 wxDialog::wxDialog( wxWindow *parent,
@@ -565,19 +548,6 @@ void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int heigh
     GetEventHandler()->ProcessEvent( event );
 }
 
-void wxDialog::Centre( int direction )
-{
-    wxASSERT_MSG( (m_widget != NULL), wxT("invalid dialog") );
-
-    int x = 0;
-    int y = 0;
-
-    if ((direction & wxHORIZONTAL) == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2;
-    if ((direction & wxVERTICAL) == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2;
-
-    Move( x, y );
-}
-
 void wxDialog::OnInternalIdle()
 {
     if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))