39 const wxString& aCommitMessage,
int aOptions )
41 using namespace std::placeholders;
42 std::unique_ptr<BOARD_ITEM> newItem;
73 newItem->SetPosition( (wxPoint) aPosition );
74 preview.
Add( newItem.get() );
78 FOOTPRINT* fp = dyn_cast<FOOTPRINT*>( newItem.get() );
87 makeNewItem(
controls()->GetCursorPosition() );
106 grid.SetSnap(
false );
107 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
123 if( evt->IsCancelInteractive() )
141 else if( evt->IsActivate() )
146 if( evt->IsPointEditor() )
150 else if( evt->IsMoveTool() )
166 makeNewItem( cursorPos );
177 auto oldFlags = newItem->GetFlags();
178 newItem->ClearFlags();
180 if( !aPlacer->
PlaceItem( newItem.get(), commit ) )
182 newItem->SetFlags( oldFlags );
188 commit.
Push( aCommitMessage );
198 makeNewItem(
controls()->GetCursorPosition() );
211 else if( newItem && evt->Category() ==
TC_COMMAND )
219 newItem->Rotate( newItem->GetPosition(), rotationAngle );
239 makeNewItem( (wxPoint) cursorPos );
248 else if( newItem && evt->IsMotion() )
251 newItem->SetPosition( (wxPoint) cursorPos );
280 getEditFrame<PCB_BASE_FRAME>()->AddStandardSubMenus(
m_menu );
303 return static_cast<PCB_DRAW_PANEL_GAL*>(
frame()->GetCanvas() );
340 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.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
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...
virtual void Add(EDA_ITEM *aItem)
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...
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 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.
bool m_PcbUse45DegreeLimit
bool m_FpeditUse45DegreeLimit
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 refreshPreview