void PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList( wxCommandEvent& aEvent ) { if( UndoRedoBlocked() ) return; if( GetScreen()->GetRedoCommandCount() == 0 ) return; // Inform tools that redo command was issued m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } ); // Get the old list PICKED_ITEMS_LIST* List = GetScreen()->PopCommandFromRedoList(); // Redo the command PutDataInPreviousState( List, true ); // Put the old list in UndoList List->ReversePickersListOrder(); GetScreen()->PushCommandToUndoList( List ); OnModify(); m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_POST, AS_GLOBAL } ); m_canvas->Refresh(); }
/** * Function GetBoardFromUndoList * Undo the last edition: * - Save the current board state in Redo list * - Get an old version of the board state from Undo list */ void PCB_EDIT_FRAME::GetBoardFromUndoList( wxCommandEvent& event ) { if( GetScreen()->GetUndoCommandCount() <= 0 ) return; /* Get the old list */ PICKED_ITEMS_LIST* List = GetScreen()->PopCommandFromUndoList(); /* Undo the command */ PutDataInPreviousState( List, false ); /* Put the old list in RedoList */ List->ReversePickersListOrder(); GetScreen()->PushCommandToRedoList( List ); OnModify(); m_canvas->Refresh(); }
void SCH_EDIT_FRAME::GetSchematicFromRedoList( wxCommandEvent& event ) { if( GetScreen()->GetRedoCommandCount() == 0 ) return; /* Get the old list */ PICKED_ITEMS_LIST* List = GetScreen()->PopCommandFromRedoList(); /* Redo the command: */ PutDataInPreviousState( List, true ); /* Put the old list in UndoList */ List->ReversePickersListOrder(); GetScreen()->PushCommandToUndoList( List ); OnModify(); SetSheetNumberAndCount(); GetScreen()->TestDanglingEnds(); m_canvas->Refresh(); }
void PCB_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent ) { if( GetScreen()->GetUndoCommandCount() <= 0 ) return; // Inform tools that undo command was issued TOOL_EVENT event( TC_MESSAGE, TA_UNDO_REDO, AS_GLOBAL ); m_toolManager->ProcessEvent( event ); /* Get the old list */ PICKED_ITEMS_LIST* List = GetScreen()->PopCommandFromUndoList(); /* Undo the command */ PutDataInPreviousState( List, false ); /* Put the old list in RedoList */ List->ReversePickersListOrder(); GetScreen()->PushCommandToRedoList( List ); OnModify(); m_canvas->Refresh(); }