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  controls->SetSnapping( true );
97  VECTOR2I originalCursorPos = controls->GetCursorPosition();
98 
99  // Be sure that there is at least one item that we can move. If there's no selection try
100  // looking for the stuff under mouse cursor (i.e. Kicad old-style hover selection).
102  bool unselect = selection.IsHover();
103 
104  if( selection.Empty() || m_moveInProgress )
105  return 0;
106 
107  std::string tool = aEvent.GetCommandStr().get();
108  m_frame->PushTool( tool );
109  Activate();
110 
111  controls->ShowCursor( true );
112  controls->SetAutoPan( true );
113 
114  bool restore_state = false;
115  bool chain_commands = false;
116  TOOL_EVENT* evt = const_cast<TOOL_EVENT*>( &aEvent );
117  VECTOR2I prevPos;
118 
119  if( !selection.Front()->IsNew() )
121 
122  // Main loop: keep receiving events
123  do
124  {
125  m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_ARROW );
126  controls->SetSnapping( !evt->Modifier( MD_ALT ) );
127 
128  if( evt->IsAction( &PL_ACTIONS::move ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT )
129  || evt->IsAction( &ACTIONS::refreshPreview ) )
130  {
131  //------------------------------------------------------------------------
132  // Start a move operation
133  //
134  if( !m_moveInProgress )
135  {
136  // Apply any initial offset in case we're coming from a previous command.
137  //
138  for( EDA_ITEM* item : selection )
139  moveItem( item, m_moveOffset );
140 
141  // Set up the starting position and move/drag offset
142  //
143  m_cursor = controls->GetCursorPosition();
144 
145  if( selection.HasReferencePoint() )
146  {
147  VECTOR2I delta = m_cursor - selection.GetReferencePoint();
148 
149  // Drag items to the current cursor position
150  for( EDA_ITEM* item : selection )
151  moveItem( item, delta );
152 
153  selection.SetReferencePoint( m_cursor );
154  }
155  else if( selection.Size() == 1 )
156  {
157  // Set the current cursor position to the first dragged item origin,
158  // so the movement vector can be computed later
159  updateModificationPoint( selection );
160  m_cursor = originalCursorPos;
161  }
162  else
163  {
164  updateModificationPoint( selection );
165  }
166 
167  controls->SetCursorPosition( m_cursor, false );
168 
169  prevPos = m_cursor;
170  controls->SetAutoPan( true );
171  m_moveInProgress = true;
172  }
173 
174  //------------------------------------------------------------------------
175  // Follow the mouse
176  //
177  m_cursor = controls->GetCursorPosition();
178  VECTOR2I delta( m_cursor - prevPos );
179  selection.SetReferencePoint( m_cursor );
180 
181  m_moveOffset += delta;
182  prevPos = m_cursor;
183 
184  for( EDA_ITEM* item : selection )
185  moveItem( item, delta );
186 
188  }
189  //------------------------------------------------------------------------
190  // Handle cancel
191  //
192  else if( evt->IsCancelInteractive() || evt->IsActivate() )
193  {
194  if( m_moveInProgress )
195  restore_state = true;
196 
197  break;
198  }
199  //------------------------------------------------------------------------
200  // Handle TOOL_ACTION special cases
201  //
202  else if( evt->Action() == TA_UNDO_REDO_PRE )
203  {
204  unselect = true;
205  break;
206  }
207  else if( evt->Category() == TC_COMMAND )
208  {
209  if( evt->IsAction( &ACTIONS::doDelete ) )
210  {
211  // Exit on a remove operation; there is no further processing for removed items.
212  break;
213  }
214  }
215  //------------------------------------------------------------------------
216  // Handle context menu
217  //
218  else if( evt->IsClick( BUT_RIGHT ) )
219  {
221  }
222  //------------------------------------------------------------------------
223  // Handle drop
224  //
225  else if( evt->IsMouseUp( BUT_LEFT ) || evt->IsClick( BUT_LEFT ) )
226  {
227  break; // Finish
228  }
229  else
230  evt->SetPassEvent();
231 
232  } while( ( evt = Wait() ) ); //Should be assignment not equality test
233 
234  controls->ForceCursorPosition( false );
235  controls->ShowCursor( false );
236  controls->SetSnapping( 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  delete item;
332  }
333 
334  delete dataItem;
335  }
336 
337  m_frame->OnModify();
338 
339  return 0;
340 }
341 
342 
343 #define HITTEST_THRESHOLD_PIXELS 5
344 
345 
347 {
348  std::string tool = aEvent.GetCommandStr().get();
350 
351  // Deactivate other tools; particularly important if another PICKER is currently running
352  Activate();
353 
354  picker->SetCursor( wxStockCursor( wxCURSOR_BULLSEYE ) );
355  m_pickerItem = nullptr;
356 
357  picker->SetClickHandler(
358  [this] ( const VECTOR2D& aPosition ) -> bool
359  {
360  if( m_pickerItem )
361  {
363  selectionTool->UnbrightenItem( m_pickerItem );
364  selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ );
366  m_pickerItem = nullptr;
367  }
368 
369  return true;
370  } );
371 
372  picker->SetMotionHandler(
373  [this] ( const VECTOR2D& aPos )
374  {
375  int threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) );
376  EDA_ITEM* item = nullptr;
377 
378  for( WS_DATA_ITEM* dataItem : WS_DATA_MODEL::GetTheInstance().GetItems() )
379  {
380  for( WS_DRAW_ITEM_BASE* drawItem : dataItem->GetDrawItems() )
381  {
382  if( drawItem->HitTest( (wxPoint) aPos, threshold ) )
383  {
384  item = drawItem;
385  break;
386  }
387  }
388  }
389 
390  if( m_pickerItem != item )
391  {
393 
394  if( m_pickerItem )
395  selectionTool->UnbrightenItem( m_pickerItem );
396 
397  m_pickerItem = item;
398 
399  if( m_pickerItem )
400  selectionTool->BrightenItem( m_pickerItem );
401  }
402  } );
403 
404  picker->SetFinalizeHandler(
405  [this] ( const int& aFinalState )
406  {
407  if( m_pickerItem )
409  } );
410 
411  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
412 
413  return 0;
414 }
415 
416 
417 int PL_EDIT_TOOL::Undo( const TOOL_EVENT& aEvent )
418 {
420  return 0;
421 }
422 
423 
424 int PL_EDIT_TOOL::Redo( const TOOL_EVENT& aEvent )
425 {
427  return 0;
428 }
429 
430 
431 int PL_EDIT_TOOL::Cut( const TOOL_EVENT& aEvent )
432 {
433  int retVal = Copy( aEvent );
434 
435  if( retVal == 0 )
436  retVal = DoDelete( aEvent );
437 
438  return retVal;
439 }
440 
441 
442 int PL_EDIT_TOOL::Copy( const TOOL_EVENT& aEvent )
443 {
445  std::vector<WS_DATA_ITEM*> items;
447  wxString sexpr;
448 
449  if( selection.GetSize() == 0 )
450  return 0;
451 
452  for( EDA_ITEM* item : selection.GetItems() )
453  items.push_back( static_cast<WS_DRAW_ITEM_BASE*>( item )->GetPeer() );
454 
455  try
456  {
457  model.SaveInString( items, sexpr );
458  }
459  catch( const IO_ERROR& ioe )
460  {
461  wxMessageBox( ioe.What(), _( "Error writing objects to clipboard" ) );
462  }
463 
464  if( m_toolMgr->SaveClipboard( TO_UTF8( sexpr ) ) )
465  return 0;
466  else
467  return -1;
468 }
469 
470 
471 int PL_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent )
472 {
473  PL_SELECTION& selection = m_selectionTool->GetSelection();
475  std::string sexpr = m_toolMgr->GetClipboard();
476 
478 
479  model.SetPageLayout( sexpr.c_str(), true, wxT( "clipboard" ) );
480 
481  // Build out draw items and select the first of each data item
483  {
484  if( dataItem->GetDrawItems().empty() )
485  {
486  dataItem->SyncDrawItems( nullptr, getView() );
487  dataItem->GetDrawItems().front()->SetSelected();
488  }
489  }
490 
492 
493  if( !selection.Empty() )
494  {
495  selection.SetReferencePoint( selection.GetTopLeftItem()->GetPosition() );
497  }
498 
499  return 0;
500 }
501 
502 
504 {
505  Go( &PL_EDIT_TOOL::Main, PL_ACTIONS::move.MakeEvent() );
506 
508 
509  Go( &PL_EDIT_TOOL::Undo, ACTIONS::undo.MakeEvent() );
510  Go( &PL_EDIT_TOOL::Redo, ACTIONS::redo.MakeEvent() );
511 
512  Go( &PL_EDIT_TOOL::Cut, ACTIONS::cut.MakeEvent() );
513  Go( &PL_EDIT_TOOL::Copy, ACTIONS::copy.MakeEvent() );
514  Go( &PL_EDIT_TOOL::Paste, ACTIONS::paste.MakeEvent() );
516 
518 }
virtual void ShowCursor(bool aEnabled)
Function ShowCursor() Enables or disables display of cursor.
static bool ShowAlways(const SELECTION &aSelection)
Function ShowAlways 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.
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:74
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:376
int ClearSelection(const TOOL_EVENT &aEvent)
TOOL_MENU & GetToolMenu()
bool IsMotion() const
Definition: tool_event.h:306
virtual void SetSnapping(bool aEnabled)
Function SetSnapping() Enables/disables snapping cursor to grid.
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)
Function NotEmpty 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:207
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:149
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.
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:33
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
void SetPassEvent()
Definition: tool_event.h:256
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:1540
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)
Function AddSeparator()
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:100
void Remove(WS_DATA_ITEM *aItem)
int Modifier(int aMask=MD_MODIFIER_MASK) const
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition: tool_event.h:342
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
#define TO_UTF8(wxstring)
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:75
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:268
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddItem()
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:102
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)