36 m_moveInProgress( false ),
55 wxCHECK( editor,
false );
103 bool unselect = selection.
IsHover();
115 bool restore_state =
false;
116 bool chain_commands =
false;
117 TOOL_EVENT* evt = const_cast<TOOL_EVENT*>( &aEvent );
138 LIB_ITEM* lib_item = static_cast<LIB_ITEM*>( selection.
Front() );
147 std::set<LIB_PIN*> sync_pins;
149 for(
EDA_ITEM* sel_item : selection )
151 lib_item = static_cast<LIB_ITEM*>( sel_item );
155 LIB_PIN* cur_pin = static_cast<LIB_PIN*>( lib_item );
159 got_unit[cur_pin->
GetUnit()] =
true;
163 if( !got_unit[pin->GetUnit()]
167 && pin->GetType() == cur_pin->
GetType()
168 && pin->GetName() == cur_pin->
GetName() )
170 if( sync_pins.insert( pin ).second )
171 got_unit[pin->GetUnit()] =
true;
177 for(
LIB_PIN* pin : sync_pins )
190 if( lib_item->
IsNew() )
252 restore_state =
true;
282 restore_state =
true;
284 chain_commands =
true;
313 restore_state =
true;
315 catch(
const boost::bad_pointer& e )
317 restore_state =
true;
318 wxLogError(
"Boost pointer exception occurred: \"%s\"", e.what() );
329 }
while( ( evt =
Wait() ) );
335 if( !chain_commands )
340 for(
auto item : selection )
341 item->ClearEditFlags();
368 static_cast<LIB_ITEM*>( aItem )->Offset(
mapCoords( aDelta ) );
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
static const TOOL_EVENT SelectedEvent
static TOOL_ACTION doDelete
int GetOrientation() const
static TOOL_ACTION symbolMoveActivate
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false, long aArrowCommand=0)=0
Move cursor to the requested position expressed in world coordinates.
virtual wxPoint GetPosition() const
void RollbackSymbolFromUndo()
static bool IdleSelection(const SELECTION &aSelection)
Test if all selected items are not being edited.
void SetCurrentCursor(KICURSOR cursor)
Set the current cursor shape for this panel.
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
The base class for drawable items used by schematic library components.
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
void SetFlags(STATUS_FLAGS aMask)
int GetUnitCount() const override
For items with units, return the number of units.
bool IsSymbolAlias() const
Restore the empty editor screen, without any part or library selected.
STATUS_FLAGS GetEditFlags() const
const wxString & GetName() const
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Define a library symbol object.
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
static const TOOL_EVENT SelectedItemsMoved
Used to inform tools that the selection should temporarily be non-editable.
static TOOL_ACTION clearSelection
Clears the current selection.
static VECTOR2D mapCoords(const wxPoint &aCoord)
#define IS_MOVED
Item being moved.
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
bool Empty() const
Checks if there is anything selected.
wxPoint GetPosition() const override
virtual unsigned int GetSize() const override
Return the number of stored items.
LIB_PIN * GetNextPin(LIB_PIN *aItem=NULL)
Return the next pin object from the draw list.
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
ELECTRICAL_PINTYPE GetType() const
bool IsSymbolEditable() const
Test if a symbol is loaded and can be edited.
A base class for most all the KiCad significant classes used in schematics and boards.
static TOOL_ACTION duplicate
static TOOL_ACTION refreshPreview
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
KICAD_T Type() const
Returns the type of object.
The symbol library editor main window.