- wxCommand *command = (wxCommand *)m_currentCommand->Data();
- wxString commandName(command->GetName());
- if (commandName == wxT("")) commandName = _("Unnamed command");
- bool canUndo = command->CanUndo();
- if (canUndo)
- buf = wxString(_("&Undo ")) + commandName + m_undoAccelerator;
- else
- buf = wxString(_("Can't &Undo ")) + commandName + m_undoAccelerator;
-
- //m_commandEditMenu->SetLabel(wxID_UNDO, buf);
- wxSetMenuLabelOptimally(m_commandEditMenu, wxID_UNDO, buf);
-
- m_commandEditMenu->Enable(wxID_UNDO, canUndo);
-
- // We can redo, if we're not at the end of the history.
- if (m_currentCommand->Next())
- {
- wxCommand *redoCommand = (wxCommand *)m_currentCommand->Next()->Data();
- wxString redoCommandName(redoCommand->GetName());
- if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
- buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
- wxSetMenuLabelOptimally(m_commandEditMenu, wxID_REDO, buf);
- m_commandEditMenu->Enable(wxID_REDO, TRUE);
- }
- else
- {
- wxSetMenuLabelOptimally(m_commandEditMenu, wxID_REDO, _("&Redo") + m_redoAccelerator);
- m_commandEditMenu->Enable(wxID_REDO, FALSE);
- }
+ wxCommand *redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData();
+ wxString redoCommandName(redoCommand->GetName());
+ if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
+ buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;