45 const wxString& aCommitMessage,
int aOptions )
47 using namespace std::placeholders;
48 std::unique_ptr<BOARD_ITEM> newItem;
50 frame()->PushTool( aTool );
75 if(
frame()->GetModel() )
80 newItem->SetPosition( aPosition );
81 preview.
Add( newItem.get() );
90 makeNewItem(
controls()->GetCursorPosition() );
96 frame()->GetCanvas()->SetCurrentCursor( KICURSOR::PENCIL );
98 frame()->GetCanvas()->SetCurrentCursor( KICURSOR::PLACE );
109 grid.SetSnap(
false );
110 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
127 if( evt->IsCancelInteractive() )
132 frame()->PopTool( aTool );
141 frame()->PopTool( aTool );
145 else if( evt->IsActivate() )
150 if( evt->IsPointEditor() )
154 else if( evt->IsMoveTool() )
161 frame()->PopTool( aTool );
170 makeNewItem( cursorPos );
186 if( !aPlacer->
PlaceItem( newBoardItem, commit ) )
189 newItem.reset( newBoardItem );
194 commit.
Push( aCommitMessage );
204 makeNewItem(
controls()->GetCursorPosition() );
217 else if( newItem && evt->Category() ==
TC_COMMAND )
225 newItem->Rotate( newItem->GetPosition(), rotationAngle );
230 newItem->Flip( newItem->GetPosition(),
231 frame()->GetPcbNewSettings()->m_FlipDirection );
236 frame()->OnEditItemRequest( newItem.get() );
246 makeNewItem( cursorPos );
255 else if( newItem && evt->IsMotion() )
258 newItem->SetPosition( cursorPos );
271 frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
288 getEditFrame<PCB_BASE_FRAME>()->AddStandardSubMenus( *
m_menu.get() );
306 return frame()->GetPcbNewSettings()->m_Display;
350 aCommit.
Add( aItem );
static TOOL_ACTION cancelInteractive
static TOOL_ACTION refreshPreview
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been added.
void SetFlags(EDA_ITEM_FLAGS aMask)
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
EDA_ITEM_FLAGS GetFlags() const
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
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 SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
virtual void Add(VIEW_ITEM *aItem)
Add an item to the group.
static TOOL_ACTION trackViaSizeChanged
static TOOL_ACTION properties
Activation of the edit tool.
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION flip
Flipping of selected objects.
virtual SETTINGS_MANAGER & GetSettingsManager() const
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
virtual void Add(EDA_ITEM *aItem)
virtual void Clear() override
Remove all the stored items from the group.
T * GetAppSettings(const wxString &aFilename)
Returns a handle to the a given settings by type If the settings have already been loaded,...
std::uint32_t EDA_ITEM_FLAGS
PGM_BASE & Pgm()
The global Program "get" accessor.
virtual void SnapItem(BOARD_ITEM *aItem)
PCB_BASE_EDIT_FRAME * m_frame
virtual std::unique_ptr< BOARD_ITEM > CreateItem()=0
virtual bool PlaceItem(BOARD_ITEM *aItem, BOARD_COMMIT &aCommit)