48 m_lastTextBold( false ),
49 m_lastTextItalic( false ),
55 m_drawSpecificConvert( true ),
56 m_drawSpecificUnit( false ),
57 m_inDrawShape( false ),
58 m_inTwoClickPlace( false )
67 auto isDrawingCondition =
71 return item && item->
IsNew();
94 bool ignorePrimePosition =
false;
136 ignorePrimePosition =
true;
144 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
150 bool isSyntheticClick = item && evt->IsActivate() && evt->HasPosition()
153 if( evt->IsCancelInteractive() )
167 else if( evt->IsActivate() && !isSyntheticClick )
169 if( item && evt->IsMoveTool() )
172 evt->SetPassEvent(
false );
179 evt->SetPassEvent(
false );
183 if( evt->IsPointEditor() )
187 else if( evt->IsMoveTool() )
197 else if( evt->IsClick(
BUT_LEFT ) || evt->IsDblClick(
BUT_LEFT ) || isSyntheticClick )
213 item = pinTool->CreatePin(
VECTOR2I( cursorPos.
x, -cursorPos.
y ), symbol );
242 wxFAIL_MSG(
"TwoClickPlace(): unknown type" );
248 if( evt->IsPrime() && !ignorePrimePosition )
250 cursorPos =
grid.Align( evt->Position(),
grid.GetItemGrid( item ) );
280 switch( item->
Type() )
283 pinTool->PlacePin( (
LIB_PIN*) item );
285 commit.
Push(
_(
"Add Pin" ) );
291 commit.
Push(
_(
"Add Text" ) );
295 wxFAIL_MSG(
"TwoClickPlace(): unknown type" );
351 bool isTextBox = !aDrawingShape.has_value();
352 SHAPE_T toolType = aDrawingShape.value_or( SHAPE_T::SEGMENT );
359 SHAPE_T shapeType = toolType == SHAPE_T::SEGMENT ? SHAPE_T::POLY : toolType;
362 wxString description;
406 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
412 bool isSyntheticClick = item && evt->IsActivate() && evt->HasPosition()
415 if( evt->IsCancelInteractive() )
427 else if( evt->IsActivate() && !isSyntheticClick )
432 if( evt->IsPointEditor() )
436 else if( evt->IsMoveTool() )
447 else if( evt->IsClick(
BUT_LEFT ) && !item )
471 description =
_(
"Add Text Box" );
476 description = wxString::Format(
_(
"Add %s" ), item->EDA_SHAPE::GetFriendlyName() );
493 else if( item && ( evt->IsClick(
BUT_LEFT )
507 if( toolType == SHAPE_T::POLY )
548 commit.
Push( description );
559 else if( evt->IsDblClick(
BUT_LEFT ) && !item )
609 if( evt->IsCancelInteractive() )
614 else if( evt->IsActivate() )
633 center.
x += offset.
x;
634 center.y -= offset.
y;
664 std::vector<LIB_PIN*> pins = symbol->GetAllLibPins();
constexpr EDA_IU_SCALE schIUScale
static TOOL_ACTION activatePointEditor
static TOOL_ACTION refreshPreview
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
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.
A base class for most all the KiCad significant classes used in schematics and boards.
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
void SetTextSize(VECTOR2I aNewSize)
const EDA_ANGLE & GetTextAngle() const
GR_TEXT_H_ALIGN_T GetHorizJustify() const
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 drawSymbolPolygon
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 EndEdit(bool aClosed=false) override
End an object editing action.
void SetStroke(const STROKE_PARAMS &aStroke)
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.
VECTOR2I GetPosition() const override
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_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
T * GetAppSettings()
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 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.