KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pl_selection_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 The 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#include <advanced_config.h>
22#include <view/view.h>
23#include <view/view_controls.h>
25#include <tool/tool_event.h>
26#include <tool/tool_manager.h>
27#include <tool/selection.h>
30#include <tools/pl_actions.h>
34#include <collector.h>
35#include <math/util.h> // for KiROUND
36
37#include "pl_editor_frame.h"
38
39
40#define HITTEST_THRESHOLD_PIXELS 3
41
42
44 SELECTION_TOOL( "common.InteractiveSelection" ),
45 m_frame( nullptr )
46{
47}
48
49
51{
53
54 auto& menu = m_menu->GetMenu();
55
56 menu.AddSeparator( 200 );
61
62 menu.AddSeparator( 1000 );
63 m_frame->AddStandardSubMenus( *m_menu.get() );
64
65 m_disambiguateTimer.SetOwner( this );
66 Connect( m_disambiguateTimer.GetId(), wxEVT_TIMER,
67 wxTimerEventHandler( PL_SELECTION_TOOL::onDisambiguationExpire ), nullptr, this );
68
69 return true;
70}
71
72
78
79
81{
82 // Main loop: keep receiving events
83 while( TOOL_EVENT* evt = Wait() )
84 {
85 // on left click, a selection is made, depending on modifiers ALT, SHIFT, CTRL:
86 setModifiersState( evt->Modifier( MD_SHIFT ), evt->Modifier( MD_CTRL ), evt->Modifier( MD_ALT ) );
87
88 if( evt->IsMouseDown( BUT_LEFT ) )
89 {
90 // Avoid triggering when running under other tools
91 PL_POINT_EDITOR *pt_tool = m_toolMgr->GetTool<PL_POINT_EDITOR>();
92
93 if( m_frame->ToolStackIsEmpty() && pt_tool && !pt_tool->HasPoint() )
94 {
95 m_originalCursor = m_toolMgr->GetMousePosition();
96 m_disambiguateTimer.StartOnce( ADVANCED_CFG::GetCfg().m_DisambiguationMenuDelay );
97 }
98 }
99 // Single click? Select single object
100 else if( evt->IsClick( BUT_LEFT ) || evt->IsAction( &ACTIONS::cursorClick ) )
101 {
102 // If the timer has stopped, then we have already run the disambiguate routine
103 // and we don't want to register an extra click here
104 if( !m_disambiguateTimer.IsRunning() )
105 {
106 evt->SetPassEvent();
107 continue;
108 }
109
110 m_disambiguateTimer.Stop();
111 SelectPoint( evt->Position() );
112 }
113
114 // right click? if there is any object - show the context menu
115 else if( evt->IsClick( BUT_RIGHT ) )
116 {
117 m_disambiguateTimer.Stop();
118 bool selectionCancelled = false;
119
120 if( m_selection.Empty() )
121 {
122 SelectPoint( evt->Position(), &selectionCancelled );
123 m_selection.SetIsHover( true );
124 }
125
126 // Show selection before opening menu
127 m_frame->GetCanvas()->ForceRefresh();
128
129 if( !selectionCancelled )
130 m_menu->ShowContextMenu( m_selection );
131 }
132
133 else if( evt->IsDblClick( BUT_LEFT ) || evt->IsAction( &ACTIONS::cursorDblClick ) )
134 {
135 // No double-click actions currently defined
136 }
137
138 // drag with LMB? Select multiple objects (or at least draw a selection box) or drag them
139 else if( evt->IsDrag( BUT_LEFT ) )
140 {
141 m_disambiguateTimer.Stop();
142
143 if( hasModifier() || m_selection.Empty() )
144 {
146 }
147 else
148 {
149 // Check if dragging has started within any of selected items bounding box
150 if( selectionContains( evt->Position() ) )
151 {
152 // Yes -> run the move tool and wait till it finishes
153 m_toolMgr->RunAction( "plEditor.InteractiveMove.move" );
154 }
155 else
156 {
157 // No -> clear the selection list
159 }
160 }
161 }
162
163 // Middle double click? Do zoom to fit or zoom to objects
164 else if( evt->IsDblClick( BUT_MIDDLE ) )
165 {
166 m_toolMgr->RunAction( ACTIONS::zoomFitScreen );
167 }
168
169 else if( evt->IsCancelInteractive() )
170 {
171 m_disambiguateTimer.Stop();
173 }
174
175 else if( evt->Action() == TA_UNDO_REDO_PRE )
176 {
178 }
179
180 else
181 evt->SetPassEvent();
182
183
184 if( m_frame->ToolStackIsEmpty() )
185 {
186 if( !hasModifier()
187 && !m_selection.Empty()
188 && m_frame->GetDragAction() == MOUSE_DRAG_ACTION::DRAG_SELECTED
189 && evt->HasPosition()
190 && selectionContains( evt->Position() ) )
191 {
192 m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING );
193 }
194 else
195 {
196 if( m_additive )
197 m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ADD );
198 else if( m_subtractive )
199 m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::SUBTRACT );
200 else if( m_exclusive_or )
201 m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::XOR );
202 else
203 m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
204 }
205 }
206 }
207
208 return 0;
209}
210
211
213{
214 wxMouseState keyboardState = wxGetMouseState();
215
216 setModifiersState( keyboardState.ShiftDown(), keyboardState.ControlDown(),
217 keyboardState.AltDown() );
218
219 m_skip_heuristics = true;
221 m_skip_heuristics = false;
222
223 return 0;
224}
225
226
231
232
233void PL_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, bool* aSelectionCancelledFlag )
234{
235 int threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) );
236
237 // locate items.
238 COLLECTOR collector;
239
240 for( DS_DATA_ITEM* dataItem : DS_DATA_MODEL::GetTheInstance().GetItems() )
241 {
242 for( DS_DRAW_ITEM_BASE* drawItem : dataItem->GetDrawItems() )
243 {
244 if( drawItem->HitTest( aWhere, threshold ) )
245 collector.Append( drawItem );
246 }
247 }
248
249 m_selection.ClearReferencePoint();
250
251 // Apply some ugly heuristics to avoid disambiguation menus whenever possible
252 if( collector.GetCount() > 1 && !m_skip_heuristics )
253 guessSelectionCandidates( collector, aWhere );
254
255 // If still more than one item we're going to have to ask the user.
256 if( collector.GetCount() > 1 )
257 {
258 doSelectionMenu( &collector );
259
260 if( collector.m_MenuCancelled )
261 {
262 if( aSelectionCancelledFlag )
263 *aSelectionCancelledFlag = true;
264
265 return;
266 }
267 }
268
269 bool anyAdded = false;
270 bool anySubtracted = false;
271
272
274 {
275 if( collector.GetCount() == 0 )
276 anySubtracted = true;
277
279 }
280
281 if( collector.GetCount() > 0 )
282 {
283 for( int i = 0; i < collector.GetCount(); ++i )
284 {
285 if( m_subtractive || ( m_exclusive_or && collector[i]->IsSelected() ) )
286 {
287 unselect( collector[i] );
288 anySubtracted = true;
289 }
290 else
291 {
292 select( collector[i] );
293 anyAdded = true;
294 }
295 }
296 }
297
298 if( anyAdded )
299 m_toolMgr->ProcessEvent( EVENTS::SelectedEvent );
300
301 if( anySubtracted )
302 m_toolMgr->ProcessEvent( EVENTS::UnselectedEvent );
303}
304
305
307{
308 // There are certain conditions that can be handled automatically.
309
310 // Prefer an exact hit to a sloppy one
311 for( int i = 0; collector.GetCount() == 2 && i < 2; ++i )
312 {
313 EDA_ITEM* item = collector[ i ];
314 EDA_ITEM* other = collector[ ( i + 1 ) % 2 ];
315
316 if( item->HitTest( aPos, 0 ) && !other->HitTest( aPos, 0 ) )
317 collector.Transfer( other );
318 }
319}
320
321
323{
324 // If nothing is selected do a hover selection
325 if( m_selection.Empty() )
326 {
327 VECTOR2D cursorPos = getViewControls()->GetCursorPosition( true );
328
330 SelectPoint( cursorPos );
331 m_selection.SetIsHover( true );
332 }
333
334 return m_selection;
335}
336
337
339{
340 bool cancelled = false; // Was the tool cancelled while it was running?
341 m_multiple = true; // Multiple selection mode is active
342 KIGFX::VIEW* view = getView();
343
345 view->Add( &area );
346
347 while( TOOL_EVENT* evt = Wait() )
348 {
349 /* Selection mode depends on direction of drag-selection:
350 * Left > Right : Select objects that are fully enclosed by selection
351 * Right > Left : Select objects that are crossed by selection
352 */
353 bool windowSelection = area.GetEnd().x > area.GetOrigin().x;
354
355 m_frame->GetCanvas()->SetCurrentCursor( windowSelection ? KICURSOR::SELECT_WINDOW
357
358 if( evt->IsCancelInteractive() || evt->IsActivate() )
359 {
360 cancelled = true;
361 break;
362 }
363
364 if( evt->IsDrag( BUT_LEFT ) )
365 {
368
369 // Start drawing a selection box
370 area.SetOrigin( evt->DragOrigin() );
371 area.SetEnd( evt->Position() );
374 area.SetExclusiveOr( false );
375 area.SetMode( windowSelection ? SELECTION_MODE::INSIDE_RECTANGLE
377
378 view->SetVisible( &area, true );
379 view->Update( &area );
380 getViewControls()->SetAutoPan( true );
381 }
382
383 if( evt->IsMouseUp( BUT_LEFT ) )
384 {
385 getViewControls()->SetAutoPan( false );
386
387 // End drawing the selection box
388 view->SetVisible( &area, false );
389
390 bool anyAdded = false;
391 bool anySubtracted = false;
392
393 // Construct a BOX2I to determine EDA_ITEM selection
394 BOX2I selectionRect( area.ViewBBox() );
395
396 selectionRect.Normalize();
397
398 for( DS_DATA_ITEM* dataItem : DS_DATA_MODEL::GetTheInstance().GetItems() )
399 {
400 for( DS_DRAW_ITEM_BASE* item : dataItem->GetDrawItems() )
401 {
402 if( item->HitTest( selectionRect, windowSelection ) )
403 {
404 if( m_subtractive || ( m_exclusive_or && item->IsSelected() ) )
405 {
406 unselect( item );
407 anySubtracted = true;
408 }
409 else
410 {
411 select( item );
412 anyAdded = true;
413 }
414 }
415 }
416 }
417
418 // Inform other potentially interested tools
419 if( anyAdded )
420 m_toolMgr->ProcessEvent( EVENTS::SelectedEvent );
421
422 if( anySubtracted )
423 m_toolMgr->ProcessEvent( EVENTS::UnselectedEvent );
424
425 break; // Stop waiting for events
426 }
427 }
428
429 getViewControls()->SetAutoPan( false );
430
431 // Stop drawing the selection box
432 view->Remove( &area );
433 m_multiple = false; // Multiple selection mode is inactive
434
435 if( !cancelled )
436 m_selection.ClearReferencePoint();
437
438 return cancelled;
439}
440
441
443{
445 return 0;
446}
447
448
450{
451 for( DS_DATA_ITEM* dataItem : DS_DATA_MODEL::GetTheInstance().GetItems() )
452 {
453 for( DS_DRAW_ITEM_BASE* item : dataItem->GetDrawItems() )
454 select( item );
455 }
456
457 m_toolMgr->ProcessEvent( EVENTS::SelectedEvent );
458
459 return 0;
460}
461
462
464{
465 m_selection.Clear();
466
467 for( DS_DATA_ITEM* dataItem : DS_DATA_MODEL::GetTheInstance().GetItems() )
468 {
469 for( DS_DRAW_ITEM_BASE* item : dataItem->GetDrawItems() )
470 {
471 if( item->IsSelected() )
472 select( item );
473 }
474 }
475}
476
477
479{
480 if( m_selection.Empty() )
481 return;
482
483 while( m_selection.GetSize() )
485
487
488 m_selection.SetIsHover( false );
489 m_selection.ClearReferencePoint();
490
491 // Inform other potentially interested tools
492 m_toolMgr->ProcessEvent( EVENTS::ClearedEvent );
493}
494
495
497{
498 highlight( aItem, SELECTED, &m_selection );
499}
500
501
503{
504 unhighlight( aItem, SELECTED, &m_selection );
505}
506
507
508void PL_SELECTION_TOOL::highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
509{
510 if( aMode == SELECTED )
511 aItem->SetSelected();
512 else if( aMode == BRIGHTENED )
513 aItem->SetBrightened();
514
515 if( aGroup )
516 aGroup->Add( aItem );
517
518 getView()->Update( aItem );
519}
520
521
522void PL_SELECTION_TOOL::unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
523{
524 if( aMode == SELECTED )
525 aItem->ClearSelected();
526 else if( aMode == BRIGHTENED )
527 aItem->ClearBrightened();
528
529 if( aGroup )
530 aGroup->Remove( aItem );
531
532 getView()->Update( aItem );
533}
534
535
537{
538 const unsigned GRIP_MARGIN = 20;
539 VECTOR2I margin = getView()->ToWorld( VECTOR2I( GRIP_MARGIN, GRIP_MARGIN ), false );
540
541 // Check if the point is located within any of the currently selected items bounding boxes
542 for( EDA_ITEM* item : m_selection )
543 {
544 BOX2I itemBox = item->ViewBBox();
545 itemBox.Inflate( margin.x, margin.y ); // Give some margin for gripping an item
546
547 if( itemBox.Contains( aPoint ) )
548 return true;
549 }
550
551 return false;
552}
553
554
BOX2< VECTOR2I > BOX2I
Definition box2.h:914
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:982
static TOOL_ACTION unselectAll
Definition actions.h:79
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
Definition actions.h:223
static TOOL_ACTION unselectItem
Definition actions.h:224
static TOOL_ACTION cursorDblClick
Definition actions.h:177
static TOOL_ACTION selectionActivate
Activation of the selection tool.
Definition actions.h:210
static TOOL_ACTION selectionMenu
Run a selection menu to select from a list of items.
Definition actions.h:232
static TOOL_ACTION updateMenu
Definition actions.h:266
static TOOL_ACTION cursorClick
Definition actions.h:176
static TOOL_ACTION zoomFitScreen
Definition actions.h:138
static TOOL_ACTION selectionClear
Clear the current selection.
Definition actions.h:220
static TOOL_ACTION selectAll
Definition actions.h:78
static TOOL_ACTION unselectItems
Definition actions.h:229
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
Definition actions.h:228
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition box2.h:553
constexpr BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
Definition box2.h:143
constexpr bool Contains(const Vec &aPoint) const
Definition box2.h:165
An abstract class that will find and hold all the objects according to an inspection done by the Insp...
Definition collector.h:45
void Transfer(int aIndex)
Move the item at aIndex (first position is 0) to the backup list.
Definition collector.h:149
bool m_MenuCancelled
Definition collector.h:237
int GetCount() const
Return the number of objects in the list.
Definition collector.h:79
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Definition collector.h:97
Drawing sheet structure type definitions.
static DS_DATA_MODEL & GetTheInstance()
Return the instance of DS_DATA_MODEL used in the application.
Base class to handle basic graphic items.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
void ClearSelected()
Definition eda_item.h:153
void SetSelected()
Definition eda_item.h:150
void ClearBrightened()
Definition eda_item.h:154
void SetBrightened()
Definition eda_item.h:151
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if aPosition is inside or on the boundary of this item.
Definition eda_item.h:309
static const TOOL_EVENT DisambiguatePoint
Used to inform tool that it should display the disambiguation menu.
Definition actions.h:362
static const TOOL_EVENT ClearedEvent
Definition actions.h:347
static const TOOL_EVENT SelectedEvent
Definition actions.h:345
static const TOOL_EVENT UnselectedEvent
Definition actions.h:346
Represent a selection area (currently a rectangle) in a VIEW, drawn corner-to-corner between two poin...
void SetMode(SELECTION_MODE aMode)
void SetSubtractive(bool aSubtractive)
void SetAdditive(bool aAdditive)
void SetOrigin(const VECTOR2I &aOrigin)
Set the origin of the rectangle (the fixed corner)
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void SetExclusiveOr(bool aExclusiveOr)
void SetEnd(const VECTOR2I &aEnd)
Set the current end of the rectangle (the corner that moves with the 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.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition view.cpp:297
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition view.cpp:412
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...
Definition view.cpp:1892
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Definition view.cpp:548
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
Definition view.cpp:1813
static TOOL_ACTION placeImage
Definition pl_actions.h:37
static TOOL_ACTION drawRectangle
Definition pl_actions.h:38
static TOOL_ACTION placeText
Definition pl_actions.h:36
static TOOL_ACTION drawLine
Definition pl_actions.h:39
Tool that displays edit points allowing to modify items by dragging the points.
bool HasPoint()
Indicate the cursor is over an edit point.
int SelectAll(const TOOL_EVENT &aEvent)
void select(EDA_ITEM *aItem) override
Takes necessary action mark an item as selected.
void setTransitions() override
Set up handlers for various events.
bool Init() override
Init() is called once upon a registration of the tool.
int disambiguateCursor(const TOOL_EVENT &aEvent)
Handle disambiguation actions including displaying the menu.
int ClearSelection(const TOOL_EVENT &aEvent)
void SelectPoint(const VECTOR2I &aWhere, bool *aSelectionCancelledFlag=nullptr)
Select an item pointed by the parameter aWhere.
void guessSelectionCandidates(COLLECTOR &collector, const VECTOR2I &aWhere)
Apply heuristics to try and determine a single object when multiple are found under the cursor.
bool selectionContains(const VECTOR2I &aPoint) const
void unselect(EDA_ITEM *aItem) override
Take necessary action mark an item as unselected.
bool selectMultiple()
Handle drawing a selection box that allows one to select many items at the same time.
PL_SELECTION & GetSelection()
Return the set of currently selected items.
PL_SELECTION & RequestSelection()
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
void highlight(EDA_ITEM *aItem, int aHighlightMode, SELECTION *aGroup=nullptr) override
Highlight the item visually.
void unhighlight(EDA_ITEM *aItem, int aHighlightMode, SELECTION *aGroup=nullptr) override
Unhighlight the item visually.
PL_EDITOR_FRAME * m_frame
int Main(const TOOL_EVENT &aEvent)
The main loop.
void RebuildSelection()
Rebuild the selection from the flags in the view items.
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
static bool Empty(const SELECTION &aSelection)
Test if there are no items selected.
bool m_multiple
Multiple selection mode is active.
int RemoveItemFromSel(const TOOL_EVENT &aEvent)
bool doSelectionMenu(COLLECTOR *aCollector)
wxTimer m_disambiguateTimer
Timer to show the disambiguate menu.
bool m_drag_additive
Add multiple items to selection.
bool m_exclusive_or
Items' selection state should be toggled.
int AddItemsToSel(const TOOL_EVENT &aEvent)
int AddItemToSel(const TOOL_EVENT &aEvent)
int UpdateMenu(const TOOL_EVENT &aEvent)
Update a menu's state based on the current selection.
void setModifiersState(bool aShiftState, bool aCtrlState, bool aAltState)
Set the configuration of m_additive, m_subtractive, m_exclusive_or, m_skip_heuristics from the state ...
VECTOR2I m_originalCursor
Location of original cursor when starting click.
int SelectionMenu(const TOOL_EVENT &aEvent)
Show a popup menu to trim the COLLECTOR passed as aEvent's parameter down to a single item.
int RemoveItemsFromSel(const TOOL_EVENT &aEvent)
bool m_subtractive
Items should be removed from selection.
SELECTION_TOOL(const std::string &aName)
bool m_skip_heuristics
Show disambiguation menu for all items under the cursor rather than trying to narrow them down first ...
bool m_drag_subtractive
Remove multiple from selection.
bool m_additive
Items should be added to sel (instead of replacing).
bool hasModifier()
True if a selection modifier is enabled, false otherwise.
bool m_canceledMenu
Sets to true if the disambiguation menu was canceled.
void onDisambiguationExpire(wxTimerEvent &aEvent)
Start the process to show our disambiguation menu once the user has kept the mouse down for the minim...
virtual void Add(EDA_ITEM *aItem)
A null aItem is ignored; the selection never holds null members.
Definition selection.cpp:38
virtual void Remove(EDA_ITEM *aItem)
Definition selection.cpp:60
T * getEditFrame() const
Return the application window object, casted to requested user type.
Definition tool_base.h:182
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition tool_base.cpp:40
TOOL_MANAGER * m_toolMgr
Definition tool_base.h:220
KIGFX::VIEW * getView() const
Return the instance of KIGFX::VIEW object used in the application.
Definition tool_base.cpp:34
RESET_REASON
Determine the reason of reset for a tool.
Definition tool_base.h:74
@ MODEL_RELOAD
Model changes (the sheet for a schematic)
Definition tool_base.h:76
Generic, UI-independent tool event.
Definition tool_event.h:167
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
std::unique_ptr< TOOL_MENU > m_menu
The functions below are not yet implemented - their interface may change.
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Suspend execution of the tool until an event specified in aEventList arrives.
@ SUBTRACT
Definition cursors.h:68
@ SELECT_WINDOW
Definition cursors.h:82
@ SELECT_LASSO
Definition cursors.h:84
@ MOVING
Definition cursors.h:44
@ ARROW
Definition cursors.h:42
#define BRIGHTENED
item is drawn with a bright contour
#define SELECTED
Item was manually selected by the user.
#define HITTEST_THRESHOLD_PIXELS
@ TA_UNDO_REDO_PRE
This event is sent before undo/redo command is performed.
Definition tool_event.h:102
@ MD_ALT
Definition tool_event.h:141
@ MD_CTRL
Definition tool_event.h:140
@ MD_SHIFT
Definition tool_event.h:139
@ BUT_MIDDLE
Definition tool_event.h:130
@ BUT_LEFT
Definition tool_event.h:128
@ BUT_RIGHT
Definition tool_event.h:129
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708
VECTOR2< double > VECTOR2D
Definition vector2d.h:707