X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da865fdd325f7833246eecd665849b14f43e19d7..2296fe5018d42d4e0bf9df07c37d31f60d972b32:/src/gtk/filedlg.cpp diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index 61925cde04..420c2e32c0 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -39,7 +39,6 @@ //----------------------------------------------------------------------------- extern void wxapp_install_idle_handler(); -extern bool g_isIdle; //----------------------------------------------------------------------------- // "clicked" for OK-button @@ -51,6 +50,10 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog) int style = dialog->GetStyle(); gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget)); + // gtk version numbers must be identical with the one in ctor (that calls set_do_overwrite_confirmation) +#if GTK_CHECK_VERSION(2,7,3) + if(gtk_check_version(2,7,3) != NULL) +#endif if ((style & wxSAVE) && (style & wxOVERWRITE_PROMPT)) { if ( g_file_test(filename, G_FILE_TEST_EXISTS) ) @@ -156,7 +159,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, GtkFileChooserAction gtk_action; GtkWindow* gtk_parent = NULL; if (parent) - gtk_parent = GTK_WINDOW(parent->m_widget); + gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(parent->m_widget) ); gchar* ok_btn_stock; if ( style & wxSAVE ) @@ -201,6 +204,11 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(defaultFileName)); + +#if GTK_CHECK_VERSION(2,7,3) + if (!gtk_check_version(2,7,3)) + gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(m_widget), TRUE); +#endif } else { @@ -267,6 +275,14 @@ bool wxFileDialog::Show( bool show ) return wxGenericFileDialog::Show( show ); } +void wxFileDialog::DoSetSize(int x, int y, int width, int height, int sizeFlags ) +{ + if (!m_wxwindow) + return; + else + wxGenericFileDialog::DoSetSize( x, y, width, height, sizeFlags ); +} + wxString wxFileDialog::GetPath() const { #ifdef __WXGTK24__