44 const wxString& aCommitMessage,
int aOptions )
46 using namespace std::placeholders;
47 std::unique_ptr<BOARD_ITEM> newItem;
79 newItem->SetPosition( aPosition );
80 preview.
Add( newItem.get() );
89 makeNewItem(
controls()->GetCursorPosition() );
108 grid.SetSnap(
false );
109 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
126 if( evt->IsCancelInteractive() )
144 else if( evt->IsActivate() )
149 if( evt->IsPointEditor() )
153 else if( evt->IsMoveTool() )
169 makeNewItem( cursorPos );
185 if( !aPlacer->
PlaceItem( newBoardItem, commit ) )
188 newItem.reset( newBoardItem );
193 commit.
Push( aCommitMessage );
203 makeNewItem(
controls()->GetCursorPosition() );
216 else if( newItem && evt->Category() ==
TC_COMMAND )
224 newItem->Rotate( newItem->GetPosition(), rotationAngle );
229 newItem->Flip( newItem->GetPosition(),
frame()->GetPcbNewSettings()->m_FlipLeftRight );
244 makeNewItem( cursorPos );
253 else if( newItem && evt->IsMotion() )
256 newItem->SetPosition( cursorPos );
286 getEditFrame<PCB_BASE_FRAME>()->AddStandardSubMenus(
m_menu );
348 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 SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
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.
DISPLAY_OPTIONS m_Display
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 void OnEditItemRequest(BOARD_ITEM *aItem)
Install the corresponding dialog editor for the given item.
PCBNEW_SETTINGS * GetPcbNewSettings() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual BOARD_ITEM_CONTAINER * GetModel() const =0
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()
Returns a handle to the a given settings by type If the settings have already been loaded,...
std::uint32_t EDA_ITEM_FLAGS
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
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)