- if (m_commands.Number() == 0)
- {
- m_commandEditMenu->SetLabel(wxID_REDO, _("&Redo"));
- m_commandEditMenu->Enable(wxID_REDO, FALSE);
- }
- else
- {
- // currentCommand is NULL but there are commands: this means that
- // we've undone to the start of the list, but can redo the first.
- wxCommand *redoCommand = (wxCommand *)m_commands.First()->Data();
- wxString redoCommandName(redoCommand->GetName());
- if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
- buf = wxString(_("&Redo ")) + redoCommandName;
- m_commandEditMenu->SetLabel(wxID_REDO, buf);
- m_commandEditMenu->Enable(wxID_REDO, TRUE);
- }
- }
- }
-}
-
-void wxCommandProcessor::ClearCommands()
-{
- wxNode *node = m_commands.First();
- while (node)
- {
- wxCommand *command = (wxCommand *)node->Data();
- delete command;
- delete node;
- node = m_commands.First();
- }
- m_currentCommand = (wxNode *) NULL;
-}
-
-// ----------------------------------------------------------------------------
-// File history processor
-// ----------------------------------------------------------------------------
-
-wxFileHistory::wxFileHistory(int maxFiles)
-{
- m_fileMaxFiles = maxFiles;
- m_fileHistoryN = 0;
- m_fileHistory = new wxChar *[m_fileMaxFiles];
-}
-
-wxFileHistory::~wxFileHistory()
-{
- int i;
- for (i = 0; i < m_fileHistoryN; i++)
- delete[] m_fileHistory[i];
- delete[] m_fileHistory;
-}
-
-// File history management
-void wxFileHistory::AddFileToHistory(const wxString& file)
-{
- int i;
- // Check we don't already have this file
- for (i = 0; i < m_fileHistoryN; i++)
- {
- if (m_fileHistory[i] && wxString(m_fileHistory[i]) == file)
- return;
- }
-
- // Add to the project file history:
- // Move existing files (if any) down so we can insert file at beginning.