122 if( aAppend || !lastUndo->
GetCount() )
123 commandToUndo = lastUndo;
133 ITEM_PICKER itemWrapper( aScreen, aItem, aCommandType );
136 switch( aCommandType )
140 commandToUndo->
PushItem( itemWrapper );
145 commandToUndo->
PushItem( itemWrapper );
149 wxFAIL_MSG(
wxString::Format( wxT(
"SaveCopyInUndoList() error (unknown code %X)" ),
164 delete commandToUndo;
183 if( aAppend || !lastUndo->
GetCount() )
184 commandToUndo = lastUndo;
194 commandToUndo->
CopyList( aItemsList );
198 for(
unsigned ii = 0; ii < aItemsList.
GetCount(); ii++ )
203 for(
unsigned ii = 0; ii < commandToUndo->
GetCount(); ii++ )
218 command = aTypeCommand;
243 wxFAIL_MSG(
wxString::Format( wxT(
"Unknown undo/redo command %d" ), command ) );
258 delete commandToUndo;
267 for(
int ii = aList->
GetCount() - 1; ii >= 0; ii-- )
305 else if( dynamic_cast<SCH_ITEM*>( eda_item ) )
322 SCH_COMPONENT* symbol = dynamic_cast<SCH_COMPONENT*>( item );
323 SCH_COMPONENT* altSymbol = dynamic_cast<SCH_COMPONENT*>( alt_item );
325 wxCHECK( symbol && altSymbol, );
333 static_cast<SCH_COMPONENT*>( item )->UpdatePins();
394 if( aItemCount == 0 )
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
EDA_ITEM * GetPickedItemLink(unsigned int aIdx) const
void ClearHiddenFlags()
Clear the hide flag of all items in the view.
void StartNewUndo()
Create a new, blank stack for future Undo commands to be pushed to.
UNDO_REDO_CONTAINER m_undoList
void RecacheAllItems()
Rebuild GAL display lists.
static TOOL_ACTION zoomFitScreen
void Restore(EDA_DRAW_FRAME *aFrame, KIGFX::VIEW *aView=nullptr)
BASE_SCREEN * GetScreenForItem(unsigned int aIdx) const
void RemoveFromScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen)
Remove an item from the screen (and view) aScreen is the screen the item is located on,...
virtual void PushCommandToUndoList(PICKED_ITEMS_LIST *aItem)
Add a command to undo in the undo list.
STATUS_FLAGS GetPickerFlags(unsigned aIdx) const
Return the value of the picker flag.
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
void SetLink(EDA_ITEM *aItem)
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
unsigned GetCount() const
A holder to handle a list of undo (or redo) commands.
void CopyList(const PICKED_ITEMS_LIST &aSource)
Copy all data from aSource to the list.
void SetFlags(STATUS_FLAGS aMask)
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
virtual void SwapData(SCH_ITEM *aItem)
Swap the internal data structures aItem with the schematic item.
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
bool SetPickedItem(EDA_ITEM *aItem, unsigned aIdx)
void SyncView()
Mark all items for refresh.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
SCHEMATIC & Schematic() const
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
Return the last command to undo and remove it from list, nothing is deleted.
void SetFlags(STATUS_FLAGS aFlags)
A holder to handle information on schematic or board items.
UNDO_REDO_CONTAINER m_redoList
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
UNDO_REDO_LIST
Remove the aItemCount of old commands from aList and delete commands, pickers and picked items if nee...
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
ITEM_PICKER GetItemWrapper(unsigned int aIdx) const
bool SetPickedItemStatus(UNDO_REDO aStatus, unsigned aIdx)
Set the type of undo/redo operation for a given picked item.
void AddToScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen)
Add an item to the screen (and view) aScreen is the screen the item is located on,...
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend)
Create a copy of the current schematic item, and put it in the undo list.
void RollbackSchematicFromUndo()
Performs an undo of the last edit WITHOUT logging a corresponding redo.
A base class for most all the KiCad significant classes used in schematics and boards.
bool SetPickedItemLink(EDA_ITEM *aLink, unsigned aIdx)
Set the link associated to a given picked item.
UNDO_REDO GetPickedItemStatus(unsigned int aIdx) const
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList)
Restore an undo or redo command to put data pointed by aList in the previous state.
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Free the undo or redo list from aList element.
STATUS_FLAGS GetFlags() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
void ClearListAndDeleteItems()
Delete the list of pickers AND the data pointed by #m_PickedItem or #m_PickedItemLink according to th...
void SwapSymbolLinks(const SCH_COMPONENT *aOriginalSymbol, const SCH_COMPONENT *aNewSymbol)
void SetConnectivityDirty(bool aDirty=true)
KICAD_T Type() const
Returns the type of object.