KiCad PCB EDA Suite
TOOL_EVENT Class Reference

Class TOOL_EVENT. More...

#include <tool_event.h>

Public Member Functions

const std::string Format () const
 Function Format() Returns information about event in form of a human-readable string. More...
 
 TOOL_EVENT (TOOL_EVENT_CATEGORY aCategory=TC_NONE, TOOL_ACTIONS aAction=TA_NONE, TOOL_ACTION_SCOPE aScope=AS_GLOBAL, void *aParameter=nullptr)
 
 TOOL_EVENT (TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, int aExtraParam, TOOL_ACTION_SCOPE aScope=AS_GLOBAL, void *aParameter=nullptr)
 
 TOOL_EVENT (TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, const std::string &aExtraParam, TOOL_ACTION_SCOPE aScope=AS_GLOBAL, void *aParameter=nullptr)
 
TOOL_EVENT_CATEGORY Category () const
 

Returns the category (eg. mouse/keyboard/action) of an event..

More...
 
TOOL_ACTIONS Action () const
 

Returns more specific information about the type of an event.

More...
 
bool PassEvent () const
 

These give a tool a method of informing the TOOL_MANAGER that a particular event should be passed on to subsequent tools on the stack.

More...
 
void SetPassEvent ()
 
bool HasPosition () const
 

Returns if it this event has a valid position (true for mouse events and context-menu or hotkey-based command events)

More...
 
void SetHasPosition (bool aHasPosition)
 
TOOL_BASEFirstResponder () const
 
void SetFirstResponder (TOOL_BASE *aTool)
 
const VECTOR2D Delta () const
 

Returns information about difference between current mouse cursor position and the place where dragging has started.

More...
 
const VECTOR2D Position () const
 

Returns mouse cursor position in world coordinates.

More...
 
const VECTOR2D DragOrigin () const
 

Returns the point where dragging has started.

More...
 
int Buttons () const
 

Returns information about mouse buttons state.

More...
 
bool IsClick (int aButtonMask=BUT_ANY) const
 
bool IsDblClick (int aButtonMask=BUT_ANY) const
 
bool IsDrag (int aButtonMask=BUT_ANY) const
 
bool IsMouseUp (int aButtonMask=BUT_ANY) const
 
bool IsMotion () const
 
bool IsMouseAction () const
 
bool IsCancel () const
 
bool IsActivate () const
 
bool IsUndoRedo () const
 
bool IsChoiceMenu () const
 
bool IsPrime () const
 
int Modifier (int aMask=MD_MODIFIER_MASK) const
 

Returns information about key modifiers state (Ctrl, Alt, etc.)

More...
 
int KeyCode () const
 
bool IsKeyPressed () const
 
bool Matches (const TOOL_EVENT &aEvent) const
 Function Matches() Tests whether two events match in terms of category & action or command. More...
 
bool IsAction (const TOOL_ACTION *aAction) const
 Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_ACTION. More...
 
bool IsCancelInteractive ()
 Function IsCancelInteractive() More...
 
bool IsSelectionEvent ()
 Function IsSelectionEvent() More...
 
bool IsPointEditor ()
 Function IsPointEditor. More...
 
bool IsMoveTool ()
 Function IsMoveTool. More...
 
template<typename T >
Parameter () const
 Function Parameter() Returns a non-standard parameter assigned to the event. More...
 
template<typename T >
void SetParameter (T aParam)
 Function SetParameter() Sets a non-standard parameter assigned to the event. More...
 
OPT< int > GetCommandId () const
 
OPT< std::string > GetCommandStr () const
 
void SetMousePosition (const VECTOR2D &aP)
 

Private Member Functions

void init ()
 
void setMouseDragOrigin (const VECTOR2D &aP)
 
void setMouseDelta (const VECTOR2D &aP)
 
void setMouseButtons (int aButtons)
 
void setModifiers (int aMods)
 
VECTOR2D returnCheckedPosition (const VECTOR2D &aPos) const
 Ensure that the event is a type that has a position before returning a position, otherwise return a null-constructed position. More...
 

Private Attributes

TOOL_EVENT_CATEGORY m_category
 
TOOL_ACTIONS m_actions
 
TOOL_ACTION_SCOPE m_scope
 
bool m_passEvent
 
bool m_hasPosition
 
VECTOR2D m_mouseDelta
 

Difference between mouse cursor position and the point where dragging event has started

More...
 
VECTOR2D m_mousePos
 

Current mouse cursor position

More...
 
VECTOR2D m_mouseDragOrigin
 

Point where dragging has started

More...
 
int m_mouseButtons
 

State of mouse buttons

More...
 
int m_keyCode
 

Stores code of pressed/released key

More...
 
int m_modifiers
 

State of key modifierts (Ctrl/Alt/etc.)

More...
 
void * m_param
 

Generic parameter used for passing non-standard data.

More...
 
TOOL_BASEm_firstResponder
 

The first tool to receive the event

More...
 
OPT< int > m_commandId
 
OPT< std::string > m_commandStr
 

Friends

class TOOL_DISPATCHER
 

Detailed Description

Class TOOL_EVENT.

Generic, UI-independent tool event.

Definition at line 171 of file tool_event.h.

Constructor & Destructor Documentation

◆ TOOL_EVENT() [1/3]

TOOL_EVENT::TOOL_EVENT ( TOOL_EVENT_CATEGORY  aCategory = TC_NONE,
TOOL_ACTIONS  aAction = TA_NONE,
TOOL_ACTION_SCOPE  aScope = AS_GLOBAL,
void *  aParameter = nullptr 
)
inline

Definition at line 182 of file tool_event.h.

183  :
184  m_category( aCategory ),
185  m_actions( aAction ),
186  m_scope( aScope ),
187  m_mouseButtons( 0 ),
188  m_keyCode( 0 ),
189  m_modifiers( 0 ),
190  m_param( aParameter ),
191  m_firstResponder( nullptr )
192  {
193  init();
194  }
void init()
Definition: tool_event.cpp:54
int m_modifiers
State of key modifierts (Ctrl/Alt/etc.)
Definition: tool_event.h:544
TOOL_ACTIONS m_actions
Definition: tool_event.h:522
int m_mouseButtons
State of mouse buttons
Definition: tool_event.h:538
int m_keyCode
Stores code of pressed/released key
Definition: tool_event.h:541
TOOL_ACTION_SCOPE m_scope
Definition: tool_event.h:523
TOOL_BASE * m_firstResponder
The first tool to receive the event
Definition: tool_event.h:550
void * m_param
Generic parameter used for passing non-standard data.
Definition: tool_event.h:547
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:521

References init().

◆ TOOL_EVENT() [2/3]

TOOL_EVENT::TOOL_EVENT ( TOOL_EVENT_CATEGORY  aCategory,
TOOL_ACTIONS  aAction,
int  aExtraParam,
TOOL_ACTION_SCOPE  aScope = AS_GLOBAL,
void *  aParameter = nullptr 
)
inline

Definition at line 196 of file tool_event.h.

197  :
198  m_category( aCategory ),
199  m_actions( aAction ),
200  m_scope( aScope ),
201  m_mouseButtons( 0 ),
202  m_keyCode( 0 ),
203  m_modifiers( 0 ),
204  m_param( aParameter ),
205  m_firstResponder( nullptr )
206  {
207  if( aCategory == TC_MOUSE )
208  {
209  setMouseButtons( aExtraParam & BUT_BUTTON_MASK );
210  }
211  else if( aCategory == TC_KEYBOARD )
212  {
213  m_keyCode = aExtraParam & ~MD_MODIFIER_MASK; // Filter out modifiers
214  }
215  else if( aCategory == TC_COMMAND )
216  {
217  m_commandId = aExtraParam;
218  }
219 
220  if( aCategory & ( TC_MOUSE | TC_KEYBOARD ) )
221  {
222  m_modifiers = aExtraParam & MD_MODIFIER_MASK;
223  }
224 
225  init();
226  }
void setMouseButtons(int aButtons)
Definition: tool_event.h:488
void init()
Definition: tool_event.cpp:54
int m_modifiers
State of key modifierts (Ctrl/Alt/etc.)
Definition: tool_event.h:544
TOOL_ACTIONS m_actions
Definition: tool_event.h:522
int m_mouseButtons
State of mouse buttons
Definition: tool_event.h:538
int m_keyCode
Stores code of pressed/released key
Definition: tool_event.h:541
OPT< int > m_commandId
Definition: tool_event.h:552
TOOL_ACTION_SCOPE m_scope
Definition: tool_event.h:523
TOOL_BASE * m_firstResponder
The first tool to receive the event
Definition: tool_event.h:550
void * m_param
Generic parameter used for passing non-standard data.
Definition: tool_event.h:547
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:521

References BUT_BUTTON_MASK, init(), m_commandId, m_keyCode, m_modifiers, MD_MODIFIER_MASK, setMouseButtons(), TC_COMMAND, TC_KEYBOARD, and TC_MOUSE.

◆ TOOL_EVENT() [3/3]

TOOL_EVENT::TOOL_EVENT ( TOOL_EVENT_CATEGORY  aCategory,
TOOL_ACTIONS  aAction,
const std::string &  aExtraParam,
TOOL_ACTION_SCOPE  aScope = AS_GLOBAL,
void *  aParameter = nullptr 
)
inline

Definition at line 228 of file tool_event.h.

230  :
231  m_category( aCategory ),
232  m_actions( aAction ),
233  m_scope( aScope ),
234  m_mouseButtons( 0 ),
235  m_keyCode( 0 ),
236  m_modifiers( 0 ),
237  m_param( aParameter ),
238  m_firstResponder( nullptr )
239  {
240  if( aCategory == TC_COMMAND || aCategory == TC_MESSAGE )
241  m_commandStr = aExtraParam;
242 
243  init();
244  }
void init()
Definition: tool_event.cpp:54
int m_modifiers
State of key modifierts (Ctrl/Alt/etc.)
Definition: tool_event.h:544
TOOL_ACTIONS m_actions
Definition: tool_event.h:522
int m_mouseButtons
State of mouse buttons
Definition: tool_event.h:538
OPT< std::string > m_commandStr
Definition: tool_event.h:553
int m_keyCode
Stores code of pressed/released key
Definition: tool_event.h:541
TOOL_ACTION_SCOPE m_scope
Definition: tool_event.h:523
TOOL_BASE * m_firstResponder
The first tool to receive the event
Definition: tool_event.h:550
void * m_param
Generic parameter used for passing non-standard data.
Definition: tool_event.h:547
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:521

References init(), m_commandStr, TC_COMMAND, and TC_MESSAGE.

Member Function Documentation

◆ Action()

TOOL_ACTIONS TOOL_EVENT::Action ( ) const
inline

Returns more specific information about the type of an event.

Definition at line 250 of file tool_event.h.

250 { return m_actions; }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522

References m_actions.

Referenced by EDIT_TOOL::cutToClipboard(), TOOL_MANAGER::dispatchHotKey(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), and LIB_MOVE_TOOL::Main().

◆ Buttons()

int TOOL_EVENT::Buttons ( ) const
inline

Returns information about mouse buttons state.

Definition at line 286 of file tool_event.h.

287  {
288  assert( m_category == TC_MOUSE ); // this should be used only with mouse events
289  return m_mouseButtons;
290  }
int m_mouseButtons
State of mouse buttons
Definition: tool_event.h:538
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:521

References m_category, m_mouseButtons, and TC_MOUSE.

◆ Category()

TOOL_EVENT_CATEGORY TOOL_EVENT::Category ( ) const
inline

Returns the category (eg. mouse/keyboard/action) of an event..

Definition at line 247 of file tool_event.h.

247 { return m_category; }
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:521

References m_category.

Referenced by EDIT_TOOL::cutToClipboard(), TOOL_MANAGER::dispatchInternal(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), and EDIT_TOOL::Move().

◆ Delta()

const VECTOR2D TOOL_EVENT::Delta ( ) const
inline

Returns information about difference between current mouse cursor position and the place where dragging has started.

Definition at line 268 of file tool_event.h.

269  {
271  }
VECTOR2D returnCheckedPosition(const VECTOR2D &aPos) const
Ensure that the event is a type that has a position before returning a position, otherwise return a n...
Definition: tool_event.h:509
VECTOR2D m_mouseDelta
Difference between mouse cursor position and the point where dragging event has started
Definition: tool_event.h:529

References m_mouseDelta, and returnCheckedPosition().

◆ DragOrigin()

const VECTOR2D TOOL_EVENT::DragOrigin ( ) const
inline

Returns the point where dragging has started.

Definition at line 280 of file tool_event.h.

281  {
283  }
VECTOR2D returnCheckedPosition(const VECTOR2D &aPos) const
Ensure that the event is a type that has a position before returning a position, otherwise return a n...
Definition: tool_event.h:509
VECTOR2D m_mouseDragOrigin
Point where dragging has started
Definition: tool_event.h:535

References m_mouseDragOrigin, and returnCheckedPosition().

Referenced by EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), and POINT_EDITOR::updateEditedPoint().

◆ FirstResponder()

TOOL_BASE* TOOL_EVENT::FirstResponder ( ) const
inline

Definition at line 263 of file tool_event.h.

263 { return m_firstResponder; }
TOOL_BASE * m_firstResponder
The first tool to receive the event
Definition: tool_event.h:550

References m_firstResponder.

Referenced by TOOL_MANAGER::dispatchInternal().

◆ Format()

const std::string TOOL_EVENT::Format ( ) const

Function Format() Returns information about event in form of a human-readable string.

Returns
Event information.

Definition at line 73 of file tool_event.cpp.

74 {
75  std::string ev;
76 
77  const FlagString categories[] =
78  {
79  { TC_MOUSE, "mouse" },
80  { TC_KEYBOARD, "keyboard" },
81  { TC_COMMAND, "command" },
82  { TC_MESSAGE, "message" },
83  { TC_VIEW, "view" },
84  { 0, "" }
85  };
86 
87  const FlagString actions[] =
88  {
89  { TA_MOUSE_CLICK, "click" },
90  { TA_MOUSE_DBLCLICK, "double click" },
91  { TA_MOUSE_UP, "button-up" },
92  { TA_MOUSE_DOWN, "button-down" },
93  { TA_MOUSE_DRAG, "drag" },
94  { TA_MOUSE_MOTION, "motion" },
95  { TA_MOUSE_WHEEL, "wheel" },
96  { TA_KEY_PRESSED, "key-pressed" },
97  { TA_VIEW_REFRESH, "view-refresh" },
98  { TA_VIEW_ZOOM, "view-zoom" },
99  { TA_VIEW_PAN, "view-pan" },
100  { TA_VIEW_DIRTY, "view-dirty" },
101  { TA_CHANGE_LAYER, "change-layer" },
102  { TA_CANCEL_TOOL, "cancel-tool" },
103  { TA_CHOICE_MENU_UPDATE, "choice-menu-update" },
104  { TA_CHOICE_MENU_CHOICE, "choice-menu-choice" },
105  { TA_UNDO_REDO_PRE, "undo-redo-pre" },
106  { TA_UNDO_REDO_POST, "undo-redo-post" },
107  { TA_ACTION, "action" },
108  { TA_ACTIVATE, "activate" },
109  { 0, "" }
110  };
111 
112  const FlagString buttons[] =
113  {
114  { BUT_NONE, "none" },
115  { BUT_LEFT, "left" },
116  { BUT_RIGHT, "right" },
117  { BUT_MIDDLE, "middle" },
118  { 0, "" }
119  };
120 
121  const FlagString modifiers[] =
122  {
123  { MD_SHIFT, "shift" },
124  { MD_CTRL, "ctrl" },
125  { MD_ALT, "alt" },
126  { 0, "" }
127  };
128 
129  ev = "category: ";
130  ev += flag2string( m_category, categories );
131  ev += " action: ";
132  ev += flag2string( m_actions, actions );
133 
134  if( m_actions & TA_MOUSE )
135  {
136  ev += " btns: ";
137  ev += flag2string( m_mouseButtons, buttons );
138  }
139 
140  if( m_actions & TA_KEYBOARD )
141  {
142  char tmp[128];
143  sprintf( tmp, "key: %d", m_keyCode );
144  ev += tmp;
145  }
146 
147  if( m_actions & ( TA_MOUSE | TA_KEYBOARD ) )
148  {
149  ev += " mods: ";
150  ev += flag2string( m_modifiers, modifiers );
151  }
152 
153  if( m_commandId )
154  {
155  char tmp[128];
156  sprintf( tmp, "cmd-id: %d", *m_commandId );
157  ev += tmp;
158  }
159 
160  if( m_commandStr )
161  ev += "cmd-str: " + ( *m_commandStr );
162 
163  return ev;
164 }
int m_modifiers
State of key modifierts (Ctrl/Alt/etc.)
Definition: tool_event.h:544
TOOL_ACTIONS m_actions
Definition: tool_event.h:522
int m_mouseButtons
State of mouse buttons
Definition: tool_event.h:538
OPT< std::string > m_commandStr
Definition: tool_event.h:553
int m_keyCode
Stores code of pressed/released key
Definition: tool_event.h:541
OPT< int > m_commandId
Definition: tool_event.h:552
static const std::string flag2string(int aFlag, const FlagString *aExps)
Definition: tool_event.cpp:40
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:521

References BUT_LEFT, BUT_MIDDLE, BUT_NONE, BUT_RIGHT, flag2string(), m_actions, m_category, m_commandId, m_commandStr, m_keyCode, m_modifiers, m_mouseButtons, MD_ALT, MD_CTRL, MD_SHIFT, TA_ACTION, TA_ACTIVATE, TA_CANCEL_TOOL, TA_CHANGE_LAYER, TA_CHOICE_MENU_CHOICE, TA_CHOICE_MENU_UPDATE, TA_KEY_PRESSED, TA_KEYBOARD, TA_MOUSE, TA_MOUSE_CLICK, TA_MOUSE_DBLCLICK, TA_MOUSE_DOWN, TA_MOUSE_DRAG, TA_MOUSE_MOTION, TA_MOUSE_UP, TA_MOUSE_WHEEL, TA_UNDO_REDO_POST, TA_UNDO_REDO_PRE, TA_VIEW_DIRTY, TA_VIEW_PAN, TA_VIEW_REFRESH, TA_VIEW_ZOOM, TC_COMMAND, TC_KEYBOARD, TC_MESSAGE, TC_MOUSE, and TC_VIEW.

Referenced by TOOL_MANAGER::dispatchActivation(), TOOL_MANAGER::dispatchInternal(), and TOOL_MANAGER::processEvent().

◆ GetCommandId()

OPT<int> TOOL_EVENT::GetCommandId ( ) const
inline

Definition at line 458 of file tool_event.h.

459  {
460  return m_commandId;
461  }
OPT< int > m_commandId
Definition: tool_event.h:552

References m_commandId.

Referenced by SCH_MOVE_TOOL::Main().

◆ GetCommandStr()

OPT<std::string> TOOL_EVENT::GetCommandStr ( ) const
inline

Definition at line 463 of file tool_event.h.

464  {
465  return m_commandStr;
466  }
OPT< std::string > m_commandStr
Definition: tool_event.h:553

References m_commandStr.

Referenced by MICROWAVE_TOOL::addMicrowaveFootprint(), LIB_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), TOOL_MANAGER::dispatchActivation(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawVia(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_INSPECTION_TOOL::HighlightNetTool(), IsMoveTool(), IsPointEditor(), PCB_INSPECTION_TOOL::LocalRatsnestTool(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), MODULE_EDITOR_TOOLS::PlacePad(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ HasPosition()

◆ init()

void TOOL_EVENT::init ( )
private

Definition at line 54 of file tool_event.cpp.

55 {
56  // By default only MESSAGEs and Cancels are passed to multiple recipients
58 
60 
61  // Cancel tool doesn't contain a position
62  if( IsCancel() )
63  m_hasPosition = false;
64 }
bool IsCancel() const
Definition: tool_event.h:316
bool m_hasPosition
Definition: tool_event.h:525
bool m_passEvent
Definition: tool_event.h:524
bool IsCancelInteractive()
Function IsCancelInteractive()
Definition: tool_event.cpp:190
bool IsActivate() const
Definition: tool_event.h:321
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:521

References IsActivate(), IsCancel(), IsCancelInteractive(), m_category, m_hasPosition, m_passEvent, TC_COMMAND, TC_MESSAGE, and TC_MOUSE.

Referenced by TOOL_EVENT().

◆ IsAction()

bool TOOL_EVENT::IsAction ( const TOOL_ACTION aAction) const

Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_ACTION.

Parameters
aActionis the TOOL_ACTION to be checked against.
Returns
True if it matches the given TOOL_ACTION.

Definition at line 67 of file tool_event.cpp.

68 {
69  return Matches( aAction->MakeEvent() );
70 }
bool Matches(const TOOL_EVENT &aEvent) const
Function Matches() Tests whether two events match in terms of category & action or command.
Definition: tool_event.h:364
TOOL_EVENT MakeEvent() const
Function MakeEvent() Returns the event associated with the action (i.e.
Definition: tool_action.h:107

References TOOL_ACTION::MakeEvent(), and Matches().

Referenced by LIB_CONTROL::AddLibrary(), PCBNEW_CONTROL::AddLibrary(), LIB_CONTROL::AddSymbol(), SCH_EDIT_TOOL::ConvertDeMorgan(), LIB_CONTROL::CutCopyDelete(), MODULE_EDITOR_TOOLS::CutCopyFootprint(), GERBVIEW_CONTROL::DisplayControl(), EDIT_TOOL::Drag(), DRAWING_TOOL::DrawZone(), EDIT_TOOL::Duplicate(), LIB_CONTROL::DuplicateSymbol(), SCH_EDIT_TOOL::EditField(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), KICAD_MANAGER_CONTROL::Execute(), SCH_EDITOR_CONTROL::FindAndReplace(), SCH_EDITOR_CONTROL::FindNext(), PCB_EDITOR_CONTROL::GenerateFabFiles(), GERBVIEW_CONTROL::HighlightControl(), PCB_INSPECTION_TOOL::HighlightNet(), PCB_INSPECTION_TOOL::HighlightNetTool(), TOOL_EVT_UTILS::IsRotateToolEvt(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), EDIT_TOOL::Move(), LIB_CONTROL::OnDeMorgan(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceComponent(), LIB_EDIT_TOOL::Properties(), LIB_PIN_TOOL::PushPinProperties(), LIB_CONTROL::Save(), COMMON_CONTROL::ShowHelp(), COMMON_CONTROL::ShowLibraryTable(), COMMON_TOOLS::SwitchCanvas(), PCBNEW_CONTROL::ToggleRatsnest(), SCH_DRAWING_TOOLS::TwoClickPlace(), SCH_EDITOR_CONTROL::UpdateFind(), PCBNEW_CONTROL::ZoneDisplayMode(), COMMON_TOOLS::ZoomInOut(), and COMMON_TOOLS::ZoomInOutCenter().

◆ IsActivate()

bool TOOL_EVENT::IsActivate ( ) const
inline

Definition at line 321 of file tool_event.h.

322  {
323  return m_actions == TA_ACTIVATE;
324  }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522

References m_actions, and TA_ACTIVATE.

Referenced by TOOL_MANAGER::dispatchActivation(), init(), PL_EDIT_TOOL::Main(), LIB_MOVE_TOOL::Main(), and EDIT_TOOL::Move().

◆ IsCancel()

bool TOOL_EVENT::IsCancel ( ) const
inline

Definition at line 316 of file tool_event.h.

317  {
318  return m_actions == TA_CANCEL_TOOL;
319  }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522

References m_actions, and TA_CANCEL_TOOL.

Referenced by init().

◆ IsCancelInteractive()

bool TOOL_EVENT::IsCancelInteractive ( )

Function IsCancelInteractive()

Indicates the event should restart/end an ongoing interactive tool's event loop (eg esc key, click cancel, start different tool).

Definition at line 190 of file tool_event.cpp.

191 {
192  return( ( m_commandStr.is_initialized()
194  || ( m_commandId.is_initialized()
196  || ( m_actions == TA_CANCEL_TOOL ) );
197 }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
OPT< std::string > m_commandStr
Definition: tool_event.h:553
OPT< int > m_commandId
Definition: tool_event.h:552
int GetId() const
Function GetId() Returns the unique id of the TOOL_ACTION object.
Definition: tool_action.h:100
const std::string & GetName() const
Function GetName() Returns name of the action.
Definition: tool_action.h:78

References ACTIONS::cancelInteractive, TOOL_ACTION::GetId(), TOOL_ACTION::GetName(), m_actions, m_commandId, m_commandStr, and TA_CANCEL_TOOL.

Referenced by init(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), and EDIT_TOOL::Move().

◆ IsChoiceMenu()

bool TOOL_EVENT::IsChoiceMenu ( ) const
inline

Definition at line 331 of file tool_event.h.

332  {
333  return m_actions & TA_CHOICE_MENU;
334  }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522

References m_actions, and TA_CHOICE_MENU.

Referenced by TOOL_MANAGER::dispatchInternal().

◆ IsClick()

bool TOOL_EVENT::IsClick ( int  aButtonMask = BUT_ANY) const

Definition at line 178 of file tool_event.cpp.

179 {
180  return ( m_actions & TA_MOUSE_CLICK ) && ( m_mouseButtons & aButtonMask ) == m_mouseButtons;
181 }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522
int m_mouseButtons
State of mouse buttons
Definition: tool_event.h:538

References m_actions, m_mouseButtons, and TA_MOUSE_CLICK.

Referenced by TOOL_MANAGER::DispatchContextMenu(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), EDIT_TOOL::Move(), and PNS::TOOL_BASE::updateStartItem().

◆ IsDblClick()

bool TOOL_EVENT::IsDblClick ( int  aButtonMask = BUT_ANY) const

Definition at line 184 of file tool_event.cpp.

185 {
186  return m_actions == TA_MOUSE_DBLCLICK && ( m_mouseButtons & aButtonMask ) == m_mouseButtons;
187 }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522
int m_mouseButtons
State of mouse buttons
Definition: tool_event.h:538

References m_actions, m_mouseButtons, and TA_MOUSE_DBLCLICK.

◆ IsDrag()

bool TOOL_EVENT::IsDrag ( int  aButtonMask = BUT_ANY) const
inline

◆ IsKeyPressed()

bool TOOL_EVENT::IsKeyPressed ( ) const
inline

Definition at line 352 of file tool_event.h.

353  {
354  return m_actions == TA_KEY_PRESSED;
355  }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522

References m_actions, and TA_KEY_PRESSED.

Referenced by ROUTER_TOOL::handleCommonEvents().

◆ IsMotion()

◆ IsMouseAction()

bool TOOL_EVENT::IsMouseAction ( ) const
inline

Definition at line 311 of file tool_event.h.

312  {
313  return ( m_actions & TA_MOUSE );
314  }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522

References m_actions, and TA_MOUSE.

◆ IsMouseUp()

bool TOOL_EVENT::IsMouseUp ( int  aButtonMask = BUT_ANY) const
inline

Definition at line 301 of file tool_event.h.

302  {
303  return m_actions == TA_MOUSE_UP && ( m_mouseButtons & aButtonMask ) == m_mouseButtons;
304  }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522
int m_mouseButtons
State of mouse buttons
Definition: tool_event.h:538

References m_actions, m_mouseButtons, and TA_MOUSE_UP.

Referenced by PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), and EDIT_TOOL::Move().

◆ IsMoveTool()

bool TOOL_EVENT::IsMoveTool ( )

Function IsMoveTool.

Indicates if the event is from one of the move tools. Usually used to allow move to be done without de-activating the current drawing tool.

Definition at line 217 of file tool_event.cpp.

218 {
219  return( m_commandStr.is_initialized()
220  && m_commandStr.get().find( "InteractiveMove" ) != GetCommandStr()->npos );
221 }
OPT< std::string > m_commandStr
Definition: tool_event.h:553
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:463

References GetCommandStr(), and m_commandStr.

◆ IsPointEditor()

bool TOOL_EVENT::IsPointEditor ( )

Function IsPointEditor.

Indicates if the event is from one of the point editors. Usually used to allow the point editor to activate itself without de-activating the current drawing tool.

Definition at line 208 of file tool_event.cpp.

209 {
210  return( ( m_commandStr.is_initialized()
211  && m_commandStr.get().find( "PointEditor" ) != GetCommandStr()->npos )
212  || ( m_commandId.is_initialized()
214 }
static TOOL_ACTION activatePointEditor
Definition: actions.h:159
OPT< std::string > m_commandStr
Definition: tool_event.h:553
OPT< int > m_commandId
Definition: tool_event.h:552
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:463
int GetId() const
Function GetId() Returns the unique id of the TOOL_ACTION object.
Definition: tool_action.h:100

References ACTIONS::activatePointEditor, GetCommandStr(), TOOL_ACTION::GetId(), m_commandId, and m_commandStr.

◆ IsPrime()

bool TOOL_EVENT::IsPrime ( ) const
inline

Definition at line 336 of file tool_event.h.

337  {
338  return m_actions == TA_PRIME;
339  }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522

References m_actions, and TA_PRIME.

◆ IsSelectionEvent()

bool TOOL_EVENT::IsSelectionEvent ( )

Function IsSelectionEvent()

Indicates an selection-changed notification event.

Definition at line 200 of file tool_event.cpp.

201 {
202  return Matches( EVENTS::ClearedEvent )
205 }
static const TOOL_EVENT SelectedEvent
Definition: actions.h:197
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:198
static const TOOL_EVENT ClearedEvent
Definition: actions.h:199
bool Matches(const TOOL_EVENT &aEvent) const
Function Matches() Tests whether two events match in terms of category & action or command.
Definition: tool_event.h:364

References EVENTS::ClearedEvent, Matches(), EVENTS::SelectedEvent, and EVENTS::UnselectedEvent.

◆ IsUndoRedo()

bool TOOL_EVENT::IsUndoRedo ( ) const
inline

Definition at line 326 of file tool_event.h.

327  {
329  }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522

References m_actions, TA_UNDO_REDO_POST, and TA_UNDO_REDO_PRE.

◆ KeyCode()

int TOOL_EVENT::KeyCode ( ) const
inline

Definition at line 347 of file tool_event.h.

348  {
349  return m_keyCode;
350  }
int m_keyCode
Stores code of pressed/released key
Definition: tool_event.h:541

References m_keyCode.

Referenced by TOOL_MANAGER::dispatchHotKey(), and ROUTER_TOOL::handleCommonEvents().

◆ Matches()

bool TOOL_EVENT::Matches ( const TOOL_EVENT aEvent) const
inline

Function Matches() Tests whether two events match in terms of category & action or command.

Parameters
aEventis the event to test against.
Returns
True if two events match, false otherwise.

Definition at line 364 of file tool_event.h.

365  {
366  if( !( m_category & aEvent.m_category ) )
367  return false;
368 
370  {
371  if( (bool) m_commandStr && (bool) aEvent.m_commandStr )
372  return *m_commandStr == *aEvent.m_commandStr;
373 
374  if( (bool) m_commandId && (bool) aEvent.m_commandId )
375  return *m_commandId == *aEvent.m_commandId;
376  }
377 
378  // BUGFIX: TA_ANY should match EVERYTHING, even TA_NONE (for TC_MESSAGE)
379  if( m_actions == TA_ANY && aEvent.m_actions == TA_NONE && aEvent.m_category == TC_MESSAGE )
380  return true;
381 
382  // BUGFIX: This check must happen after the TC_COMMAND check because otherwise events of
383  // the form { TC_COMMAND, TA_NONE } will be incorrectly skipped
384  if( !( m_actions & aEvent.m_actions ) )
385  return false;
386 
387  return true;
388  }
TOOL_ACTIONS m_actions
Definition: tool_event.h:522
OPT< std::string > m_commandStr
Definition: tool_event.h:553
OPT< int > m_commandId
Definition: tool_event.h:552
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:521

References m_actions, m_category, m_commandId, m_commandStr, TA_ANY, TA_NONE, TC_COMMAND, and TC_MESSAGE.

Referenced by IsAction(), IsSelectionEvent(), LIB_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), LIB_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), and SCH_EDITOR_CONTROL::UpdateFind().

◆ Modifier()

int TOOL_EVENT::Modifier ( int  aMask = MD_MODIFIER_MASK) const
inline

◆ Parameter()

template<typename T >
T TOOL_EVENT::Parameter ( ) const
inline

Function Parameter() Returns a non-standard parameter assigned to the event.

Its meaning depends on the target tool.

Definition at line 435 of file tool_event.h.

436  {
437  // Exhibit #798 on why I love to hate C++
438  // - reinterpret_cast needs to be used for pointers
439  // - static_cast must be used for enums
440  // - templates can't usefully distinguish between pointer and non-pointer types
441  // Fortunately good old C's cast can be a reinterpret_cast or a static_cast, and
442  // C99 gave us intptr_t which is guaranteed to be round-trippable with a pointer.
443  return (T) reinterpret_cast<intptr_t>( m_param );
444  }
void * m_param
Generic parameter used for passing non-standard data.
Definition: tool_event.h:547

References m_param.

Referenced by PL_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemsToSel(), PL_SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::AddItemToSel(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), MICROWAVE_TOOL::addMicrowaveFootprint(), CVPCB_CONTROL::ChangeFocus(), SCH_EDIT_TOOL::ChangeShape(), SCH_EDIT_TOOL::ChangeTextType(), COMMON_TOOLS::CursorControl(), SELECTION_TOOL::CursorSelection(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::DrawZone(), KICAD_MANAGER_CONTROL::Execute(), TOOL_EVT_UTILS::GetEventRotationAngle(), COMMON_TOOLS::GridPreset(), PCBNEW_CONTROL::GridSetOrigin(), PCB_INSPECTION_TOOL::HighlightItem(), PCB_INSPECTION_TOOL::HighlightNet(), ROUTER_TOOL::InlineDrag(), PCBNEW_CONTROL::LayerSwitch(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::onViaCommand(), COMMON_TOOLS::PanControl(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), EDIT_TOOL::Remove(), PL_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemFromSel(), PL_SELECTION_TOOL::RemoveItemsFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), PL_SELECTION_TOOL::SelectionMenu(), SELECTION_TOOL::SelectionMenu(), EE_SELECTION_TOOL::SelectionMenu(), GERBVIEW_SELECTION_TOOL::SelectItem(), SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), SELECTION_TOOL::SelectItems(), SELECTION_TOOL::selectSheetContents(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SCH_DRAWING_TOOLS::SingleClickPlace(), CVPCB_CONTROL::ToggleFootprintFilter(), CVPCB_CONTROL::ToNA(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SCH_LINE_WIRE_BUS_TOOL::UnfoldBus(), GERBVIEW_SELECTION_TOOL::UnselectItem(), SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), SELECTION_TOOL::UnselectItems(), KICAD_MANAGER_CONTROL::UpdateMenu(), GERBVIEW_SELECTION_TOOL::UpdateMenu(), PL_SELECTION_TOOL::UpdateMenu(), EE_SELECTION_TOOL::UpdateMenu(), CVPCB_CONTROL::UpdateMenu(), SELECTION_TOOL::UpdateMenu(), ZONE_FILLER_TOOL::ZoneFill(), and COMMON_TOOLS::ZoomPreset().

◆ PassEvent()

bool TOOL_EVENT::PassEvent ( ) const
inline

These give a tool a method of informing the TOOL_MANAGER that a particular event should be passed on to subsequent tools on the stack.

Defaults to true for TC_MESSAGES; false for everything else.

Definition at line 255 of file tool_event.h.

255 { return m_passEvent; }
bool m_passEvent
Definition: tool_event.h:524

References m_passEvent.

Referenced by TOOL_MANAGER::dispatchInternal().

◆ Position()

const VECTOR2D TOOL_EVENT::Position ( ) const
inline

Returns mouse cursor position in world coordinates.

Definition at line 274 of file tool_event.h.

275  {
277  }
VECTOR2D returnCheckedPosition(const VECTOR2D &aPos) const
Ensure that the event is a type that has a position before returning a position, otherwise return a n...
Definition: tool_event.h:509
VECTOR2D m_mousePos
Current mouse cursor position
Definition: tool_event.h:532

References m_mousePos, and returnCheckedPosition().

Referenced by DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawZone(), ROUTER_TOOL::onViaCommand(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), and PNS::TOOL_BASE::updateStartItem().

◆ returnCheckedPosition()

VECTOR2D TOOL_EVENT::returnCheckedPosition ( const VECTOR2D aPos) const
inlineprivate

Ensure that the event is a type that has a position before returning a position, otherwise return a null-constructed position.

Used to defend the position accessors from runtime access when the event does not have a valid position.

Parameters
aPosthe position to return if the event is valid
Returns
the checked position

Definition at line 509 of file tool_event.h.

510  {
511  #ifdef WX_COMPATIBILITY
512  wxCHECK_MSG( HasPosition(), VECTOR2D(),
513  "Attempted to get position from non-position event" );
514  #else
515  assert( HasPosition() );
516  #endif
517 
518  return aPos;
519  }
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
bool HasPosition() const
Returns if it this event has a valid position (true for mouse events and context-menu or hotkey-based...
Definition: tool_event.h:260

References HasPosition().

Referenced by Delta(), DragOrigin(), and Position().

◆ SetFirstResponder()

void TOOL_EVENT::SetFirstResponder ( TOOL_BASE aTool)
inline

Definition at line 264 of file tool_event.h.

264 { m_firstResponder = aTool; }
TOOL_BASE * m_firstResponder
The first tool to receive the event
Definition: tool_event.h:550

References m_firstResponder.

◆ SetHasPosition()

void TOOL_EVENT::SetHasPosition ( bool  aHasPosition)
inline

Definition at line 261 of file tool_event.h.

261 { m_hasPosition = aHasPosition; }
bool m_hasPosition
Definition: tool_event.h:525

References m_hasPosition.

Referenced by TOOL_MANAGER::DispatchContextMenu(), PCB_EDIT_FRAME::DoShowBoardSetupDialog(), and EDA_BASE_FRAME::PopTool().

◆ setModifiers()

void TOOL_EVENT::setModifiers ( int  aMods)
inlineprivate

Definition at line 494 of file tool_event.h.

495  {
496  assert( ( aMods & ~MD_MODIFIER_MASK ) == 0 );
497  m_modifiers = aMods;
498  }
int m_modifiers
State of key modifierts (Ctrl/Alt/etc.)
Definition: tool_event.h:544

References m_modifiers, and MD_MODIFIER_MASK.

◆ setMouseButtons()

void TOOL_EVENT::setMouseButtons ( int  aButtons)
inlineprivate

Definition at line 488 of file tool_event.h.

489  {
490  assert( ( aButtons & ~BUT_BUTTON_MASK ) == 0 );
491  m_mouseButtons = aButtons;
492  }
int m_mouseButtons
State of mouse buttons
Definition: tool_event.h:538

References BUT_BUTTON_MASK, and m_mouseButtons.

Referenced by TOOL_EVENT().

◆ setMouseDelta()

void TOOL_EVENT::setMouseDelta ( const VECTOR2D aP)
inlineprivate

Definition at line 483 of file tool_event.h.

484  {
485  m_mouseDelta = aP;
486  }
VECTOR2D m_mouseDelta
Difference between mouse cursor position and the point where dragging event has started
Definition: tool_event.h:529

References m_mouseDelta.

◆ setMouseDragOrigin()

void TOOL_EVENT::setMouseDragOrigin ( const VECTOR2D aP)
inlineprivate

Definition at line 478 of file tool_event.h.

479  {
480  m_mouseDragOrigin = aP;
481  }
VECTOR2D m_mouseDragOrigin
Point where dragging has started
Definition: tool_event.h:535

References m_mouseDragOrigin.

◆ SetMousePosition()

void TOOL_EVENT::SetMousePosition ( const VECTOR2D aP)
inline

Definition at line 468 of file tool_event.h.

469  {
470  m_mousePos = aP;
471  }
VECTOR2D m_mousePos
Current mouse cursor position
Definition: tool_event.h:532

References m_mousePos.

Referenced by COMMON_TOOLS::CursorControl(), TOOL_MANAGER::invokeTool(), TOOL_MANAGER::PrimeTool(), and TOOL_MANAGER::RunAction().

◆ SetParameter()

template<typename T >
void TOOL_EVENT::SetParameter ( aParam)
inline

Function SetParameter() Sets a non-standard parameter assigned to the event.

Its meaning depends on the target tool.

Parameters
aParamis the new parameter.

Definition at line 453 of file tool_event.h.

454  {
455  m_param = (void*) aParam;
456  }
void * m_param
Generic parameter used for passing non-standard data.
Definition: tool_event.h:547

References m_param.

Referenced by EDIT_TOOL::cutToClipboard(), and TOOL_MANAGER::DispatchContextMenu().

◆ SetPassEvent()

void TOOL_EVENT::SetPassEvent ( )
inline

Definition at line 256 of file tool_event.h.

256 { m_passEvent = true; }
bool m_passEvent
Definition: tool_event.h:524

References m_passEvent.

Referenced by PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), and EDIT_TOOL::Move().

Friends And Related Function Documentation

◆ TOOL_DISPATCHER

friend class TOOL_DISPATCHER
friend

Definition at line 474 of file tool_event.h.

Member Data Documentation

◆ m_actions

◆ m_category

TOOL_EVENT_CATEGORY TOOL_EVENT::m_category
private

Definition at line 521 of file tool_event.h.

Referenced by Buttons(), Category(), Format(), init(), and Matches().

◆ m_commandId

OPT<int> TOOL_EVENT::m_commandId
private

◆ m_commandStr

OPT<std::string> TOOL_EVENT::m_commandStr
private

◆ m_firstResponder

TOOL_BASE* TOOL_EVENT::m_firstResponder
private

The first tool to receive the event

Definition at line 550 of file tool_event.h.

Referenced by FirstResponder(), and SetFirstResponder().

◆ m_hasPosition

bool TOOL_EVENT::m_hasPosition
private

Definition at line 525 of file tool_event.h.

Referenced by HasPosition(), init(), and SetHasPosition().

◆ m_keyCode

int TOOL_EVENT::m_keyCode
private

Stores code of pressed/released key

Definition at line 541 of file tool_event.h.

Referenced by Format(), KeyCode(), and TOOL_EVENT().

◆ m_modifiers

int TOOL_EVENT::m_modifiers
private

State of key modifierts (Ctrl/Alt/etc.)

Definition at line 544 of file tool_event.h.

Referenced by Format(), Modifier(), setModifiers(), and TOOL_EVENT().

◆ m_mouseButtons

int TOOL_EVENT::m_mouseButtons
private

State of mouse buttons

Definition at line 538 of file tool_event.h.

Referenced by Buttons(), Format(), IsClick(), IsDblClick(), IsDrag(), IsMouseUp(), and setMouseButtons().

◆ m_mouseDelta

VECTOR2D TOOL_EVENT::m_mouseDelta
private

Difference between mouse cursor position and the point where dragging event has started

Definition at line 529 of file tool_event.h.

Referenced by Delta(), and setMouseDelta().

◆ m_mouseDragOrigin

VECTOR2D TOOL_EVENT::m_mouseDragOrigin
private

Point where dragging has started

Definition at line 535 of file tool_event.h.

Referenced by DragOrigin(), and setMouseDragOrigin().

◆ m_mousePos

VECTOR2D TOOL_EVENT::m_mousePos
private

Current mouse cursor position

Definition at line 532 of file tool_event.h.

Referenced by Position(), and SetMousePosition().

◆ m_param

void* TOOL_EVENT::m_param
private

Generic parameter used for passing non-standard data.

Definition at line 547 of file tool_event.h.

Referenced by Parameter(), and SetParameter().

◆ m_passEvent

bool TOOL_EVENT::m_passEvent
private

Definition at line 524 of file tool_event.h.

Referenced by init(), PassEvent(), and SetPassEvent().

◆ m_scope

TOOL_ACTION_SCOPE TOOL_EVENT::m_scope
private

Definition at line 523 of file tool_event.h.


The documentation for this class was generated from the following files: