X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7d61c83f406d54aefe0aac9b6de39bdc8f1c295f..a516284f67e1910fc6dc5364b289340332d0d35f:/include/wx/gtk/filectrl.h diff --git a/include/wx/gtk/filectrl.h b/include/wx/gtk/filectrl.h index 516fe62e12..d5c3848e76 100644 --- a/include/wx/gtk/filectrl.h +++ b/include/wx/gtk/filectrl.h @@ -9,12 +9,14 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifndef FILECTRL_H -#define FILECTRL_H + +#ifndef _WX_GTK_FILECTRL_H_ +#define _WX_GTK_FILECTRL_H_ #include "wx/control.h" +#include "wx/filectrl.h" -extern WXDLLEXPORT_DATA(const wxChar) wxFileSelectorDefaultWildcardStr[]; +extern WXDLLIMPEXP_DATA_CORE(const char) wxFileSelectorDefaultWildcardStr[]; typedef struct _GtkFileChooser GtkFileChooser; @@ -30,7 +32,7 @@ typedef struct _GtkFileChooser GtkFileChooser; class WXDLLIMPEXP_CORE wxGtkFileChooser { public: - wxGtkFileChooser() {} + wxGtkFileChooser() { m_ignoreNextFilterEvent = false; } void SetWidget(GtkFileChooser *w); @@ -46,8 +48,22 @@ public: void SetWildcard( const wxString& wildCard ); void SetFilterIndex( int filterIndex ); + bool HasFilterChoice() const; + + bool ShouldIgnoreNextFilterEvent() const { return m_ignoreNextFilterEvent; } + + wxString GetCurrentWildCard() const + { return m_wildcards[GetFilterIndex()]; } + private: GtkFileChooser *m_widget; + // First wildcard in filter, to be used when the user + // saves a file without giving an extension. + wxArrayString m_wildcards; + + // If true, ignore the next event because it was generated by us and not + // the user. + bool m_ignoreNextFilterEvent; }; #if wxUSE_FILECTRL @@ -100,7 +116,15 @@ public: virtual int GetFilterIndex() const { return m_fc.GetFilterIndex(); } virtual bool HasMultipleFileSelection() const { return HasFlag( wxFC_MULTIPLE ); } - virtual void ShowHidden(const bool show); + virtual void ShowHidden(bool show); + + virtual bool HasFilterChoice() const + { return m_fc.HasFilterChoice(); } + + + // Implementation only from now on. + bool GTKShouldIgnoreNextFilterEvent() const + { return m_fc.ShouldIgnoreNextFilterEvent(); } bool m_checkNextSelEvent; bool m_ignoreNextFolderChangeEvent; @@ -115,5 +139,5 @@ protected: #endif // wxUSE_FILECTRL -#endif // FILECTRL_H +#endif // _WX_GTK_FILECTRL_H_