37 const wxString& aCommitMessage,
int aOptions )
39 using namespace std::placeholders;
40 std::unique_ptr<BOARD_ITEM> newItem;
68 newItem->SetPosition( (wxPoint) aPosition );
69 preview.
Add( newItem.get() );
73 FOOTPRINT* fp = dyn_cast<FOOTPRINT*>( newItem.get() );
82 makeNewItem(
controls()->GetCursorPosition() );
115 if( evt->IsCancelInteractive() )
131 else if( evt->IsActivate() )
136 if( evt->IsPointEditor() )
140 else if( evt->IsMoveTool() )
156 makeNewItem( cursorPos );
167 auto oldFlags = newItem->GetFlags();
168 newItem->ClearFlags();
170 if( !aPlacer->
PlaceItem( newItem.get(), commit ) )
172 newItem->SetFlags( oldFlags );
178 commit.
Push( aCommitMessage );
188 makeNewItem(
controls()->GetCursorPosition() );
201 else if( newItem && evt->Category() ==
TC_COMMAND )
209 newItem->Rotate( newItem->GetPosition(), rotationAngle );
235 makeNewItem( (wxPoint) cursorPos );
244 else if( newItem && evt->IsMotion() )
247 newItem->SetPosition( (wxPoint) cursorPos );
274 getEditFrame<PCB_BASE_FRAME>()->AddStandardSubMenus(
m_menu );
297 return static_cast<PCB_DRAW_PANEL_GAL*>(
frame()->GetCanvas() );
325 aCommit.
Add( aItem );
static TOOL_ACTION selectionClear
Clear the current selection.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
virtual void Clear() override
Remove all the stored items from the group.
virtual bool PlaceItem(BOARD_ITEM *aItem, BOARD_COMMIT &aCommit)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
static TOOL_ACTION viaSizeInc
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
virtual std::unique_ptr< BOARD_ITEM > CreateItem()=0
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual void OnEditItemRequest(BOARD_ITEM *aItem)=0
Install the corresponding dialog editor for the given item.
static TOOL_ACTION cancelInteractive
static TOOL_ACTION properties
Activation of the edit tool.
static TOOL_ACTION trackViaSizeChanged
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
void SetCurrentCursor(KICURSOR cursor)
Set the current cursor shape for this panel.
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
virtual void Add(EDA_ITEM *aItem)
virtual void SnapItem(BOARD_ITEM *aItem)
Container for display options like enable/disable some optional drawings.
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 CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
virtual void Add(VIEW_ITEM *aItem)
Add an item to the group.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
class FOOTPRINT, a footprint
virtual BOARD_ITEM_CONTAINER * GetModel() const =0
static TOOL_ACTION flip
Flipping of selected objects.
PCBNEW_SETTINGS & Settings()
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
PCB_BASE_EDIT_FRAME * m_frame
static TOOL_ACTION viaSizeDec
static TOOL_ACTION refreshPreview
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.