void CommandHandler::OnReceiveCommand(AppCommandEvent &event) { // First retrieve the actual command from the event 'envelope'. Command *cmd = event.GetCommand(); // Then apply it to current application & project. Note that the // command may change the context - for example, switching to a // different project. cmd->Apply(*mCurrentContext); // Done with the command so delete it. delete cmd; // Redraw the project mCurrentContext->proj->RedrawProject(); }