57 auto& ctxMenu =
m_menu->GetMenu();
61 ctxMenu.AddSeparator( 1 );
156 if( evt->IsCancelInteractive() || ( !isText && item && evt->IsAction( &
ACTIONS::undo ) ) )
158 bool wasPending = item !=
nullptr;
163 if( isText || !wasPending )
166 else if( evt->IsActivate() )
171 if( evt->IsMoveTool() )
174 m_frame->PushTool( originalEvent );
181 bool placeItem = item !=
nullptr;
187 if( createPending() )
195 if( item && placeItem )
295 if( evt->IsCancelInteractive() || ( item && evt->IsAction( &
ACTIONS::undo ) ) )
311 else if( evt->IsActivate() )
322 if( evt->IsPointEditor() || evt->IsMoveTool() )
325 m_frame->PushTool( originalEvent );
354 item->ClearEditFlags();
367 item->GetPeer()->MoveEndPointToIU( cursorPos );
368 item->SetEnd( item->GetPeer()->GetEndPosIU( 0 ) );
399 auto importer = std::make_unique<GRAPHICS_IMPORTER_PL_EDITOR>();
413 std::vector<std::unique_ptr<DS_DATA_ITEM>>& items = sink->
GetDataItems();
425 for( std::unique_ptr<DS_DATA_ITEM>& item : items )
432 m_frame->SyncDataItem( dataItem );
441 m_frame->GetCanvas()->Refresh();
static TOOL_ACTION cancelInteractive
static TOOL_ACTION activatePointEditor
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION refreshPreview
Import a graphics file into whichever editor opened the dialog.
bool IsPlacementInteractive()
void SetFilenameOverride(const wxString &aFilenameOverride)
Set the filename override to be applied in TransferDataToWindow.
Drawing sheet structure type definitions.
void MoveStartPointToIU(const VECTOR2I &aPosition)
Move the starting point of the item to a new position.
void MoveToIU(const VECTOR2I &aPosition)
Move item to a new position.
const VECTOR2I GetStartPosIU(int ii=0) const
const std::vector< DS_DRAW_ITEM_BASE * > & GetDrawItems() const
static DS_DATA_MODEL & GetTheInstance()
Return the instance of DS_DATA_MODEL used in the application.
void Append(DS_DATA_ITEM *aItem)
Base class to handle basic graphic items.
virtual VECTOR2I GetPosition() const
virtual void ClearEditFlags()
virtual void SetPosition(const VECTOR2I &aPos)
void SetFlags(EDA_ITEM_FLAGS aMask)
Turn imported geometry into drawing sheet items.
std::vector< std::unique_ptr< DS_DATA_ITEM > > & GetDataItems()
The imported items, which the caller takes over.
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
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, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
static TOOL_ACTION placeImage
static TOOL_ACTION drawRectangle
static TOOL_ACTION placeImportedGraphics
static TOOL_ACTION placeText
static TOOL_ACTION drawLine
EDA_ITEM * GetTopLeftItem(bool onlyModules=false) const override
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
void SetReferencePoint(const VECTOR2I &aP)
bool Empty() const
Checks if there is anything selected.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
This file is part of the common library.
#define IS_NEW
New item, just created.
#define IS_MOVING
Item being moved.
VECTOR2< int32_t > VECTOR2I