#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[];
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;
};
// 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
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);
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)
};
// (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
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; }
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)
};