X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/700d08c1092bd08150d47b952c1e0d817a64d75f..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/gtk/filectrl.h diff --git a/include/wx/gtk/filectrl.h b/include/wx/gtk/filectrl.h index c38c4debe0..3de17e3af8 100644 --- a/include/wx/gtk/filectrl.h +++ b/include/wx/gtk/filectrl.h @@ -4,7 +4,6 @@ // Author: Diaa M. Sami // Modified by: // Created: Aug-10-2007 -// RCS-ID: $Id$ // Copyright: (c) Diaa M. Sami // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -16,7 +15,7 @@ #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; @@ -32,7 +31,7 @@ typedef struct _GtkFileChooser GtkFileChooser; class WXDLLIMPEXP_CORE wxGtkFileChooser { public: - wxGtkFileChooser() {} + wxGtkFileChooser() { m_ignoreNextFilterEvent = false; } void SetWidget(GtkFileChooser *w); @@ -48,8 +47,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 @@ -74,9 +87,8 @@ public: Create( parent, id, defaultDirectory, defaultFilename, wildCard, style, pos, size, name ); } - virtual ~wxGtkFileCtrl() {}; + virtual ~wxGtkFileCtrl(); - void Init(); bool Create( wxWindow *parent, wxWindowID id, const wxString& defaultDirectory = wxEmptyString, @@ -104,6 +116,14 @@ public: virtual bool HasMultipleFileSelection() const { return HasFlag( wxFC_MULTIPLE ); } 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; @@ -112,6 +132,9 @@ protected: wxGtkFileChooser m_fc; wxString m_wildCard; +private: + void Init(); + DECLARE_DYNAMIC_CLASS( wxGtkFileCtrl ) };