X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/223d09f6b523aac674ef9b72a883dfa8d37c5d4e..80810ca399477ce4736bda433996db6a65bbcbd8:/src/gtk1/dialog.cpp diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 138fb5e769..42360a0613 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -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))