+ if (!PreCreation(parent, pos, wxDefaultSize) ||
+ !CreateBase(parent, wxID_ANY, pos, wxDefaultSize, style,
+ wxDefaultValidator, wxT("filedialog")))
+ {
+ wxFAIL_MSG( wxT("wxFileDialog creation failed") );
+ return;
+ }
+
+ bool multiple = (style & wxMULTIPLE) == wxMULTIPLE;
+ GtkFileChooserAction gtk_action;
+ GtkWindow* gtk_parent = NULL;
+ if (parent)
+ gtk_parent = GTK_WINDOW(parent->m_widget);
+
+ gchar* ok_btn_stock;
+ if ((style & wxSAVE) == wxSAVE)
+ {
+ gtk_action = GTK_FILE_CHOOSER_ACTION_SAVE;
+ ok_btn_stock = GTK_STOCK_SAVE;
+ }
+ else
+ {
+ gtk_action = GTK_FILE_CHOOSER_ACTION_OPEN;
+ ok_btn_stock = GTK_STOCK_OPEN;
+ }
+ m_widget = gtk_file_chooser_dialog_new(
+ wxGTK_CONV(m_message),
+ gtk_parent,
+ gtk_action,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ ok_btn_stock, GTK_RESPONSE_ACCEPT,
+ NULL);
+
+ gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(m_widget), multiple);
+
+ gtk_signal_connect(GTK_OBJECT(m_widget),
+ "response",
+ GTK_SIGNAL_FUNC(gtk_filedialog_response_callback),
+ (gpointer*)this);
+
+ m_path = m_dir;
+ if (!m_path.empty() && m_path.Last() != wxT('/'))
+ m_path += wxT('/');
+ m_path += m_fileName;
+ SetPath(m_path);
+
+ SetWildcard(wildCard);
+ SetFilterIndex(0);
+ }
+ else
+#endif
+ wxGenericFileDialog::Create( parent, message, defaultDir, defaultFileName, wildCard, style, pos );
+}
+
+wxFileDialog::~wxFileDialog()
+{
+#ifdef __WXGTK24__
+ if (!gtk_check_version(2,4,0))
+ {
+ if (m_destroyed_by_delete)
+ m_widget = NULL;
+ }
+#endif
+}
+
+void wxFileDialog::OnFakeOk( wxCommandEvent &event )
+{
+#ifdef __WXGTK24__
+ if (!gtk_check_version(2,4,0))
+ wxDialog::OnOK( event );
+ else
+#endif
+ wxGenericFileDialog::OnListOk( event );
+}
+
+int wxFileDialog::ShowModal()
+{
+#ifdef __WXGTK24__
+ if (!gtk_check_version(2,4,0))
+ return wxDialog::ShowModal();
+ else
+#endif
+ return wxGenericFileDialog::ShowModal();
+}
+
+bool wxFileDialog::Show( bool show )
+{
+#ifdef __WXGTK24__
+ if (!gtk_check_version(2,4,0))
+ return wxDialog::Show( show );
+ else
+#endif
+ return wxGenericFileDialog::Show( show );
+}
+
+void wxFileDialog::GetFilenames(wxArrayString& files) const
+{
+#ifdef __WXGTK24__
+ if (!gtk_check_version(2,4,0))