X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dfc3d7e025e919d9cf0d2e59d3c74bfab0b07e55..866592d872daa1f4e3d44948d7d3a6c90b0af9d0:/src/gtk/dialog.cpp diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index f9914dbc04..9812ec9c7b 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -18,6 +18,7 @@ #include "gdk/gdk.h" #include "gtk/gtk.h" #include "wx/gtk/win_gtk.h" +#include "wx/cursor.h" //----------------------------------------------------------------------------- // idle system @@ -69,19 +70,28 @@ static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation // "configure_event" //----------------------------------------------------------------------------- -static gint gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxDialog *win ) +static gint +#if (GTK_MINOR_VERSON > 0) +gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxDialog *win ) +#else +gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *event, wxDialog *win ) +#endif { if (g_isIdle) wxapp_install_idle_handler(); if (!win->m_hasVMT) return FALSE; +#if (GTK_MINOR_VERSON > 0) int x = 0; int y = 0; gdk_window_get_root_origin( win->m_widget->window, &x, &y ); - win->m_x = x; win->m_y = y; +#else + win->m_x = event->x; + win->m_y = event->y; +#endif wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() ); mevent.SetEventObject( win ); @@ -239,7 +249,12 @@ bool wxDialog::Create( wxWindow *parent, m_needParent = FALSE; - PreCreation( parent, id, pos, size, style, name ); + if (!PreCreation( parent, pos, size ) || + !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) + { + wxFAIL_MSG( _T("wxDialog creation failed") ); + return FALSE; + } m_insertCallback = (wxInsertChildFunction) wxInsertChildInDialog; @@ -393,11 +408,13 @@ void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) ) { wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") ); +#if wxUSE_CONSTRAINTS if (GetAutoLayout()) { Layout(); } else +#endif // wxUSE_CONSTRAINTS { /* no child: go out ! */ if (!GetChildren().First()) return; @@ -435,7 +452,7 @@ void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags ) int old_width = m_width; int old_height = m_height; - if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING) + if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0) { if (x != -1) m_x = x; if (y != -1) m_y = y; @@ -579,6 +596,8 @@ int wxDialog::ShowModal() return GetReturnCode(); } + wxBusyCursorSuspender cs; // temporarily suppress the busy cursor + Show( TRUE ); m_modalShowing = TRUE;