X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec376c8fd9ff813392030426acd2317c6fa6527e..1fe0a566bbf649efe7cadc21e8ded82458c8bdc6:/src/gtk/filepicker.cpp?ds=sidebyside diff --git a/src/gtk/filepicker.cpp b/src/gtk/filepicker.cpp index 4370de3f9b..6784f90430 100644 --- a/src/gtk/filepicker.cpp +++ b/src/gtk/filepicker.cpp @@ -17,15 +17,12 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/gtk/private.h" -#include "wx/filepicker.h" +#if wxUSE_FILEPICKERCTRL && defined(__WXGTK26__) +#include "wx/filepicker.h" -#if wxUSE_TOOLTIPS #include "wx/tooltip.h" -#endif -#include #include #include // chdir @@ -35,8 +32,6 @@ // implementation // ============================================================================ -#if wxUSE_FILEPICKERCTRL && defined(__WXGTK26__) - //----------------------------------------------------------------------------- // wxFileButton //----------------------------------------------------------------------------- @@ -66,9 +61,13 @@ bool wxFileButton::Create( wxWindow *parent, wxWindowID id, } // create the dialog associated with this button + // NB: unlike generic implementation, native GTK implementation needs to create + // the filedialog here as it needs to use gtk_file_chooser_button_new_with_dialog() SetWindowStyle(style); m_path = path; - if (!CreateDialog(message, wildcard)) + m_message = message; + m_wildcard = wildcard; + if ((m_dialog = CreateDialog()) == NULL) return false; // little trick used to avoid problems when there are other GTK windows 'grabbed': @@ -122,7 +121,7 @@ void wxFileButton::OnDialogOK(wxCommandEvent& ev) if (ev.GetId() == wxID_OK) { // ...update our path - UpdatePathFromDialog(); + UpdatePathFromDialog(m_dialog); // ...and fire an event wxFileDirPickerEvent event(wxEVT_COMMAND_FILEPICKER_CHANGED, this, GetId(), m_path); @@ -199,8 +198,9 @@ bool wxDirButton::Create( wxWindow *parent, wxWindowID id, // create the dialog associated with this button SetWindowStyle(style); - m_path = path; - if (!CreateDialog(message, wildcard)) + m_message = message; + m_wildcard = wildcard; + if ((m_dialog = CreateDialog()) == NULL) return false; // little trick used to avoid problems when there are other GTK windows 'grabbed':