X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b34e141062f3ea9ef676e4202dda7ca4065d1b3..40b26d752de12e3e9f03172049c441de1a5e0276:/include/wx/filepicker.h?ds=inline diff --git a/include/wx/filepicker.h b/include/wx/filepicker.h index eb015b8ed6..e94746736b 100644 --- a/include/wx/filepicker.h +++ b/include/wx/filepicker.h @@ -14,15 +14,12 @@ #include "wx/defs.h" - #if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL -#include "wx/control.h" #include "wx/pickerbase.h" -#include "wx/filedlg.h" #include "wx/filename.h" - +class WXDLLIMPEXP_CORE wxDialog; class WXDLLIMPEXP_CORE wxFileDirPickerEvent; extern WXDLLEXPORT_DATA(const wxChar) wxFilePickerWidgetLabel[]; @@ -48,11 +45,11 @@ public: virtual ~wxFileDirPickerWidgetBase() { } wxString GetPath() const { return m_path; } - void SetPath(const wxString &str) { m_path=str; UpdateDialogPath(); } + virtual void SetPath(const wxString &str) { m_path=str; } protected: - virtual void UpdateDialogPath() = 0; - virtual void UpdatePathFromDialog() = 0; + virtual void UpdateDialogPath(wxDialog *) = 0; + virtual void UpdatePathFromDialog(wxDialog *) = 0; wxString m_path; }; @@ -159,13 +156,13 @@ protected: // used, a textctrl next to it. // ---------------------------------------------------------------------------- -#define wxFLP_USE_TEXTCTRL wxPB_USE_TEXTCTRL +#define wxFLP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) #ifdef __WXGTK__ // GTK apps usually don't have a textctrl next to the picker - #define wxFLP_DEFAULT_STYLE wxFLP_OPEN + #define wxFLP_DEFAULT_STYLE (wxFLP_OPEN) #else - #define wxFLP_DEFAULT_STYLE wxFLP_USE_TEXTCTRL|wxFLP_OPEN + #define wxFLP_DEFAULT_STYLE (wxFLP_USE_TEXTCTRL|wxFLP_OPEN) #endif class WXDLLIMPEXP_CORE wxFilePickerCtrl : public wxFileDirPickerCtrlBase @@ -220,13 +217,6 @@ public: // overrides return true; } - // extracts the style for our picker from wxFileDirPickerCtrlBase's style - long GetPickerStyle(long style) const - { - return (style & (wxFLP_OPEN|wxFLP_SAVE|wxFLP_OVERWRITE_PROMPT| - wxFLP_FILE_MUST_EXIST|wxFLP_CHANGE_DIR)); - } - bool CheckPath(const wxString &path) const { return HasFlag(wxFLP_SAVE) || wxFileName::FileExists(path); @@ -238,6 +228,14 @@ public: // overrides wxEventType GetEventType() const { return wxEVT_COMMAND_FILEPICKER_CHANGED; } +protected: + // extracts the style for our picker from wxFileDirPickerCtrlBase's style + long GetPickerStyle(long style) const + { + return (style & (wxFLP_OPEN|wxFLP_SAVE|wxFLP_OVERWRITE_PROMPT| + wxFLP_FILE_MUST_EXIST|wxFLP_CHANGE_DIR)); + } + private: DECLARE_DYNAMIC_CLASS(wxFilePickerCtrl) }; @@ -253,13 +251,13 @@ private: // (see wxDIRP_USE_TEXTCTRL) next to it. // ---------------------------------------------------------------------------- -#define wxDIRP_USE_TEXTCTRL wxPB_USE_TEXTCTRL +#define wxDIRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) #ifdef __WXGTK__ // GTK apps usually don't have a textctrl next to the picker #define wxDIRP_DEFAULT_STYLE 0 #else - #define wxDIRP_DEFAULT_STYLE wxDIRP_USE_TEXTCTRL + #define wxDIRP_DEFAULT_STYLE (wxDIRP_USE_TEXTCTRL) #endif class WXDLLIMPEXP_CORE wxDirPickerCtrl : public wxFileDirPickerCtrlBase @@ -299,10 +297,6 @@ public: // overrides return true; } - // extracts the style for our picker from wxFileDirPickerCtrlBase's style - long GetPickerStyle(long style) const - { return (style & (wxDIRP_DIR_MUST_EXIST|wxDIRP_CHANGE_DIR)); } - bool CheckPath(const wxString &path) const { if (HasFlag(wxDIRP_DIR_MUST_EXIST)) return wxFileName::DirExists(path); else return true; } @@ -312,6 +306,11 @@ public: // overrides wxEventType GetEventType() const { return wxEVT_COMMAND_DIRPICKER_CHANGED; } +protected: + // extracts the style for our picker from wxFileDirPickerCtrlBase's style + long GetPickerStyle(long style) const + { return (style & (wxDIRP_DIR_MUST_EXIST|wxDIRP_CHANGE_DIR)); } + private: DECLARE_DYNAMIC_CLASS(wxDirPickerCtrl) }; @@ -344,10 +343,13 @@ public: wxString GetPath() const { return m_path; } void SetPath(const wxString &p) { m_path = p; } + // default copy ctor, assignment operator and dtor are ok + virtual wxEvent *Clone() const { return new wxFileDirPickerEvent(*this); } + private: wxString m_path; - DECLARE_DYNAMIC_CLASS_NO_COPY(wxFileDirPickerEvent) + DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFileDirPickerEvent) }; // ----------------------------------------------------------------------------