45 m_lastTextBold( false ),
46 m_lastTextItalic( false ),
52 m_drawSpecificConvert( true ),
53 m_drawSpecificUnit( false ),
54 m_inDrawShape( false ),
55 m_inTwoClickPlace( false )
64 auto isDrawingCondition =
68 return item && item->
IsNew();
91 bool ignorePrimePosition =
false;
133 ignorePrimePosition =
true;
141 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
147 bool isSyntheticClick = item && evt->IsActivate() && evt->HasPosition()
150 if( evt->IsCancelInteractive() )
164 else if( evt->IsActivate() && !isSyntheticClick )
166 if( item && evt->IsMoveTool() )
169 evt->SetPassEvent(
false );
176 evt->SetPassEvent(
false );
180 if( evt->IsPointEditor() )
184 else if( evt->IsMoveTool() )
194 else if( evt->IsClick(
BUT_LEFT ) || evt->IsDblClick(
BUT_LEFT ) || isSyntheticClick )
210 item = pinTool->CreatePin(
VECTOR2I( cursorPos.
x, -cursorPos.
y ), symbol );
239 wxFAIL_MSG(
"TwoClickPlace(): unknown type" );
245 if( evt->IsPrime() && !ignorePrimePosition )
247 cursorPos =
grid.Align( evt->Position() );
276 switch( item->
Type() )
279 pinTool->PlacePin( (
LIB_PIN*) item );
285 wxFAIL_MSG(
"TwoClickPlace(): unknown type" );
382 bool isSyntheticClick = item && evt->IsActivate() && evt->HasPosition()
385 if( evt->IsCancelInteractive() )
397 else if( evt->IsActivate() && !isSyntheticClick )
402 if( evt->IsPointEditor() )
406 else if( evt->IsMoveTool() )
417 else if( evt->IsClick(
BUT_LEFT ) && !item )
461 else if( item && ( evt->IsClick(
BUT_LEFT )
502 symbol->AddDrawItem( item );
516 else if( evt->IsDblClick(
BUT_LEFT ) && !item )
566 if( evt->IsCancelInteractive() )
571 else if( evt->IsActivate() )
590 center.
x += offset.
x;
591 center.y -= offset.
y;
621 std::vector<LIB_PIN*> pins = symbol->GetAllLibPins();
constexpr EDA_IU_SCALE schIUScale
static TOOL_ACTION activatePointEditor
static TOOL_ACTION refreshPreview
void ShowInfoBarMsg(const wxString &aMsg, bool aShowCloseButton=false)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an info icon on the left of...
WX_INFOBAR * GetInfoBar()
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
virtual void SetParent(EDA_ITEM *aParent)
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
FILL_T GetFillMode() const
void SetFillColor(const COLOR4D &aColor)
COLOR4D GetFillColor() const
const EDA_ANGLE & GetTextAngle() const
GR_TEXT_H_ALIGN_T GetHorizJustify() const
void SetTextSize(const VECTOR2I &aNewSize)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
void SetItalic(bool aItalic)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
static TOOL_ACTION properties
static TOOL_ACTION clearSelection
Clears the current selection.
static TOOL_ACTION placeSymbolAnchor
static TOOL_ACTION drawCircle
static TOOL_ACTION placeSymbolText
static TOOL_ACTION addItemToSel
Selects an item (specified as the event parameter).
static TOOL_ACTION drawRectangle
static TOOL_ACTION drawSymbolTextBox
static TOOL_ACTION drawSymbolLines
static TOOL_ACTION finishDrawing
static TOOL_ACTION drawArc
static TOOL_ACTION repeatDrawItem
static TOOL_ACTION placeSymbolPin
A color representation with 4 components: red, green, blue, alpha.
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
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 VECTOR2D GetMousePosition(bool aWorldCoordinates=true) const =0
Return the current mouse pointer position.
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.
virtual void PinCursorInsideNonAutoscrollArea(bool aWarpMouseCursor)=0
const VECTOR2D & GetCenter() const
Return the center point of this VIEW (in world space coordinates).
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
void RecacheAllItems()
Rebuild GAL display lists.
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
The base class for drawable items used by schematic library symbols.
void SetPosition(const VECTOR2I &aPosition) override
void SetConvert(int aConvert)
STROKE_PARAMS GetStroke() const
void BeginEdit(const VECTOR2I &aStartPoint) override
Begin drawing a symbol library draw item at aPosition.
void SetStroke(const STROKE_PARAMS &aStroke)
void EndEdit() override
End an object editing action.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool ContinueEdit(const VECTOR2I &aPosition) override
Continue an edit in progress at aPosition.
void CalcEdit(const VECTOR2I &aPosition) override
Calculate the attributes of an item at aPosition when it is being edited.
Define a library symbol object.
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
void SetOffset(const VECTOR2I &aOffset)
Move the symbol aOffset.
Define a symbol library graphical text item.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
The symbol library editor main window.
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
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.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
static constexpr EDA_ANGLE & ANGLE_HORIZONTAL
#define IS_NEW
New item, just created.
#define IS_MOVING
Item being moved.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
bool NoPrintableChars(const wxString &aString)
Return true if the string is empty or contains only whitespace.
PLOT_DASH_TYPE
Dashed line types.
constexpr int MilsToIU(int mils) const
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.