X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/75bc8b3454bd2adda5bf3dc0e60984a275ea7ac3..e4097f77c440b1f31a80fe273cc732c14d606096:/interface/wx/filepicker.h?ds=sidebyside diff --git a/interface/wx/filepicker.h b/interface/wx/filepicker.h index 89466aaf09..a52f7f8b76 100644 --- a/interface/wx/filepicker.h +++ b/interface/wx/filepicker.h @@ -2,10 +2,28 @@ // Name: filepicker.h // Purpose: interface of wxFilePickerCtrl // Author: wxWidgets team -// RCS-ID: $Id$ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#define wxFLP_OPEN 0x0400 +#define wxFLP_SAVE 0x0800 +#define wxFLP_OVERWRITE_PROMPT 0x1000 +#define wxFLP_FILE_MUST_EXIST 0x2000 +#define wxFLP_CHANGE_DIR 0x4000 +#define wxFLP_SMALL wxPB_SMALL +#define wxFLP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) +#define wxFLP_DEFAULT_STYLE (wxFLP_OPEN|wxFLP_FILE_MUST_EXIST) + +#define wxDIRP_DIR_MUST_EXIST 0x0008 +#define wxDIRP_CHANGE_DIR 0x0010 +#define wxDIRP_SMALL wxPB_SMALL +#define wxDIRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) +#define wxDIRP_DEFAULT_STYLE (wxDIRP_DIR_MUST_EXIST) + +wxEventType wxEVT_FILEPICKER_CHANGED; +wxEventType wxEVT_DIRPICKER_CHANGED; + + /** @class wxFilePickerCtrl @@ -53,13 +71,15 @@ @library{wxcore} @category{pickers} - @appearance{filepickerctrl.png} + @appearance{filepickerctrl} @see wxFileDialog, wxFileDirPickerEvent */ class wxFilePickerCtrl : public wxPickerBase { public: + wxFilePickerCtrl(); + /** Initializes the object and calls Create() with all the parameters. @@ -130,6 +150,20 @@ public: */ void SetFileName(const wxFileName& filename); + /** + Set the directory to show when starting to browse for files. + + This function is mostly useful for the file picker controls which have + no selection initially to configure the directory that should be shown + if the user starts browsing for files as otherwise the directory of + initially selected file is used, which is usually the desired + behaviour and so the directory specified by this function is ignored in + this case. + + @since 2.9.4 + */ + void SetInitialDirectory(const wxString& dir); + /** Sets the absolute path of the currently selected file. This must be a valid file if the @c wxFLP_FILE_MUST_EXIST style was given. @@ -180,13 +214,15 @@ public: @library{wxcore} @category{pickers} - @appearance{dirpickerctrl.png} + @appearance{dirpickerctrl} @see wxDirDialog, wxFileDirPickerEvent */ class wxDirPickerCtrl : public wxPickerBase { public: + wxDirPickerCtrl(); + /** Initializes the object and calls Create() with all the parameters. @@ -253,8 +289,22 @@ public: void SetDirName(const wxFileName& dirname); /** - Sets the absolute path of (the default converter uses current locale's - charset)the currently selected directory. + Set the directory to show when starting to browse for directories. + + This function is mostly useful for the directory picker controls which + have no selection initially to configure the directory that should be + shown if the user starts browsing for directories as otherwise the + initially selected directory is used, which is usually the desired + behaviour and so the directory specified by this function is ignored in + this case. + + @since 2.9.4 + */ + void SetInitialDirectory(const wxString& dir); + + /** + Sets the absolute path of the currently selected directory (the default converter uses current locale's + charset). This must be a valid directory if @c wxDIRP_DIR_MUST_EXIST style was given. */ void SetPath(const wxString& dirname); @@ -283,6 +333,8 @@ public: class wxFileDirPickerEvent : public wxCommandEvent { public: + wxFileDirPickerEvent(); + /** The constructor is not normally used by the user code. */