X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/69ffe1d20bc24433610a5f0cbe8105dea34b685c..236a9de39afa090fdee3cf91cb5364ceca69e3f8:/src/gtk/dialog.cpp diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index ee255c1890..55d5e95511 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -16,9 +16,10 @@ #include "wx/app.h" #include "wx/cursor.h" -#include "gdk/gdk.h" -#include "gtk/gtk.h" -#include "gdk/gdkkeysyms.h" +#include +#include +#include + #include "wx/gtk/win_gtk.h" //----------------------------------------------------------------------------- @@ -58,7 +59,8 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED if (g_isIdle) wxapp_install_idle_handler(); - win->Close(); + if (win->IsEnabled()) + win->Close(); return TRUE; } @@ -78,7 +80,7 @@ static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation { win->m_width = alloc->width; win->m_height = alloc->height; - win->UpdateSize(); + win->GtkUpdateSize(); } } @@ -265,8 +267,6 @@ bool wxDialog::Create( wxWindow *parent, const wxPoint &pos, const wxSize &size, long style, const wxString &name ) { - g_openDialogs++; - wxTopLevelWindows.Append( this ); m_needParent = FALSE; @@ -338,12 +338,11 @@ wxDialog::~wxDialog() wxTheApp->SetTopWindow( (wxWindow*) NULL ); } - if (wxTopLevelWindows.Number() == 0) + if ((wxTopLevelWindows.Number() == 0) && + (wxTheApp->GetExitOnFrameDelete())) { wxTheApp->ExitMainLoop(); } - - g_openDialogs--; } void wxDialog::SetTitle( const wxString& title ) @@ -468,6 +467,11 @@ void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) ) } } +void wxDialog::DoMoveWindow(int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(width), int WXUNUSED(height) ) +{ + wxFAIL_MSG( wxT("DoMoveWindow called for wxDialog") ); +} + void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags ) { wxASSERT_MSG( (m_widget != NULL), wxT("invalid dialog") ); @@ -623,10 +627,14 @@ int wxDialog::ShowModal() m_modalShowing = TRUE; + g_openDialogs++; + gtk_grab_add( m_widget ); gtk_main(); gtk_grab_remove( m_widget ); + g_openDialogs--; + return GetReturnCode(); }