63 auto isDrawingCondition =
67 return item && item->
IsNew();
91 bool ignorePrimePosition =
false;
134 ignorePrimePosition =
true;
144 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
150 bool isSyntheticClick = item && evt->IsActivate() && evt->HasPosition()
153 if( evt->IsCancelInteractive() )
155 m_frame->GetInfoBar()->Dismiss();
162 else if( evt->IsActivate() && !isSyntheticClick )
164 if( item && evt->IsMoveTool() )
167 evt->SetPassEvent(
false );
173 m_frame->ShowInfoBarMsg(
_(
"Press <ESC> to cancel item creation." ) );
174 evt->SetPassEvent(
false );
178 if( evt->IsPointEditor() )
184 if( evt->IsMoveTool() )
187 frame()->PushTool( originalEvent );
209 item = pinTool->
CreatePin( cursorPos, symbol );
220 text->SetParent( symbol );
222 if(
m_frame->GetDrawSpecificUnit() )
225 if(
m_frame->GetDrawSpecificBodyStyle() )
231 schIUScale.MilsToIU( cfg->m_Defaults.text_size ) ) );
247 wxFAIL_MSG(
"TwoClickPlace(): unknown type" );
253 if( evt->IsPrime() && !ignorePrimePosition )
255 cursorPos =
grid.Align( evt->Position(),
grid.GetItemGrid( item ) );
270 m_view->AddToPreview( item,
false );
277 if(
m_frame->GetMoveWarpsCursor() )
287 switch( item->
Type() )
292 commit.
Push(
_(
"Place Pin" ) );
298 commit.
Push(
_(
"Draw Text" ) );
302 wxFAIL_MSG(
"TwoClickPlace(): unknown type" );
320 if( evt->HasParameter() )
329 m_view->AddToPreview( item,
false );
374 if( evt->IsCancelInteractive() || evt->IsActivate() )
388 symbol->
Move( -cursorPos );
392 m_view->RecacheAllItems();
constexpr EDA_IU_SCALE schIUScale
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
static TOOL_ACTION cursorDblClick
static TOOL_ACTION cursorClick
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
Commit for the schematic and symbol editors.
void Push(const wxString &aMessage=wxEmptyString, 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.
Increment event parameters.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
VECTOR2< int32_t > VECTOR2I