82 makeEntry( aItem, aChangeType,
nullptr, aScreen );
97 Stage( item, aChangeType, aScreen);
105 for(
unsigned int i = 0; i < aItems.
GetCount(); i++ )
110 if( change_type == UNDO_REDO::UNSPECIFIED )
111 change_type = aModFlag;
115 assert( change_type == UNDO_REDO::CHANGED );
134 return entry ? entry->
m_type : 0;
178 if( change.m_item == aItem && change.m_screen == aScreen )
190 case UNDO_REDO::NEWITEM:
return CHT_ADD;
192 case UNDO_REDO::REGROUP:
return CHT_GROUP;
195 default: wxASSERT(
false );
return CHT_MODIFY;
204 case CHT_ADD:
return UNDO_REDO::NEWITEM;
206 case CHT_GROUP:
return UNDO_REDO::REGROUP;
209 default: wxASSERT(
false );
return UNDO_REDO::CHANGED;
Handles how to draw a screen (a board, a schematic ...)
Represent a set of changes (additions, deletions or modifications) of a data model (e....
virtual COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen=nullptr)
COMMIT & createModified(EDA_ITEM *aItem, EDA_ITEM *aCopy, int aExtraFlags=0, BASE_SCREEN *aScreen=nullptr)
std::set< EDA_ITEM * > m_deletedItems
COMMIT & Modified(EDA_ITEM *aItem, EDA_ITEM *aCopy, BASE_SCREEN *aScreen=nullptr)
virtual ~COMMIT()
Add a new item to the model.
COMMIT_LINE * findEntry(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Search for an entry describing change for a particular item.
virtual void makeEntry(EDA_ITEM *aItem, CHANGE_TYPE aType, EDA_ITEM *aCopy=nullptr, BASE_SCREEN *aScreen=nullptr)
std::set< EDA_ITEM * > m_changedItems
virtual EDA_ITEM * parentObject(EDA_ITEM *aItem) const =0
virtual EDA_ITEM * makeImage(EDA_ITEM *aItem) const =0
CHANGE_TYPE convert(UNDO_REDO aType) const
int GetStatus(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
std::vector< COMMIT_LINE > m_changes
A base class for most all the KiCad significant classes used in schematics and boards.
A holder to handle information on schematic or board items.
UNDO_REDO GetPickedItemStatus(unsigned int aIdx) const
EDA_ITEM * GetPickedItemLink(unsigned int aIdx) const
unsigned GetCount() const
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
CHANGE_TYPE
Types of changes.
@ CHT_DONE
Flag to indicate the change is already applied.
This file contains miscellaneous commonly used macros and functions.
EDA_ITEM * m_copy
Optional copy of the item.
CHANGE_TYPE m_type
Modification type.
EDA_ITEM * m_item
Main item that is added/deleted/modified.
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...