X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e9321277925fc8eb439dd713fc7015cc873f0c38..633e19307ce18ce24837db616feb9dda848056dd:/interface/wx/filedlg.h diff --git a/interface/wx/filedlg.h b/interface/wx/filedlg.h index e8dd236323..ac7daba24a 100644 --- a/interface/wx/filedlg.h +++ b/interface/wx/filedlg.h @@ -17,6 +17,15 @@ enum wxFD_PREVIEW = 0x0100 }; +#define wxFD_DEFAULT_STYLE wxFD_OPEN + +/** + Default wildcard string used in wxFileDialog corresponding to all files. + + It is defined as "*.*" under MSW and OS/2 and "*" everywhere else. +*/ +const char wxFileSelectorDefaultWildcardStr[]; + /** @class wxFileDialog @@ -174,6 +183,26 @@ public: */ virtual ~wxFileDialog(); + /** + Returns the path of the file currently selected in dialog. + + Notice that this file is not necessarily going to be accepted by the + user, so calling this function mostly makes sense from an update UI + event handler of a custom file dialog extra control to update its state + depending on the currently selected file. + + Currently this function is fully implemented under GTK and MSW and + always returns an empty string elsewhere. + + @since 2.9.5 + + @return The path of the currently selected file or an empty string if + nothing is selected. + + @see SetExtraControlCreator() + */ + virtual wxString GetCurrentlySelectedFilename() const; + /** Returns the default directory. */ @@ -358,11 +387,40 @@ wxString wxFileSelector(const wxString& message, const wxString& default_path = wxEmptyString, const wxString& default_filename = wxEmptyString, const wxString& default_extension = wxEmptyString, - const wxString& wildcard = ".", + const wxString& wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, wxWindow* parent = NULL, - int x = -1, - int y = -1); + int x = wxDefaultCoord, + int y = wxDefaultCoord); + +/** + An extended version of wxFileSelector +*/ +wxString wxFileSelectorEx(const wxString& message = wxFileSelectorPromptStr, + const wxString& default_path = wxEmptyString, + const wxString& default_filename = wxEmptyString, + int *indexDefaultExtension = NULL, + const wxString& wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = wxDefaultCoord, + int y = wxDefaultCoord); + +/** + Ask for filename to load +*/ +wxString wxLoadFileSelector(const wxString& what, + const wxString& extension, + const wxString& default_name = wxEmptyString, + wxWindow *parent = NULL); + +/** + Ask for filename to save +*/ +wxString wxSaveFileSelector(const wxString& what, + const wxString& extension, + const wxString& default_name = wxEmptyString, + wxWindow *parent = NULL); //@}