Audacity  2.2.2
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 
23 class AUDACITY_DLL_API FileHistory
24 {
25  public:
26  FileHistory(size_t maxfiles = 12, wxWindowID idbase = wxID_FILE);
27  virtual ~FileHistory();
28 
29  void AddFileToHistory(const wxString & file, bool update = true);
30  void RemoveFileFromHistory(size_t i, bool update = true);
31  void Clear();
32  void UseMenu(wxMenu *menu);
33  void RemoveMenu(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  size_t mMaxFiles;
45  wxWindowID mIDBase;
46 
47  std::vector<wxMenu*> mMenus;
48  wxArrayString mHistory;
49 
50 };
51 
52 #endif
size_t mMaxFiles
Definition: FileHistory.h:44
std::vector< wxMenu * > mMenus
Definition: FileHistory.h:47
wxArrayString mHistory
Definition: FileHistory.h:48
wxWindowID mIDBase
Definition: FileHistory.h:45
Similar to FileHistory, but customized to our needs.
Definition: FileHistory.h:23