X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cdc48273b49b0b90d9587a1ecc5935d38a160620..7d6a4d96961eac84d05db8bb24c64d39003f6e54:/src/gtk/dirdlg.cpp diff --git a/src/gtk/dirdlg.cpp b/src/gtk/dirdlg.cpp index 7f06ed819a..a877cbabfe 100644 --- a/src/gtk/dirdlg.cpp +++ b/src/gtk/dirdlg.cpp @@ -31,7 +31,9 @@ #include "wx/gtk/private.h" +#ifdef __UNIX__ #include // chdir +#endif //----------------------------------------------------------------------------- // "clicked" for OK-button @@ -96,6 +98,17 @@ wxDirDialog::wxDirDialog(wxWindow* parent, const wxPoint& pos, const wxSize& WXUNUSED(sz), const wxString& WXUNUSED(name)) +{ + Create(parent, title, defaultPath, style, pos); +} + +bool wxDirDialog::Create(wxWindow* parent, + const wxString& title, + const wxString& defaultPath, + long style, + const wxPoint& pos, + const wxSize& WXUNUSED(sz), + const wxString& WXUNUSED(name)) { m_message = title; @@ -106,7 +119,7 @@ wxDirDialog::wxDirDialog(wxWindow* parent, wxDefaultValidator, wxT("dirdialog"))) { wxFAIL_MSG( wxT("wxDirDialog creation failed") ); - return; + return false; } GtkWindow* gtk_parent = NULL; @@ -135,7 +148,7 @@ wxDirDialog::wxDirDialog(wxWindow* parent, // local-only property could be set to false to allow non-local files to be loaded. // In that case get/set_uri(s) should be used instead of get/set_filename(s) everywhere // and the GtkFileChooserDialog should probably also be created with a backend, - // e.g "gnome-vfs", "default", ... (gtk_file_chooser_dialog_new_with_backend). + // e.g. "gnome-vfs", "default", ... (gtk_file_chooser_dialog_new_with_backend). // Currently local-only is kept as the default - true: // gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(m_widget), true); @@ -144,7 +157,9 @@ wxDirDialog::wxDirDialog(wxWindow* parent, if ( !defaultPath.empty() ) gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(m_widget), - defaultPath.fn_str() ); + wxGTK_CONV_FN(defaultPath) ); + + return true; } void wxDirDialog::OnFakeOk(wxCommandEvent& WXUNUSED(event)) @@ -165,7 +180,7 @@ void wxDirDialog::SetPath(const wxString& dir) if (wxDirExists(dir)) { gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), - dir.fn_str()); + wxGTK_CONV_FN(dir)); } }