46 m_lastTextAngle( 0.0 ),
48 m_drawSpecificConvert( true ),
49 m_drawSpecificUnit( false )
58 auto isDrawingCondition =
62 return item && item->
IsNew();
121 if( evt->IsCancelInteractive() )
133 else if( evt->IsActivate() )
138 if( evt->IsMoveTool() )
165 item = pinTool->CreatePin( wxPoint( cursorPos.x, -cursorPos.y ), part );
173 text->
SetPosition( wxPoint( cursorPos.x, -cursorPos.y ) );
174 text->
SetTextSize( wxSize( Mils2iu( settings->m_Defaults.text_size ),
175 Mils2iu( settings->m_Defaults.text_size ) ) );
188 wxFAIL_MSG(
"TwoClickPlace(): unknown type" );
212 switch( item->
Type() )
215 pinTool->PlacePin( (
LIB_PIN*) item );
221 wxFAIL_MSG(
"TwoClickPlace(): unknown type" );
242 static_cast<LIB_ITEM*>( item )->SetPosition( wxPoint( cursorPos.x, -cursorPos.y ) );
309 if( evt->IsCancelInteractive() )
319 else if( evt->IsActivate() )
324 if( evt->IsPointEditor() )
328 else if( evt->IsMoveTool() )
339 else if( evt->IsClick(
BUT_LEFT ) && !item )
360 item->
BeginEdit( wxPoint( cursorPos.
x, -cursorPos.
y ) );
391 item->
CalcEdit( wxPoint( cursorPos.
x, -cursorPos.
y) );
395 else if( evt->IsDblClick(
BUT_LEFT ) && !item )
444 if( evt->IsCancelInteractive() )
449 else if( evt->IsActivate() )
462 wxPoint offset( -cursorPos.
x, cursorPos.
y );
468 center.
x += offset.x;
469 center.y -= offset.y;
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 TOOL_ACTION properties
static TOOL_ACTION placeSymbolText
static TOOL_ACTION drawSymbolLines
FILL_TYPE
The set of fill types used in plotting or drawing enclosed areas.
static TOOL_ACTION activatePointEditor
Define a symbol library graphical text item.
const VECTOR2D & GetCenter() const
Return the center point of this VIEW (in world space coordinates).
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
virtual void SetWidth(int aWidth)=0
void SetFillMode(FILL_TYPE aFillMode)
void RecacheAllItems()
Rebuild GAL display lists.
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.
void SetTextSize(const wxSize &aNewSize)
virtual void CalcEdit(const wxPoint &aPosition)
Calculates the attributes of an item at aPosition when it is being edited.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
void SetCurrentCursor(KICURSOR cursor)
Set the current cursor shape for this panel.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
void SetOffset(const wxPoint &aOffset)
Move the part aOffset.
static TOOL_ACTION drawSymbolRectangle
void AddDrawItem(LIB_ITEM *aItem)
Add a new draw aItem to the draw object list.
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
static TOOL_ACTION placeSymbolPin
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
void SetFlags(STATUS_FLAGS aMask)
static TOOL_ACTION addItemToSel
Selects an item (specified as the event parameter).
virtual bool ContinueEdit(const wxPoint aPosition)
Continue an edit in progress at aPosition.
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SaveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aUndoType=UNDO_REDO::LIBEDIT, bool aAppend=false)
Create a copy of the current symbol, and save it in the undo list.
static TOOL_ACTION repeatDrawItem
static TOOL_ACTION drawSymbolCircle
Define a library symbol object.
static TOOL_ACTION clearSelection
Clears the current selection.
static TOOL_ACTION finishDrawing
#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.
void SetConvert(int aConvert)
virtual void BeginEdit(const wxPoint aPosition)
Begin drawing a component library draw item at aPosition.
static TOOL_ACTION drawSymbolArc
A base class for most all the KiCad significant classes used in schematics and boards.
void SetPosition(const wxPoint &aPosition) override
virtual void SetTextAngle(double aAngle)
bool NoPrintableChars(wxString aString)
Return true if the string is empty or contains only whitespace.
virtual void EndEdit()
End an object editing action.
#define IS_NEW
New item, just created.
virtual const wxString & GetText() const
Return the string associated with the text object.
static TOOL_ACTION placeSymbolAnchor
static TOOL_ACTION refreshPreview
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
static TOOL_ACTION cursorClick
KICAD_T Type() const
Returns the type of object.
The symbol library editor main window.