62 auto isDrawingCondition =
66 return item && item->
IsNew();
90 bool ignorePrimePosition =
false;
132 ignorePrimePosition =
true;
142 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
148 bool isSyntheticClick = item && evt->IsActivate() && evt->HasPosition()
151 if( evt->IsCancelInteractive() )
153 m_frame->GetInfoBar()->Dismiss();
165 else if( evt->IsActivate() && !isSyntheticClick )
167 if( item && evt->IsMoveTool() )
170 evt->SetPassEvent(
false );
176 m_frame->ShowInfoBarMsg(
_(
"Press <ESC> to cancel item creation." ) );
177 evt->SetPassEvent(
false );
181 if( evt->IsPointEditor() )
185 else if( evt->IsMoveTool() )
195 else if( evt->IsClick(
BUT_LEFT ) || evt->IsDblClick(
BUT_LEFT ) || isSyntheticClick )
210 item = pinTool->
CreatePin( cursorPos, symbol );
221 text->SetParent( symbol );
223 if(
m_frame->GetDrawSpecificUnit() )
226 if(
m_frame->GetDrawSpecificBodyStyle() )
232 schIUScale.MilsToIU( cfg->m_Defaults.text_size ) ) );
248 wxFAIL_MSG(
"TwoClickPlace(): unknown type" );
254 if( evt->IsPrime() && !ignorePrimePosition )
256 cursorPos =
grid.Align( evt->Position(),
grid.GetItemGrid( item ) );
271 m_view->AddToPreview( item,
false );
278 if(
m_frame->GetMoveWarpsCursor() )
288 switch( item->
Type() )
293 commit.
Push(
_(
"Place Pin" ) );
299 commit.
Push(
_(
"Draw Text" ) );
303 wxFAIL_MSG(
"TwoClickPlace(): unknown type" );
321 if( evt->HasParameter() )
330 m_view->AddToPreview( item,
false );
376 if( evt->IsCancelInteractive() )
381 else if( evt->IsActivate() )
395 symbol->
Move( -cursorPos );
399 m_view->RecacheAllItems();
constexpr EDA_IU_SCALE schIUScale
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
static TOOL_ACTION increment
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION refreshPreview
static TOOL_ACTION finishInteractive
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual void ClearEditFlags()
virtual void SetPosition(const VECTOR2I &aPos)
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.
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
Define a library symbol object.
void Move(const VECTOR2I &aOffset) override
Move the symbol aOffset.
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
virtual COMMON_SETTINGS * GetCommonSettings() const
static TOOL_ACTION placeSymbolPin
static TOOL_ACTION placeSymbolAnchor
static TOOL_ACTION placeSymbolText
static TOOL_ACTION repeatDrawItem
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Execute the changes.
Base class for any item which can be embedded within the SCHEMATIC container class,...
The symbol library editor main window.
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
#define IS_NEW
New item, just created.
#define IS_MOVING
Item being moved.
PGM_BASE & Pgm()
The global program "get" accessor.
T * GetAppSettings(const char *aFilename)
bool NoPrintableChars(const wxString &aString)
Return true if the string is empty or contains only whitespace.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
VECTOR2< int32_t > VECTOR2I