Audacity  2.2.0
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/dynarray.h>
19 #include <wx/event.h>
20 #include <wx/grid.h>
21 #include <wx/string.h>
22 #include <wx/window.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 RemoveMenu(wxMenu *menu);
35  void Load(wxConfigBase& config, const wxString & group);
36  void Save(wxConfigBase& config, const wxString & group);
37 
38  void AddFilesToMenu();
39  void AddFilesToMenu(wxMenu *menu);
40 
41  size_t GetCount();
42  const wxString &GetHistoryFile(size_t i) const;
43 
44  private:
45  size_t mMaxFiles;
46  wxWindowID mIDBase;
47 
48  std::vector<wxMenu*> mMenus;
49  wxArrayString mHistory;
50 
51 };
52 
53 #endif
size_t mMaxFiles
Definition: FileHistory.h:45
std::vector< wxMenu * > mMenus
Definition: FileHistory.h:48
wxArrayString mHistory
Definition: FileHistory.h:49
wxWindowID mIDBase
Definition: FileHistory.h:46
Similar to FileHistory, but customized to our needs.
Definition: FileHistory.h:24