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() );
86 RECURSE_MODE::NO_RECURSE );
91 makeNewItem(
controls()->GetCursorPosition() );
97 frame()->GetCanvas()->SetCurrentCursor( KICURSOR::PENCIL );
99 frame()->GetCanvas()->SetCurrentCursor( KICURSOR::PLACE );
110 grid.SetSnap(
false );
111 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
128 if( evt->IsCancelInteractive() )
133 frame()->PopTool( aTool );
142 frame()->PopTool( aTool );
146 else if( evt->IsActivate() )
151 if( evt->IsPointEditor() )
155 else if( evt->IsMoveTool() )
162 frame()->PopTool( aTool );
171 makeNewItem( cursorPos );
187 if( !aPlacer->
PlaceItem( newBoardItem, commit ) )
190 newItem.reset( newBoardItem );
195 commit.
Push( aCommitMessage );
205 makeNewItem(
controls()->GetCursorPosition() );
218 else if( newItem && evt->Category() ==
TC_COMMAND )
226 newItem->Rotate( newItem->GetPosition(), rotationAngle );
231 newItem->Flip( newItem->GetPosition(),
232 frame()->GetPcbNewSettings()->m_FlipDirection );
237 frame()->OnEditItemRequest( newItem.get() );
247 makeNewItem( cursorPos );
256 else if( newItem && evt->IsMotion() )
259 newItem->SetPosition( cursorPos );
272 frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
289 getEditFrame<PCB_BASE_FRAME>()->AddStandardSubMenus( *
m_menu.get() );
307 return frame()->GetPcbNewSettings()->m_Display;
351 aCommit.
Add( aItem );
static TOOL_ACTION cancelInteractive
static TOOL_ACTION refreshPreview
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
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)
Add a new item to the model.
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)
Return a handle to the a given settings by type.
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)