X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c99e2fd1b3432974b892be508c0757da5b6ad49..5c14ec264057d86fe60b2bacc09965492652cc0f:/interface/wx/filectrl.h?ds=sidebyside diff --git a/interface/wx/filectrl.h b/interface/wx/filectrl.h index 56be6351e8..03da7c8557 100644 --- a/interface/wx/filectrl.h +++ b/interface/wx/filectrl.h @@ -3,16 +3,28 @@ // Purpose: interface of wxFileCtrl // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +enum +{ + wxFC_OPEN = 0x0001, + wxFC_SAVE = 0x0002, + wxFC_MULTIPLE = 0x0004, + wxFC_NOSHOWHIDDEN = 0x0008 +}; + +#define wxFC_DEFAULT_STYLE wxFC_OPEN + /** @class wxFileCtrl This control allows the user to select a file. - Two implemetations exist, one for Gtk and another generic one for anything - other than Gtk. It is only available if @c wxUSE_FILECTRL is set to 1. + Two implementations of this class exist, one for Gtk and another generic + one for all the other ports. + + This class is only available if @c wxUSE_FILECTRL is set to 1. @beginStyleTable @style{wxFC_DEFAULT_STYLE} @@ -37,9 +49,13 @@ The user changed the current selection(by selecting or deselecting a file) @event{EVT_FILECTRL_FOLDERCHANGED(id, func)} The current folder of the file control has been changed + @event{EVT_FILECTRL_FILTERCHANGED(id, func)} + The current file filter of the file control has been changed. + @since 2.9.1. + @endEventTable - @library{wxbase} + @library{wxcore} @category{ctrl} @appearance{filectrl.png} @@ -84,7 +100,7 @@ public: wxFileCtrl(wxWindow* parent, wxWindowID id, const wxString& defaultDirectory = wxEmptyString, const wxString& defaultFilename = wxEmptyString, - const wxPoint& wildCard = wxFileSelectorDefaultWildcardStr, + const wxString& wildCard = wxFileSelectorDefaultWildcardStr, long style = wxFC_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -163,6 +179,16 @@ public: */ virtual bool SetFilename(const wxString& filename); + /** + Changes to a certain directory and selects a certain file. + + In case the filename specified isn't found/couldn't be shown with + currently selected filter, false is returned. + + @return Returns @true on success, @false otherwise + */ + virtual bool SetPath(const wxString& path); + /** Sets the current filter index, starting from zero. */ @@ -181,6 +207,11 @@ public: }; +wxEventType wxEVT_FILECTRL_SELECTIONCHANGED; +wxEventType wxEVT_FILECTRL_FILEACTIVATED; +wxEventType wxEVT_FILECTRL_FOLDERCHANGED; +wxEventType wxEVT_FILECTRL_FILTERCHANGED; + /** @class wxFileCtrlEvent @@ -195,6 +226,8 @@ public: The user changed the current selection(by selecting or deselecting a file) @event{EVT_FILECTRL_FOLDERCHANGED(id, func)} The current folder of the file control has been changed + @event{EVT_FILECTRL_FILTERCHANGED(id, func)} + The current file filter of the file control has been changed @endEventTable @library{wxbase} @@ -229,6 +262,16 @@ public: */ wxArrayString GetFiles() const; + /** + Returns the current file filter index. + + For a @b EVT_FILECTRL_FILTERCHANGED event, this method returns the new + file filter index. + + @since 2.9.1 + */ + int GetFilterIndex() const; + /** Sets the files changed by this event. */ @@ -239,5 +282,12 @@ public: Sets the directory of this event. */ void SetDirectory( const wxString &directory ); + + /** + Sets the filter index changed by this event. + + @since 2.9.1 + */ + void SetFilterIndex(int index); };