Audacity  2.3.1
FileHistory.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  FileHistory.h
6 
7  Leland Lucius
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_WIDGETS_FILEHISTORY__
12 #define __AUDACITY_WIDGETS_FILEHISTORY__
13 
14 #include <vector>
15 #include <algorithm>
16 #include <wx/defs.h>
17 #include <wx/choice.h>
18 #include <wx/event.h>
19 #include <wx/grid.h>
20 #include <wx/string.h>
21 #include <wx/window.h>
22 #include <wx/weakref.h>
23 
24 class AUDACITY_DLL_API FileHistory
25 {
26  public:
27  FileHistory(size_t maxfiles = 12, wxWindowID idbase = wxID_FILE);
28  virtual ~FileHistory();
29 
30  void AddFileToHistory(const wxString & file, bool update = true);
31  void RemoveFileFromHistory(size_t i, bool update = true);
32  void Clear();
33  void UseMenu(wxMenu *menu);
34  void Load(wxConfigBase& config, const wxString & group);
35  void Save(wxConfigBase& config, const wxString & group);
36 
37  void AddFilesToMenu();
38  void AddFilesToMenu(wxMenu *menu);
39 
40  size_t GetCount();
41  const wxString &GetHistoryFile(size_t i) const;
42 
43  private:
44  void Compress();
45 
46  size_t mMaxFiles;
47  wxWindowID mIDBase;
48 
49  std::vector< wxWeakRef< wxMenu > > mMenus;
50  wxArrayString mHistory;
51 
52 };
53 
54 #endif
std::vector< wxWeakRef< wxMenu > > mMenus
Definition: FileHistory.h:49
size_t mMaxFiles
Definition: FileHistory.h:46
wxArrayString mHistory
Definition: FileHistory.h:50
wxWindowID mIDBase
Definition: FileHistory.h:47
Similar to FileHistory, but customized to our needs.
Definition: FileHistory.h:24