X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af6ad984611ccf8af3e9a470aede2bbe9931e8e5..55bfbcb92b41ab1c6a0d490f2f3fcadefc069bb7:/include/wx/filepicker.h diff --git a/include/wx/filepicker.h b/include/wx/filepicker.h index 5aebbe6f6f..8423c65f26 100644 --- a/include/wx/filepicker.h +++ b/include/wx/filepicker.h @@ -17,6 +17,7 @@ #if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL #include "wx/pickerbase.h" +#include "wx/filename.h" class WXDLLIMPEXP_CORE wxDialog; class WXDLLIMPEXP_CORE wxFileDirPickerEvent; @@ -78,7 +79,8 @@ protected: // NOTE: wxFileDirPickerCtrlBase will allocate a wx{File|Dir}PickerWidget and this // requires that all classes being mapped as wx{File|Dir}PickerWidget have the // same prototype for the contructor... -#if defined(__WXGTK26__) // since GTK >= 2.6, there is GtkFileButton +// since GTK >= 2.6, there is GtkFileButton +#if defined(__WXGTK26__) && !defined(__WXUNIVERSAL__) #include "wx/gtk/filepicker.h" #define wxFilePickerWidget wxFileButton #define wxDirPickerWidget wxDirButton @@ -214,6 +216,11 @@ public: validator, name); } + void SetFileName(const wxFileName &filename) + { SetPath(filename.GetFullPath()); } + + wxFileName GetFileName() const + { return wxFileName(GetPath()); } public: // overrides @@ -306,6 +313,11 @@ public: ); } + void SetDirName(const wxFileName &dirname) + { SetPath(dirname.GetPath()); } + + wxFileName GetDirName() const + { return wxFileName::DirName(GetPath()); } public: // overrides @@ -390,13 +402,6 @@ typedef void (wxEvtHandler::*wxFileDirPickerEventFunction)(wxFileDirPickerEvent& #define EVT_DIRPICKER_CHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_DIRPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn)) -#ifdef _WX_DEFINE_DATE_EVENTS_ - DEFINE_EVENT_TYPE(wxEVT_COMMAND_FILEPICKER_CHANGED) - DEFINE_EVENT_TYPE(wxEVT_COMMAND_DIRPICKER_CHANGED) - - IMPLEMENT_DYNAMIC_CLASS(wxFileDirPickerEvent, wxCommandEvent) -#endif - #endif // wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL