FILE_HISTORY(size_t aMaxFiles, int aBaseFileId, int aClearId, wxString aClearText=_("Clear Recent Files"))
Create a file history object to store a list of files and add them to a menu.
void AddFileToHistory(const wxString &aFile) override
Adds a file to the history.
void doAddClearItem(wxMenu *aMenu)
Add the clear menu item and the preceding separator to the given menu.
static bool isHistoryNotEmpty(const SELECTION &aSelection, const FILE_HISTORY &aHistory)
Test if the file history is empty.
static SELECTION_CONDITION FileHistoryNotEmpty(const FILE_HISTORY &aHistory)
Create a SELECTION_CONDITION that can be used to enable a menu item when the file history has items i...
void UpdateClearText(wxMenu *aMenu, wxString aClearText)
Update the text displayed on the menu item that clears the entire menu.
void doRemoveClearitem(wxMenu *aMenu)
Remove the clear menu item and the preceding separator from the given menu.
void ClearFileHistory()
Clear all entries from the file history.
void Save(APP_SETTINGS_BASE &aSettings)
Saves history into a JSON settings object.
void SetMaxFiles(size_t aMaxFiles)
Update the number of files that will be contained inside the file history.
void Load(const APP_SETTINGS_BASE &aSettings)
Loads history from a JSON settings object.
void AddFilesToMenu() override
Add the files to all registered menus.