36 m_moveInProgress( false ),
57 if( !
editor->IsSymbolEditable() )
60 if(
editor->IsSymbolAlias() )
101 bool unselect = selection.
IsHover();
120 bool restore_state =
false;
121 bool chain_commands =
false;
153 std::set<LIB_PIN*> sync_pins;
155 for(
EDA_ITEM* sel_item : selection )
157 lib_item =
static_cast<LIB_ITEM*
>( sel_item );
163 std::vector<bool> got_unit( symbol->
GetUnitCount() + 1 );
165 got_unit[cur_pin->
GetUnit()] =
true;
171 if( !got_unit[
pin->GetUnit()]
178 if( sync_pins.insert(
pin ).second )
179 got_unit[
pin->GetUnit()] =
true;
198 if( lib_item->
IsNew() )
214 VECTOR2I itemPos = selection.GetTopLeftItem()->GetPosition();
260 restore_state =
true;
290 restore_state =
true;
292 chain_commands =
true;
323 if( !pinTool->
PlacePin( curr_pin ) )
324 restore_state =
true;
328 catch(
const boost::bad_pointer& e )
330 restore_state =
true;
331 wxLogError(
"Boost pointer exception occurred: \"%s\"", e.what() );
342 }
while( ( evt =
Wait() ) );
348 if( !chain_commands )
354 item->ClearEditFlags();
VECTOR2D mapCoords(const VECTOR2D &aSource)
static TOOL_ACTION duplicate
static TOOL_ACTION doDelete
static TOOL_ACTION cursorClick
static TOOL_ACTION refreshPreview
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
A base class for most all the KiCad significant classes used in schematics and boards.
EDA_ITEM_FLAGS GetEditFlags() const
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
static TOOL_ACTION clearSelection
Clears the current selection.
static TOOL_ACTION symbolMoveActivate
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
static const TOOL_EVENT SelectedItemsMoved
Used to inform tools that the selection should temporarily be non-editable.
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.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
virtual void WarpMouseCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
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 void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
The base class for drawable items used by schematic library symbols.
ELECTRICAL_PINTYPE GetType() const
int GetOrientation() const
VECTOR2I GetPosition() const override
const wxString & GetName() const
Define a library symbol object.
std::vector< LIB_PIN * > GetAllLibPins() const
Return a list of pin pointers for all units / converts.
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.
static bool IdleSelection(const SELECTION &aSelection)
Test if all selected items are not being edited.
virtual unsigned int GetSize() const override
Return the number of stored items.
bool Empty() const
Checks if there is anything selected.
The symbol library editor main window.
bool IsSymbolAlias() const
Return true if aLibId is an alias for the editor screen symbol.
bool IsSymbolEditable() const
Test if a symbol is loaded and can be edited.
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
void RollbackSymbolFromUndo()
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_MOVING
Item being moved.