30#include <wx/filehistory.h>
53 FILE_HISTORY(
size_t aMaxFiles,
int aBaseFileId,
int aClearId,
54 wxString aClearText =
_(
"Clear Recent Files" ) );
66 void Load(
const std::vector<wxString>& aList );
78 void Save( std::vector<wxString>* aList );
81 using wxFileHistory::Load;
82 using wxFileHistory::Save;
101 wxFileHistory::AddFilesToMenu();
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
This class implements a file history object to store a list of files, that can then be added to a men...
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.
void SetClearText(wxString aClearText)
Set the text displayed on the menu item that clears the entire menu.
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.
std::function< bool(const SELECTION &)> SELECTION_CONDITION
Functor type that checks a specific condition for selected items.