KiCad PCB EDA Suite
pl_edit_tool.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2019 CERN
5  * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <tool/tool_manager.h>
26 #include <tool/picker_tool.h>
28 #include <tools/pl_actions.h>
29 #include <tools/pl_edit_tool.h>
30 #include <ws_data_model.h>
31 #include <ws_draw_item.h>
32 #include <bitmaps.h>
33 #include <confirm.h>
34 #include <base_struct.h>
35 #include <pl_editor_frame.h>
36 #include <pl_editor_id.h>
37 #include <math/util.h> // for KiROUND
38 
39 
41  TOOL_INTERACTIVE( "plEditor.InteractiveEdit" ),
42  m_frame( nullptr ),
43  m_selectionTool( nullptr ),
44  m_moveInProgress( false ),
45  m_moveOffset( 0, 0 ),
46  m_cursor( 0, 0 ),
47  m_pickerItem( nullptr )
48 {
49 }
50 
51 
53 {
54  m_frame = getEditFrame<PL_EDITOR_FRAME>();
56 
57  wxASSERT_MSG( m_selectionTool, "plEditor.InteractiveSelection tool is not available" );
58 
59  CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
60 
61  // cancel current tool goes in main context menu at the top if present
63 
64  ctxMenu.AddSeparator( 200 );
66 
67  // Finally, add the standard zoom/grid items
69 
70  //
71  // Add editing actions to the selection tool menu
72  //
74 
80 
81  return true;
82 }
83 
84 
86 {
87  if( aReason == MODEL_RELOAD )
88  m_frame = getEditFrame<PL_EDITOR_FRAME>();
89 }
90 
91 
92 int PL_EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
93 {
95 
96  VECTOR2I originalCursorPos = controls->GetCursorPosition();
97 
98  // Be sure that there is at least one item that we can move. If there's no selection try
99  // looking for the stuff under mouse cursor (i.e. Kicad old-style hover selection).
101  bool unselect = selection.IsHover();
102 
103  if( selection.Empty() || m_moveInProgress )
104  return 0;
105 
106  std::string tool = aEvent.GetCommandStr().get();
107  m_frame->PushTool( tool );
108  Activate();
109 
110  controls->ShowCursor( true );
111  controls->SetAutoPan( true );
112 
113  bool restore_state = false;
114  bool chain_commands = false;
115  TOOL_EVENT* evt = const_cast<TOOL_EVENT*>( &aEvent );
116  VECTOR2I prevPos;
117 
118  if( !selection.Front()->IsNew() )
120 
121  // Main loop: keep receiving events
122  do
123  {
124  m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_ARROW );
125 
126  if( evt->IsAction( &PL_ACTIONS::move ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT )
127  || evt->IsAction( &ACTIONS::refreshPreview ) )
128  {
129  //------------------------------------------------------------------------
130  // Start a move operation
131  //
132  if( !m_moveInProgress )
133  {
134  // Apply any initial offset in case we're coming from a previous command.
135  //
136  for( EDA_ITEM* item : selection )
137  moveItem( item, m_moveOffset );
138 
139  // Set up the starting position and move/drag offset
140  //
141  m_cursor = controls->GetCursorPosition();
142 
143  if( selection.HasReferencePoint() )
144  {
145  VECTOR2I delta = m_cursor - selection.GetReferencePoint();
146 
147  // Drag items to the current cursor position
148  for( EDA_ITEM* item : selection )
149  moveItem( item, delta );
150 
151  selection.SetReferencePoint( m_cursor );
152  }
153  else if( selection.Size() == 1 )
154  {
155  // Set the current cursor position to the first dragged item origin,
156  // so the movement vector can be computed later
157  updateModificationPoint( selection );
158  m_cursor = originalCursorPos;
159  }
160  else
161  {
162  updateModificationPoint( selection );
163  }
164 
165  controls->SetCursorPosition( m_cursor, false );
166 
167  prevPos = m_cursor;
168  controls->SetAutoPan( true );
169  m_moveInProgress = true;
170  }
171 
172  //------------------------------------------------------------------------
173  // Follow the mouse
174  //
175  m_cursor = controls->GetCursorPosition();
176  VECTOR2I delta( m_cursor - prevPos );
177  selection.SetReferencePoint( m_cursor );
178 
179  m_moveOffset += delta;
180  prevPos = m_cursor;
181 
182  for( EDA_ITEM* item : selection )
183  moveItem( item, delta );
184 
186  }
187  //------------------------------------------------------------------------
188  // Handle cancel
189  //
190  else if( evt->IsCancelInteractive() || evt->IsActivate() )
191  {
192  if( m_moveInProgress )
193  {
194  evt->SetPassEvent( false );
195  restore_state = true;
196  }
197 
198  break;
199  }
200  //------------------------------------------------------------------------
201  // Handle TOOL_ACTION special cases
202  //
203  else if( evt->Action() == TA_UNDO_REDO_PRE )
204  {
205  unselect = true;
206  break;
207  }
208  else if( evt->Category() == TC_COMMAND )
209  {
210  if( evt->IsAction( &ACTIONS::doDelete ) )
211  {
212  // Exit on a remove operation; there is no further processing for removed items.
213  break;
214  }
215  }
216  //------------------------------------------------------------------------
217  // Handle context menu
218  //
219  else if( evt->IsClick( BUT_RIGHT ) )
220  {
222  }
223  //------------------------------------------------------------------------
224  // Handle drop
225  //
226  else if( evt->IsMouseUp( BUT_LEFT ) || evt->IsClick( BUT_LEFT ) )
227  {
228  break; // Finish
229  }
230  else
231  evt->SetPassEvent();
232 
233  } while( ( evt = Wait() ) ); //Should be assignment not equality test
234 
235  controls->ForceCursorPosition( false );
236  controls->ShowCursor( false );
237  controls->SetAutoPan( false );
238 
239  if( !chain_commands )
240  m_moveOffset = { 0, 0 };
241 
242  selection.ClearReferencePoint();
243 
244  for( auto item : selection )
245  item->ClearEditFlags();
246 
247  if( unselect )
249 
250  if( restore_state )
252  else
253  m_frame->OnModify();
254 
255  m_moveInProgress = false;
256  m_frame->PopTool( tool );
257  return 0;
258 }
259 
260 
262 {
263  WS_DRAW_ITEM_BASE* drawItem = static_cast<WS_DRAW_ITEM_BASE*>( aItem );
264  WS_DATA_ITEM* dataItem = drawItem->GetPeer();
265 
266  dataItem->MoveToUi( dataItem->GetStartPosUi() + (wxPoint) aDelta );
267 
268  for( WS_DRAW_ITEM_BASE* item : dataItem->GetDrawItems() )
269  {
270  getView()->Update( item );
271  item->SetFlags( IS_MOVED );
272  }
273 }
274 
275 
277 {
278  if( m_moveInProgress && aSelection.HasReferencePoint() )
279  return false;
280 
281  // When there is only one item selected, the reference point is its position...
282  if( aSelection.Size() == 1 )
283  {
284  aSelection.SetReferencePoint( aSelection.Front()->GetPosition() );
285  }
286  // ...otherwise modify items with regard to the grid-snapped cursor position
287  else
288  {
290  aSelection.SetReferencePoint( m_cursor );
291  }
292 
293  return true;
294 }
295 
296 
298 {
300 
301  wxCommandEvent evt( wxEVT_NULL, ID_APPEND_DESCR_FILE );
302  m_frame->Files_io( evt );
303 
304  return 0;
305 }
306 
307 
308 int PL_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
309 {
311 
312  if( selection.Size() == 0 )
313  return 0;
314 
316 
317  while( selection.Front() )
318  {
319  WS_DRAW_ITEM_BASE* drawItem = static_cast<WS_DRAW_ITEM_BASE*>( selection.Front() );
320  WS_DATA_ITEM* dataItem = drawItem->GetPeer();
322 
323  for( WS_DRAW_ITEM_BASE* item : dataItem->GetDrawItems() )
324  {
325  // Note: repeat items won't be selected but must be removed & deleted
326 
327  if( item->IsSelected() )
329 
330  getView()->Remove( item );
331  }
332 
333  delete dataItem;
334  }
335 
336  m_frame->OnModify();
337 
338  return 0;
339 }
340 
341 
342 #define HITTEST_THRESHOLD_PIXELS 5
343 
344 
346 {
347  std::string tool = aEvent.GetCommandStr().get();
349 
350  // Deactivate other tools; particularly important if another PICKER is currently running
351  Activate();
352 
353  picker->SetCursor( wxStockCursor( wxCURSOR_BULLSEYE ) );
354  m_pickerItem = nullptr;
355 
356  picker->SetClickHandler(
357  [this] ( const VECTOR2D& aPosition ) -> bool
358  {
359  if( m_pickerItem )
360  {
362  selectionTool->UnbrightenItem( m_pickerItem );
363  selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ );
365  m_pickerItem = nullptr;
366  }
367 
368  return true;
369  } );
370 
371  picker->SetMotionHandler(
372  [this] ( const VECTOR2D& aPos )
373  {
374  int threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) );
375  EDA_ITEM* item = nullptr;
376 
377  for( WS_DATA_ITEM* dataItem : WS_DATA_MODEL::GetTheInstance().GetItems() )
378  {
379  for( WS_DRAW_ITEM_BASE* drawItem : dataItem->GetDrawItems() )
380  {
381  if( drawItem->HitTest( (wxPoint) aPos, threshold ) )
382  {
383  item = drawItem;
384  break;
385  }
386  }
387  }
388 
389  if( m_pickerItem != item )
390  {
392 
393  if( m_pickerItem )
394  selectionTool->UnbrightenItem( m_pickerItem );
395 
396  m_pickerItem = item;
397 
398  if( m_pickerItem )
399  selectionTool->BrightenItem( m_pickerItem );
400  }
401  } );
402 
403  picker->SetFinalizeHandler(
404  [this] ( const int& aFinalState )
405  {
406  if( m_pickerItem )
408  } );
409 
410  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
411 
412  return 0;
413 }
414 
415 
416 int PL_EDIT_TOOL::Undo( const TOOL_EVENT& aEvent )
417 {
419  return 0;
420 }
421 
422 
423 int PL_EDIT_TOOL::Redo( const TOOL_EVENT& aEvent )
424 {
426  return 0;
427 }
428 
429 
430 int PL_EDIT_TOOL::Cut( const TOOL_EVENT& aEvent )
431 {
432  int retVal = Copy( aEvent );
433 
434  if( retVal == 0 )
435  retVal = DoDelete( aEvent );
436 
437  return retVal;
438 }
439 
440 
441 int PL_EDIT_TOOL::Copy( const TOOL_EVENT& aEvent )
442 {
444  std::vector<WS_DATA_ITEM*> items;
446  wxString sexpr;
447 
448  if( selection.GetSize() == 0 )
449  return 0;
450 
451  for( EDA_ITEM* item : selection.GetItems() )
452  items.push_back( static_cast<WS_DRAW_ITEM_BASE*>( item )->GetPeer() );
453 
454  try
455  {
456  model.SaveInString( items, sexpr );
457  }
458  catch( const IO_ERROR& ioe )
459  {
460  wxMessageBox( ioe.What(), _( "Error writing objects to clipboard" ) );
461  }
462 
463  if( m_toolMgr->SaveClipboard( TO_UTF8( sexpr ) ) )
464  return 0;
465  else
466  return -1;
467 }
468 
469 
470 int PL_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent )
471 {
472  PL_SELECTION& selection = m_selectionTool->GetSelection();
474  std::string sexpr = m_toolMgr->GetClipboard();
475 
477 
478  model.SetPageLayout( sexpr.c_str(), true, wxT( "clipboard" ) );
479 
480  // Build out draw items and select the first of each data item
482  {
483  if( dataItem->GetDrawItems().empty() )
484  {
485  dataItem->SyncDrawItems( nullptr, getView() );
486  dataItem->GetDrawItems().front()->SetSelected();
487  }
488  }
489 
491 
492  if( !selection.Empty() )
493  {
494  selection.SetReferencePoint( selection.GetTopLeftItem()->GetPosition() );
496  }
497 
498  return 0;
499 }
500 
501 
503 {
504  Go( &PL_EDIT_TOOL::Main, PL_ACTIONS::move.MakeEvent() );
505 
507 
508  Go( &PL_EDIT_TOOL::Undo, ACTIONS::undo.MakeEvent() );
509  Go( &PL_EDIT_TOOL::Redo, ACTIONS::redo.MakeEvent() );
510 
511  Go( &PL_EDIT_TOOL::Cut, ACTIONS::cut.MakeEvent() );
512  Go( &PL_EDIT_TOOL::Copy, ACTIONS::copy.MakeEvent() );
513  Go( &PL_EDIT_TOOL::Paste, ACTIONS::paste.MakeEvent() );
515 
517 }
virtual void ShowCursor(bool aEnabled)
Function ShowCursor() Enables or disables display of cursor.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
WS_DATA_MODEL handles the graphic items list to draw/plot the frame and title block.
Definition: ws_data_model.h:39
WS_DATA_ITEM * GetPeer() const
Definition: ws_draw_item.h:70
void ClearReferencePoint()
Definition: selection.h:250
void AddStandardSubMenus(TOOL_MENU &aMenu)
Function CreateBasicMenu.
void SetCursor(const wxCursor &aCursor)
Definition: picker_tool.h:65
TOOL_MENU m_menu
functions below are not yet implemented - their interface may change
void MoveToUi(wxPoint aPosition)
move item to a new position
void RebuildSelection()
Rebuild the selection from the flags in the view items.
int RemoveItemFromSel(const TOOL_EVENT &aEvent)
bool IsHover() const
Definition: selection.h:71
PL_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SetPassEvent(bool aPass=true)
Definition: tool_event.h:256
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Function Wait()
bool updateModificationPoint(PL_SELECTION &aSelection)
Returns the right modification point (e.g.
void SetMotionHandler(MOTION_HANDLER aHandler)
Function SetMotionHandler() Sets a handler for mouse motion.
Definition: picker_tool.h:82
Work sheet structure type definitions.
Definition: ws_data_item.h:93
Model changes (required full reload)
Definition: tool_base.h:82
int DeleteItemCursor(const TOOL_EVENT &aEvent)
Runs the deletion tool.
This file is part of the common library.
static TOOL_ACTION doDelete
Definition: actions.h:75
int Paste(const TOOL_EVENT &aEvent)
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.
Definition: picker_tool.h:72
PL_SELECTION_TOOL * m_selectionTool
Definition: pl_edit_tool.h:82
bool SaveClipboard(const std::string &aText)
Stores an information to the system clipboard.
void SetCurrentCursor(wxStockCursor aStockCursorID)
Function SetCurrentCursor Set the current cursor shape for this panel.
TOOL_ACTIONS Action() const
Returns more specific information about the type of an event.
Definition: tool_event.h:250
bool IsClick(int aButtonMask=BUT_ANY) const
Definition: tool_event.cpp:178
void BrightenItem(EDA_ITEM *aItem)
int Cut(const TOOL_EVENT &aEvent)
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
virtual void Remove(VIEW_ITEM *aItem)
Function Remove() Removes a VIEW_ITEM from the view.
Definition: view.cpp:375
int ClearSelection(const TOOL_EVENT &aEvent)
TOOL_MENU & GetToolMenu()
bool IsMotion() const
Definition: tool_event.h:306
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:140
VECTOR2I m_cursor
Last cursor position (needed for getModificationPoint() to avoid changes of edit reference point).
Definition: pl_edit_tool.h:92
void GetLayoutFromRedoList()
Redo the last edit:
static TOOL_ACTION move
Definition: pl_actions.h:71
TOOL_EVENT_CATEGORY Category() const
Returns the category (eg. mouse/keyboard/action) of an event..
Definition: tool_event.h:247
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false, long aArrowCommand=0)=0
Moves cursor to the requested position expressed in world coordinates.
void SetPageLayout(const wxString &aFullFileName=wxEmptyString, bool Append=false)
Populates the list with a custom layout, or the default layout, if no custom layout available.
std::vector< WS_DATA_ITEM * > & GetItems()
virtual wxPoint GetPosition() const
Definition: base_struct.h:337
void setTransitions() override
Sets up handlers for various events.
static bool NotEmpty(const SELECTION &aSelection)
Tests if there are any items selected.
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
int AddItemToSel(const TOOL_EVENT &aEvent)
PL_SELECTION & GetSelection()
Function GetSelection()
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:211
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
EDA_ITEM * m_pickerItem
Definition: pl_edit_tool.h:94
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
bool IsNew() const
Definition: base_struct.h:199
static WS_DATA_MODEL & GetTheInstance()
static function: returns the instance of WS_DATA_MODEL used in the application
const wxPoint GetStartPosUi(int ii=0) const
static TOOL_ACTION pickerTool
Definition: actions.h:151
void OnModify()
Must be called after a change in order to set the "modify" flag.
void SetFinalizeHandler(FINALIZE_HANDLER aHandler)
Function SetFinalizeHandler() Sets a handler for the finalize event.
Definition: picker_tool.h:102
int Main(const TOOL_EVENT &aEvent)
The "move" event loop.
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:100
static TOOL_ACTION copy
Definition: actions.h:70
void SetReferencePoint(const VECTOR2I &aP)
Definition: selection.h:245
EDA_ITEM * GetTopLeftItem(bool onlyModules=false) const override
bool IsDrag(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:296
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
virtual void PopTool(const std::string &actionName)
VECTOR2I m_moveOffset
Used for chaining commands
Definition: pl_edit_tool.h:88
TOOL_EVENT.
Definition: tool_event.h:171
int Undo(const TOOL_EVENT &aEvent)
PL_EDITOR_FRAME * m_frame
Definition: pl_edit_tool.h:81
const std::deque< EDA_ITEM * > GetItems() const
Definition: selection.h:132
static TOOL_ACTION cut
Definition: actions.h:69
VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (such a...
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Function ForceCursorPosition() Places the cursor immediately at a given point.
int Copy(const TOOL_EVENT &aEvent)
bool m_moveInProgress
Flag determining if anything is being dragged right now
Definition: pl_edit_tool.h:85
bool IsMouseUp(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:301
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1531
void moveItem(EDA_ITEM *aItem, VECTOR2I aDelta)
bool IsCancelInteractive()
Function IsCancelInteractive()
Definition: tool_event.cpp:190
void Reset(RESET_REASON aReason) override
Function Reset() Brings the tool to a known, initial state.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void SetAutoPan(bool aEnabled)
Function SetAutoPan Turns on/off auto panning (this feature is used when there is a tool active (eg.
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:121
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: pl_actions.h:49
#define HITTEST_THRESHOLD_PIXELS
const std::vector< WS_DRAW_ITEM_BASE * > & GetDrawItems() const
Definition: ws_data_item.h:128
void AddSeparator(int aOrder=ANY_ORDER)
Adds a separator to the menu.
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:100
void Remove(WS_DATA_ITEM *aItem)
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:463
static TOOL_ACTION redo
Definition: actions.h:68
int DoDelete(const TOOL_EVENT &aEvent)
Function DoDelete()
bool IsActivate() const
Definition: tool_event.h:321
bool HasReferencePoint() const
Definition: selection.h:235
int ImportWorksheetContent(const TOOL_EVENT &aEvent)
#define _(s)
Definition: 3d_actions.cpp:33
void UnbrightenItem(EDA_ITEM *aItem)
std::string GetClipboard() const
Returns the information currently stored in the system clipboard.
int Size() const
Returns the number of selected parts.
Definition: selection.h:127
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
static TOOL_ACTION appendImportedWorksheet
Definition: pl_actions.h:68
RESET_REASON
Determines the reason of reset for a tool
Definition: tool_base.h:79
void SaveCopyInUndoList()
Save a copy of the description (in a S expr string) for Undo/redo commands.
void Activate()
Function Activate() Runs the tool.
static TOOL_ACTION deleteTool
Definition: actions.h:76
static TOOL_ACTION undo
Definition: actions.h:67
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
void RollbackFromUndo()
Apply the last command in Undo List without stacking a Redo.
void PostEvent(const TOOL_EVENT &aEvent)
Puts an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:273
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Adds a menu entry to run a TOOL_ACTION on selected items.
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
void ShowContextMenu(SELECTION &aSelection)
Function ShowContextMenu.
Definition: tool_menu.cpp:59
void GetLayoutFromUndoList()
Undo the last edit:
static TOOL_ACTION paste
Definition: actions.h:71
PL_SELECTION & RequestSelection()
Function RequestSelection()
void SaveInString(wxString &aOutputString)
Save the description in a buffer.
static TOOL_ACTION refreshPreview
Definition: actions.h:104
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
EDA_ITEM * Front() const
Definition: selection.h:184
int Redo(const TOOL_EVENT &aEvent)
#define IS_MOVED
Item being moved.
Definition: base_struct.h:116
void Files_io(wxCommandEvent &event)