X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/260020e39271329f71d1ef7912e3dc8216a2e924..4f2511d706e5274a34e1521e11c1b95fed735b42:/include/wx/generic/filectrlg.h diff --git a/include/wx/generic/filectrlg.h b/include/wx/generic/filectrlg.h index f4508e5e02..c1af5c2631 100644 --- a/include/wx/generic/filectrlg.h +++ b/include/wx/generic/filectrlg.h @@ -17,19 +17,20 @@ #include "wx/panel.h" #include "wx/listctrl.h" #include "wx/filectrl.h" +#include "wx/filename.h" class WXDLLIMPEXP_FWD_CORE wxCheckBox; class WXDLLIMPEXP_FWD_CORE wxChoice; class WXDLLIMPEXP_FWD_CORE wxStaticText; class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -extern WXDLLEXPORT_DATA(const wxChar) wxFileSelectorDefaultWildcardStr[]; +extern WXDLLIMPEXP_DATA_CORE(const char) wxFileSelectorDefaultWildcardStr[]; //----------------------------------------------------------------------------- // wxFileData - a class to hold the file info for the wxFileListCtrl //----------------------------------------------------------------------------- -class WXDLLEXPORT wxFileData +class WXDLLIMPEXP_CORE wxFileData { public: enum fileType @@ -124,7 +125,7 @@ private: // wxFileListCtrl //----------------------------------------------------------------------------- -class WXDLLEXPORT wxFileListCtrl : public wxListCtrl +class WXDLLIMPEXP_CORE wxFileListCtrl : public wxListCtrl { public: wxFileListCtrl(); @@ -201,7 +202,8 @@ public: const wxString& name = wxFileCtrlNameStr ) { m_ignoreChanges = false; - Create( parent, id, defaultDirectory, defaultFilename, wildCard, style, pos, size, name ); + Create(parent, id, defaultDirectory, defaultFilename, wildCard, + style, pos, size, name ); } virtual ~wxGenericFileCtrl() {} @@ -221,11 +223,14 @@ public: virtual bool SetDirectory( const wxString& dir ); // Selects a certain file. - // In case the filename specified isn't found/couldn't be shown with currently selected filter, false is returned and nothing happens + // In case the filename specified isn't found/couldn't be shown with + // currently selected filter, false is returned and nothing happens virtual bool SetFilename( const wxString& name ); - // chdirs 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 and if directory exists it's chdir'ed to + // 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 and if directory exists + // it's chdir'ed to virtual bool SetPath( const wxString& path ); virtual wxString GetFilename() const; @@ -236,12 +241,19 @@ public: virtual void GetFilenames( wxArrayString& files ) const; virtual int GetFilterIndex() const { return m_filterIndex; } - virtual bool HasMultipleFileSelection() const { return m_style & wxFC_MULTIPLE; } + virtual bool HasMultipleFileSelection() const + { return HasFlag(wxFC_MULTIPLE); } virtual void ShowHidden(bool show) { m_list->ShowHidden( show ); } void GoToParentDir(); void GoToHomeDir(); + // get the directory currently shown in the control: this can be different + // from GetDirectory() if the user entered a full path (with a path other + // than the one currently shown in the control) in the text control + // manually + wxString GetShownDirectory() const { return m_list->GetDir(); } + wxFileListCtrl *GetFileList() { return m_list; } void ChangeToReportMode() { m_list->ChangeToReportMode(); } @@ -259,9 +271,11 @@ private: void DoSetFilterIndex( int filterindex ); void UpdateControls(); - wxString DoGetFilename( const bool fullPath ) const; - void DoGetFilenames( wxArrayString& filenames, const bool fullPath ) const; - wxString GetProperFileListDir() const; + + // the first of these methods can only be used for the controls with single + // selection (i.e. without wxFC_MULTIPLE style), the second one in any case + wxFileName DoGetFileName() const; + void DoGetFilenames( wxArrayString& filenames, bool fullPath ) const; int m_style;