37 m_moveInProgress( false ),
58 if( !
editor->IsSymbolEditable() )
61 if(
editor->IsSymbolAlias() )
104 bool unselect = selection.
IsHover();
117 bool restore_state =
false;
118 bool chain_commands =
false;
119 TOOL_EVENT* evt = const_cast<TOOL_EVENT*>( &aEvent );
140 LIB_ITEM* lib_item = static_cast<LIB_ITEM*>( selection.
Front() );
149 std::set<LIB_PIN*> sync_pins;
151 for(
EDA_ITEM* sel_item : selection )
153 lib_item = static_cast<LIB_ITEM*>( sel_item );
157 LIB_PIN* cur_pin = static_cast<LIB_PIN*>( lib_item );
159 std::vector<bool> got_unit( symbol->
GetUnitCount() + 1 );
161 got_unit[cur_pin->
GetUnit()] =
true;
166 if( !got_unit[
pin->GetUnit()]
173 if( sync_pins.insert(
pin ).second )
174 got_unit[
pin->GetUnit()] =
true;
193 if( lib_item->
IsNew() )
255 restore_state =
true;
285 restore_state =
true;
287 chain_commands =
true;
316 restore_state =
true;
318 catch(
const boost::bad_pointer& e )
320 restore_state =
true;
321 wxLogError(
"Boost pointer exception occurred: \"%s\"", e.what() );
332 }
while( ( evt =
Wait() ) );
338 if( !chain_commands )
344 item->ClearEditFlags();
371 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
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
static TOOL_ACTION doDelete
int GetOrientation() const
static TOOL_ACTION symbolMoveActivate
void SetFlags(EDA_ITEM_FLAGS aMask)
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()
Define a library symbol object.
static bool IdleSelection(const SELECTION &aSelection)
Test if all selected items are not being edited.
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 symbols.
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_MOVING
Item being moved.
bool IsSymbolAlias() const
Restore the empty editor screen, without any symbol or library selected.
const wxString & GetName() const
int GetUnitCount() const override
For items with units, return the number of units.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
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.
EDA_ITEM_FLAGS GetEditFlags() const
static VECTOR2D mapCoords(const wxPoint &aCoord)
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.
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.
LIB_PIN * GetNextPin(LIB_PIN *aItem=nullptr)
Return the next pin object from the draw list.
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.