+ wxString undoLabel = GetUndoMenuLabel();
+ wxString redoLabel = GetRedoMenuLabel();
+
+ m_commandEditMenu->SetLabel(wxID_UNDO, undoLabel);
+ m_commandEditMenu->Enable(wxID_UNDO, CanUndo());
+
+ m_commandEditMenu->SetLabel(wxID_REDO, redoLabel);
+ m_commandEditMenu->Enable(wxID_REDO, CanRedo());
+ }
+#endif // wxUSE_MENUS
+}
+
+// Gets the current Undo menu label.
+wxString wxCommandProcessor::GetUndoMenuLabel() const
+{
+ wxString buf;
+ if (m_currentCommand)
+ {
+ wxCommand *command = (wxCommand *)m_currentCommand->GetData();
+ wxString commandName(command->GetName());
+ if (commandName.empty()) commandName = _("Unnamed command");
+ bool canUndo = command->CanUndo();
+ if (canUndo)
+ buf = wxString(_("&Undo ")) + commandName + m_undoAccelerator;
+ else
+ buf = wxString(_("Can't &Undo ")) + commandName + m_undoAccelerator;
+ }
+ else
+ {
+ buf = _("&Undo") + m_undoAccelerator;
+ }
+
+ return buf;
+}
+
+// Gets the current Undo menu label.
+wxString wxCommandProcessor::GetRedoMenuLabel() const
+{
+ wxString buf;
+ if (m_currentCommand)
+ {
+ // We can redo, if we're not at the end of the history.
+ if (m_currentCommand->GetNext())