KiCad PCB EDA Suite
|
Generic, UI-independent tool event. More...
#include <tool_event.h>
Public Member Functions | |
const std::string | Format () const |
Return information about event in form of a human-readable string. | |
TOOL_EVENT (TOOL_EVENT_CATEGORY aCategory=TC_NONE, TOOL_ACTIONS aAction=TA_NONE, TOOL_ACTION_SCOPE aScope=AS_GLOBAL) | |
TOOL_EVENT (TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, int aExtraParam, TOOL_ACTION_SCOPE aScope=AS_GLOBAL) | |
TOOL_EVENT (TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, const std::string &aExtraParam, TOOL_ACTION_SCOPE aScope=AS_GLOBAL) | |
Returns the category (eg. mouse/keyboard/action) of an event.. | |
TOOL_EVENT_CATEGORY | Category () const |
Returns more specific information about the type of an event. | |
TOOL_ACTIONS | Action () 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. | |
bool | PassEvent () const |
void | SetPassEvent (bool aPass=true) |
Returns if it this event has a valid position (true for mouse events and context-menu or hotkey-based command events) | |
bool | HasPosition () const |
void | SetHasPosition (bool aHasPosition) |
Returns if the action associated with this event should be treated as immediate regardless of the current immediate action settings. | |
bool | ForceImmediate () const |
void | SetForceImmediate (bool aForceImmediate=true) |
TOOL_BASE * | FirstResponder () const |
void | SetFirstResponder (TOOL_BASE *aTool) |
Controls whether the tool is first being pushed to the stack or being reactivated after a pause. | |
bool | IsReactivate () const |
void | SetReactivate (bool aReactivate=true) |
void | SetSynchronous (std::atomic< SYNCRONOUS_TOOL_STATE > *aState) |
std::atomic< SYNCRONOUS_TOOL_STATE > * | SynchronousState () const |
void | SetCommit (COMMIT *aCommit) |
COMMIT * | Commit () const |
Returns information about difference between current mouse cursor position and the place where dragging has started. | |
const VECTOR2D | Delta () const |
Returns mouse cursor position in world coordinates. | |
const VECTOR2D | Position () const |
Returns the point where dragging has started. | |
const VECTOR2D | DragOrigin () const |
Returns information about mouse buttons state. | |
int | Buttons () const |
bool | IsClick (int aButtonMask=BUT_ANY) const |
bool | IsDblClick (int aButtonMask=BUT_ANY) const |
bool | IsDrag (int aButtonMask=BUT_ANY) const |
bool | IsMouseDown (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 |
Returns information about key modifiers state (Ctrl, Alt, etc.) | |
int | Modifier (int aMask=MD_MODIFIER_MASK) const |
bool | DisableGridSnapping () const |
int | KeyCode () const |
bool | IsKeyPressed () const |
bool | Matches (const TOOL_EVENT &aEvent) const |
Test whether two events match in terms of category & action or command. | |
bool | IsAction (const TOOL_ACTION *aAction) const |
Test if the event contains an action issued upon activation of the given TOOL_ACTION. | |
bool | IsCancelInteractive () const |
Indicate the event should restart/end an ongoing interactive tool's event loop (eg esc key, click cancel, start different tool). | |
bool | IsSelectionEvent () const |
Indicate an selection-changed notification event. | |
bool | IsPointEditor () const |
Indicate if the event is from one of the point editors. | |
bool | IsMoveTool () const |
Indicate if the event is from one of the move tools. | |
bool | IsEditorTool () const |
Indicate if the event is asking for an editor tool. | |
bool | IsSimulator () const |
Indicate if the event is from the simulator. | |
template<typename T , std::enable_if_t<!std::is_pointer< T >::value > * = nullptr> | |
T | Parameter () const |
Return a parameter assigned to the event. | |
template<typename T , std::enable_if_t< std::is_pointer< T >::value > * = nullptr> | |
T | Parameter () const |
Return pointer parameter assigned to the event. | |
template<typename T > | |
void | SetParameter (T aParam) |
Set a non-standard parameter assigned to the event. | |
std::optional< int > | GetCommandId () const |
void | SetMousePosition (const VECTOR2D &aP) |
void | SetActionGroup (const TOOL_ACTION_GROUP &aGroup) |
bool | IsActionInGroup (const TOOL_ACTION_GROUP &aGroup) const |
Private Member Functions | |
void | init () |
const std::string & | getCommandStr () const |
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. | |
Private Attributes | |
TOOL_EVENT_CATEGORY | m_category |
TOOL_ACTIONS | m_actions |
TOOL_ACTION_SCOPE | m_scope |
bool | m_passEvent |
bool | m_hasPosition |
bool | m_forceImmediate |
Optional group that the parent action for the event belongs to. | |
std::optional< TOOL_ACTION_GROUP > | m_actionGroup |
True when the tool is being re-activated from the stack. | |
bool | m_reactivate |
Difference between mouse cursor position and the point where dragging event has started. | |
VECTOR2D | m_mouseDelta |
Current mouse cursor position. | |
VECTOR2D | m_mousePos |
Point where dragging has started. | |
VECTOR2D | m_mouseDragOrigin |
State of mouse buttons. | |
int | m_mouseButtons |
Stores code of pressed/released key. | |
int | m_keyCode |
State of key modifiers (Ctrl/Alt/etc.) | |
int | m_modifiers |
std::atomic< SYNCRONOUS_TOOL_STATE > * | m_synchronousState |
COMMIT * | m_commit |
Commit the tool handling the event should add to. | |
std::any | m_param |
The first tool to receive the event. | |
TOOL_BASE * | m_firstResponder |
std::optional< int > | m_commandId |
std::string | m_commandStr |
Friends | |
class | TOOL_EVENT_LIST |
class | TOOL_DISPATCHER |
class | TOOL_MANAGER |
class | TOOLS_HOLDER |
Generic, UI-independent tool event.
Definition at line 166 of file tool_event.h.
|
inline |
Definition at line 176 of file tool_event.h.
References init().
|
inline |
Definition at line 191 of file tool_event.h.
References BUT_BUTTON_MASK, init(), m_commandId, m_keyCode, m_modifiers, MD_MODIFIER_MASK, setMouseButtons(), TC_COMMAND, TC_KEYBOARD, and TC_MOUSE.
|
inline |
Returns the category (eg. mouse/keyboard/action) of an event..
Definition at line 224 of file tool_event.h.
References init(), m_commandStr, TC_COMMAND, and TC_MESSAGE.
|
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 246 of file tool_event.h.
References m_actions.
Referenced by EDIT_TOOL::copyToClipboard(), TOOL_MANAGER::DispatchHotKey(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), and PL_EDIT_TOOL::Main().
|
inline |
Definition at line 297 of file tool_event.h.
References m_category, m_mouseButtons, and TC_MOUSE.
|
inline |
Returns more specific information about the type of an event.
Definition at line 243 of file tool_event.h.
References m_category.
Referenced by EDIT_TOOL::copyToClipboard(), TOOL_MANAGER::dispatchInternal(), EDIT_TOOL::doMoveSelection(), and ROUTER_TOOL::handleCommonEvents().
|
inline |
Returns information about difference between current mouse cursor position and the place where dragging has started.
Definition at line 275 of file tool_event.h.
References m_commit.
Referenced by EDIT_TOOL::Flip(), GENERATOR_TOOL::GenEditAction(), SCH_EDIT_TOOL::JustifyText(), EDIT_TOOL::JustifyText(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), EDIT_TOOL::Move(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), and EDIT_TOOL::Swap().
|
inline |
Returns mouse cursor position in world coordinates.
Definition at line 279 of file tool_event.h.
References m_mouseDelta, and returnCheckedPosition().
|
inline |
Definition at line 363 of file tool_event.h.
References MD_CTRL, and Modifier().
Referenced by EE_POINT_EDITOR::addCorner(), SCH_EDIT_TOOL::BreakWire(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), DRAWING_TOOL::DrawRectangle(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SCH_EDITOR_CONTROL::HighlightNet(), SCH_DRAWING_TOOLS::ImportGraphics(), SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::PlaceImportedGraphics(), PNS::TOOL_BASE::updateEndItem(), and PNS::TOOL_BASE::updateStartItem().
|
inline |
Returns information about mouse buttons state.
Definition at line 291 of file tool_event.h.
References m_mouseDragOrigin, and returnCheckedPosition().
Referenced by EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), and PNS::TOOL_BASE::updateEndItem().
|
inline |
Definition at line 264 of file tool_event.h.
References m_firstResponder.
Referenced by TOOL_MANAGER::dispatchInternal().
|
inline |
Definition at line 261 of file tool_event.h.
References m_forceImmediate.
Referenced by TOOL_MANAGER::processEvent().
const std::string TOOL_EVENT::Format | ( | ) | const |
Return information about event in form of a human-readable string.
Definition at line 97 of file tool_event.cpp.
References BUT_AUX1, BUT_AUX2, BUT_LEFT, BUT_MIDDLE, BUT_NONE, BUT_RIGHT, flag2string(), m_actionGroup, 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().
|
inline |
Definition at line 520 of file tool_event.h.
References m_commandId.
Referenced by SCH_MOVE_TOOL::doMoveSelection().
|
inlineprivate |
Definition at line 545 of file tool_event.h.
References m_commandStr.
Referenced by TOOL_MANAGER::dispatchActivation(), IsEditorTool(), IsMoveTool(), IsPointEditor(), IsSimulator(), Matches(), TOOLS_HOLDER::PopTool(), TOOL_MANAGER::processEvent(), and TOOLS_HOLDER::PushTool().
|
inline |
Definition at line 256 of file tool_event.h.
References m_hasPosition.
Referenced by SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawBezier(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawRuleArea(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SCH_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_DRAWING_TOOLS::DrawTable(), DRAWING_TOOL::DrawTable(), DRAWING_TOOL::DrawZone(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), DRAWING_TOOL::InteractivePlaceWithPreview(), ROUTER_TOOL::MainLoop(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), returnCheckedPosition(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and PNS::TOOL_BASE::updateStartItem().
|
private |
Definition at line 58 of file tool_event.cpp.
References IsActivate(), IsCancel(), IsCancelInteractive(), m_category, m_forceImmediate, m_hasPosition, m_passEvent, m_reactivate, TC_COMMAND, TC_MESSAGE, and TC_MOUSE.
Referenced by TOOL_EVENT().
bool TOOL_EVENT::IsAction | ( | const TOOL_ACTION * | aAction | ) | const |
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
aAction | is the TOOL_ACTION to be checked against. |
Definition at line 82 of file tool_event.cpp.
References TOOL_ACTION::MakeEvent(), and Matches().
Referenced by SYMBOL_EDITOR_CONTROL::AddLibrary(), PCB_CONTROL::AddLibrary(), SYMBOL_EDITOR_CONTROL::AddSymbol(), SCH_EDIT_TOOL::ChangeBodyStyle(), SCH_EDIT_TOOL::ChangeSymbols(), CONVERT_TOOL::CreatePolys(), SYMBOL_EDITOR_CONTROL::CutCopyDelete(), FOOTPRINT_EDITOR_CONTROL::CutCopyFootprint(), GERBVIEW_CONTROL::DisplayControl(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), EDIT_TOOL::Duplicate(), SYMBOL_EDITOR_CONTROL::DuplicateSymbol(), SCH_EDIT_TOOL::EditField(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), KICAD_MANAGER_CONTROL::Execute(), SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), SCH_FIND_REPLACE_TOOL::FindAndReplace(), SCH_FIND_REPLACE_TOOL::FindNext(), BOARD_EDITOR_CONTROL::FindNext(), GENERATOR_TOOL::GenEditAction(), BOARD_EDITOR_CONTROL::GenerateFabFiles(), ROUTER_TOOL::handleLayerSwitch(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::HighlightNet(), SCH_DRAWING_TOOLS::ImportSheet(), TOOL_EVT_UTILS::IsRotateToolEvt(), ZONE_FILLER_TOOL::IsZoneFillAction(), SCH_MOVE_TOOL::Main(), PL_EDIT_TOOL::Main(), PCB_PICKER_TOOL::Main(), EDIT_TOOL::Mirror(), SYMBOL_EDITOR_CONTROL::OnDeMorgan(), SCH_EDITOR_CONTROL::Paste(), PCB_CONTROL::Paste(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SYMBOL_EDITOR_PIN_TOOL::PushPinProperties(), SYMBOL_EDITOR_CONTROL::Save(), SIMULATOR_CONTROL::SaveWorkbook(), PCB_SELECTION_TOOL::selectNet(), SCH_EDIT_TOOL::SetAttribute(), COMMON_CONTROL::ShowHelp(), COMMON_CONTROL::ShowLibraryTable(), PCB_CONTROL::SnapMode(), PL_EDITOR_CONTROL::TitleBlockDisplayMode(), SCH_EDIT_TOOL::ToggleAttribute(), PCB_CONTROL::ToggleRatsnest(), EDA_3D_CONTROLLER::ToggleVisibility(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_EDIT_TOOL::UnsetAttribute(), SCH_FIND_REPLACE_TOOL::UpdateFind(), PCB_CONTROL::ZoneDisplayMode(), SIMULATOR_CONTROL::Zoom(), EDA_3D_CONTROLLER::ZoomInOut(), COMMON_TOOLS::ZoomInOut(), EDA_3D_CONTROLLER::ZoomInOutCenter(), and COMMON_TOOLS::ZoomInOutCenter().
bool TOOL_EVENT::IsActionInGroup | ( | const TOOL_ACTION_GROUP & | aGroup | ) | const |
Definition at line 88 of file tool_event.cpp.
References m_actionGroup.
Referenced by ROUTER_TOOL::handleLayerSwitch().
|
inline |
Definition at line 337 of file tool_event.h.
References m_actions, and TA_ACTIVATE.
Referenced by TOOL_MANAGER::dispatchActivation(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), init(), and PL_EDIT_TOOL::Main().
|
inline |
Definition at line 332 of file tool_event.h.
References m_actions, and TA_CANCEL_TOOL.
Referenced by init().
bool TOOL_EVENT::IsCancelInteractive | ( | ) | const |
Indicate the event should restart/end an ongoing interactive tool's event loop (eg esc key, click cancel, start different tool).
Definition at line 221 of file tool_event.cpp.
References ACTIONS::cancelInteractive, m_actions, m_commandId, m_commandStr, and TA_CANCEL_TOOL.
Referenced by EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), init(), and PL_EDIT_TOOL::Main().
|
inline |
Definition at line 347 of file tool_event.h.
References m_actions, and TA_CHOICE_MENU.
Referenced by TOOL_MANAGER::dispatchInternal().
bool TOOL_EVENT::IsClick | ( | int | aButtonMask = BUT_ANY | ) | const |
Definition at line 209 of file tool_event.cpp.
References m_actions, m_mouseButtons, and TA_MOUSE_CLICK.
Referenced by TOOL_MANAGER::DispatchContextMenu(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), and PL_EDIT_TOOL::Main().
bool TOOL_EVENT::IsDblClick | ( | int | aButtonMask = BUT_ANY | ) | const |
Definition at line 215 of file tool_event.cpp.
References m_actions, m_mouseButtons, and TA_MOUSE_DBLCLICK.
Referenced by EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), and SCH_MOVE_TOOL::doMoveSelection().
|
inline |
Definition at line 307 of file tool_event.h.
References m_actions, m_mouseButtons, and TA_MOUSE_DRAG.
Referenced by EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), and PNS::TOOL_BASE::updateEndItem().
bool TOOL_EVENT::IsEditorTool | ( | ) | const |
Indicate if the event is asking for an editor tool.
Used to allow deleting an element without de-activating the current tool.
Definition at line 251 of file tool_event.cpp.
References getCommandStr(), and m_commandStr.
|
inline |
Definition at line 373 of file tool_event.h.
References m_actions, and TA_KEY_PRESSED.
Referenced by ROUTER_TOOL::handleCommonEvents().
|
inline |
Definition at line 322 of file tool_event.h.
References m_actions, and TA_MOUSE_MOTION.
Referenced by EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), and PCB_POINT_EDITOR::updateEditedPoint().
|
inline |
Definition at line 327 of file tool_event.h.
|
inline |
Definition at line 312 of file tool_event.h.
References m_actions, m_mouseButtons, and TA_MOUSE_DOWN.
|
inline |
Definition at line 317 of file tool_event.h.
References m_actions, m_mouseButtons, and TA_MOUSE_UP.
Referenced by EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), and PL_EDIT_TOOL::Main().
bool TOOL_EVENT::IsMoveTool | ( | ) | const |
Indicate 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 245 of file tool_event.cpp.
References getCommandStr(), and m_commandStr.
bool TOOL_EVENT::IsPointEditor | ( | ) | const |
Indicate 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 238 of file tool_event.cpp.
References ACTIONS::activatePointEditor, getCommandStr(), m_commandId, and m_commandStr.
|
inline |
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition at line 352 of file tool_event.h.
|
inline |
Definition at line 268 of file tool_event.h.
References m_reactivate.
Referenced by SCH_DRAWING_TOOLS::ImportSheet(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().
bool TOOL_EVENT::IsSelectionEvent | ( | ) | const |
Indicate an selection-changed notification event.
Definition at line 229 of file tool_event.cpp.
References EVENTS::ClearedEvent, Matches(), EVENTS::PointSelectedEvent, EVENTS::SelectedEvent, and EVENTS::UnselectedEvent.
bool TOOL_EVENT::IsSimulator | ( | ) | const |
Indicate if the event is from the simulator.
Definition at line 257 of file tool_event.cpp.
References getCommandStr(), and m_commandStr.
Referenced by TOOL_MANAGER::PostEvent().
|
inline |
Definition at line 342 of file tool_event.h.
References m_actions, TA_UNDO_REDO_POST, and TA_UNDO_REDO_PRE.
|
inline |
Definition at line 368 of file tool_event.h.
References m_keyCode.
Referenced by TOOL_MANAGER::DispatchHotKey(), and ROUTER_TOOL::handleCommonEvents().
|
inline |
Test whether two events match in terms of category & action or command.
aEvent | is the event to test against. |
Definition at line 384 of file tool_event.h.
References getCommandStr(), m_actions, m_category, m_commandId, m_commandStr, TA_ANY, TA_NONE, TC_COMMAND, and TC_MESSAGE.
Referenced by SCH_EDIT_TOOL::BreakWire(), PCB_POINT_EDITOR::changeArcEditMode(), ALIGN_DISTRIBUTE_TOOL::DistributeItems(), BOARD_EDITOR_CONTROL::doCrossProbePcbToSch(), IsAction(), IsSelectionEvent(), SCH_EDIT_TOOL::JustifyText(), EDIT_TOOL::JustifyText(), SCH_EDIT_TOOL::Mirror(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), PCB_POINT_EDITOR::OnSelectionChange(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), ROUTER_TOOL::RouteSelected(), and SCH_FIND_REPLACE_TOOL::UpdateFind().
|
inline |
Definition at line 358 of file tool_event.h.
References m_modifiers.
Referenced by DisableGridSnapping(), TOOL_MANAGER::DispatchHotKey(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PICKER_TOOL::Main(), PNS::TOOL_BASE::updateEndItem(), and PNS::TOOL_BASE::updateStartItem().
|
inline |
Return a parameter assigned to the event.
Its meaning depends on the target tool.
Definition at line 460 of file tool_event.h.
Referenced by EMBED_TOOL::AddFile(), SELECTION_TOOL::AddItemsToSel(), SELECTION_TOOL::AddItemToSel(), MICROWAVE_TOOL::addMicrowaveFootprint(), PCB_POINT_EDITOR::changeArcEditMode(), CVPCB_CONTROL::ChangeFocus(), SCH_EDITOR_CONTROL::ChangeLineMode(), ROUTER_TOOL::ChangeRouterMode(), SCH_NAVIGATE_TOOL::ChangeSheet(), SCH_EDIT_TOOL::ChangeTextType(), SYMBOL_EDITOR_CONTROL::ChangeUnit(), COMMON_TOOLS::CursorControl(), PCB_SELECTION_TOOL::CursorSelection(), SYMBOL_EDITOR_CONTROL::DdAddLibrary(), PCB_CONTROL::DdAddLibrary(), PCB_CONTROL::DdAppendBoard(), SCH_EDIT_TOOL::DdAppendFile(), PCB_CONTROL::DdImportFootprint(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), KICAD_MANAGER_CONTROL::Execute(), GENERATOR_TOOL::GenEditAction(), TOOL_EVT_UTILS::GetEventRotationAngle(), PCB_CONTROL::GridPlaceOrigin(), COMMON_TOOLS::GridPreset(), GROUP_TOOL::GroupProperties(), ROUTER_TOOL::handleLayerSwitch(), BOARD_INSPECTION_TOOL::HideNetInRatsnest(), BOARD_INSPECTION_TOOL::HighlightItem(), BOARD_INSPECTION_TOOL::HighlightNet(), SCH_DRAWING_TOOLS::ImportSheet(), SCH_EDIT_TOOL::Increment(), SYMBOL_EDITOR_EDIT_TOOL::Increment(), EDIT_TOOL::Increment(), ROUTER_TOOL::InlineDrag(), PCB_CONTROL::LayerSwitch(), GERBVIEW_CONTROL::LoadGerbFiles(), KICAD_MANAGER_CONTROL::LoadProject(), GERBVIEW_CONTROL::LoadZipfile(), SCH_MOVE_TOOL::Main(), PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), EDA_3D_CONTROLLER::On3DGridSelection(), EDA_3D_CONTROLLER::PanControl(), COMMON_TOOLS::PanControl(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceNextSymbolUnit(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceTuningPattern(), GENERATOR_TOOL::RegenerateAllOfType(), GENERATOR_TOOL::RegenerateItem(), EDIT_TOOL::Remove(), EMBED_TOOL::RemoveFile(), SELECTION_TOOL::RemoveItemFromSel(), SELECTION_TOOL::RemoveItemsFromSel(), BOARD_EDITOR_CONTROL::RepairBoard(), SCH_EDITOR_CONTROL::RepairSchematic(), SELECTION_TOOL::ReselectItem(), EDA_3D_CONTROLLER::RotateView(), ROUTER_TOOL::RouteSelected(), SELECTION_TOOL::SelectionMenu(), GERBVIEW_SELECTION_TOOL::SelectItem(), PCB_PICKER_TOOL::SelectItemInteractively(), GERBVIEW_SELECTION_TOOL::SelectItems(), PCB_SELECTION_TOOL::selectNet(), PCB_PICKER_TOOL::SelectPointInteractively(), PCB_SELECTION_TOOL::selectSheetContents(), EDA_3D_CONTROLLER::SetMaterial(), BOARD_INSPECTION_TOOL::ShowNetInRatsnest(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SCH_DRAWING_TOOLS::SingleClickPlace(), COMMON_TOOLS::SwitchUnits(), PCB_SELECTION_TOOL::syncSelection(), PCB_SELECTION_TOOL::syncSelectionWithNets(), CVPCB_CONTROL::ToggleFootprintFilter(), CVPCB_CONTROL::ToNA(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_LINE_WIRE_BUS_TOOL::UnfoldBus(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), BOARD_INSPECTION_TOOL::UpdateLocalRatsnest(), EDA_3D_CONTROLLER::UpdateMenu(), CVPCB_CONTROL::UpdateMenu(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::UpdateMenu(), SELECTION_TOOL::UpdateMenu(), KICAD_MANAGER_CONTROL::UpdateMenu(), EDA_3D_CONTROLLER::ViewControl(), KICAD_MANAGER_CONTROL::ViewDroppedViewers(), ZONE_FILLER_TOOL::ZoneFill(), and COMMON_TOOLS::ZoomPreset().
|
inline |
Return pointer parameter assigned to the event.
Its meaning depends on the target tool.
Definition at line 486 of file tool_event.h.
|
inline |
Definition at line 251 of file tool_event.h.
References m_passEvent.
Referenced by TOOL_MANAGER::dispatchInternal().
|
inline |
Returns the point where dragging has started.
Definition at line 285 of file tool_event.h.
References m_mousePos, and returnCheckedPosition().
Referenced by EE_SELECTION_TOOL::autostartEvent(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawBezier(), DRAWING_TOOL::DrawDimension(), SCH_DRAWING_TOOLS::DrawRuleArea(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SCH_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_DRAWING_TOOLS::DrawTable(), DRAWING_TOOL::DrawTable(), DRAWING_TOOL::DrawZone(), DRAWING_TOOL::InteractivePlaceWithPreview(), ROUTER_TOOL::MainLoop(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), and PNS::TOOL_BASE::updateStartItem().
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.
aPos | the position to return if the event is valid |
Definition at line 74 of file tool_event.cpp.
References HasPosition().
Referenced by Delta(), DragOrigin(), and Position().
|
inline |
Definition at line 530 of file tool_event.h.
References m_actionGroup.
Referenced by TOOL_ACTION::MakeEvent().
|
inline |
Definition at line 274 of file tool_event.h.
References m_commit.
|
inline |
Controls whether the tool is first being pushed to the stack or being reactivated after a pause.
Definition at line 265 of file tool_event.h.
References m_firstResponder.
Referenced by TOOL_MANAGER::dispatchInternal().
|
inline |
Definition at line 262 of file tool_event.h.
References m_forceImmediate.
|
inline |
Returns if the action associated with this event should be treated as immediate regardless of the current immediate action settings.
Definition at line 257 of file tool_event.h.
References m_hasPosition.
Referenced by TOOL_MANAGER::DispatchContextMenu(), PANEL_KICAD_LAUNCHER::onLauncherButtonClick(), ACTION_TOOLBAR::onPaletteEvent(), TOOLS_HOLDER::PopTool(), TOOL_MANAGER::processEvent(), and PCB_EDIT_FRAME::ShowBoardSetupDialog().
|
inlineprivate |
Definition at line 563 of file tool_event.h.
References m_modifiers, and MD_MODIFIER_MASK.
|
inlineprivate |
Definition at line 557 of file tool_event.h.
References BUT_BUTTON_MASK, and m_mouseButtons.
Referenced by TOOL_EVENT().
|
inlineprivate |
Definition at line 552 of file tool_event.h.
References m_mouseDelta.
|
inlineprivate |
Definition at line 547 of file tool_event.h.
References m_mouseDragOrigin.
|
inline |
Definition at line 525 of file tool_event.h.
References m_mousePos.
Referenced by COMMON_TOOLS::CursorControl(), TOOL_MANAGER::invokeTool(), and TOOL_MANAGER::PrimeTool().
|
inline |
Set a non-standard parameter assigned to the event.
Its meaning depends on the target tool.
aParam | is the new parameter. |
Definition at line 515 of file tool_event.h.
References m_param.
Referenced by COMMON_TOOLS::CursorControl(), EDIT_TOOL::cutToClipboard(), TOOL_MANAGER::DispatchContextMenu(), and TOOL_ACTION::MakeEvent().
|
inline |
Returns if it this event has a valid position (true for mouse events and context-menu or hotkey-based command events)
Definition at line 252 of file tool_event.h.
References m_passEvent.
Referenced by EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), ROUTER_TOOL::handleCommonEvents(), and PL_EDIT_TOOL::Main().
|
inline |
Definition at line 269 of file tool_event.h.
References m_reactivate.
Referenced by TOOLS_HOLDER::PopTool().
|
inline |
Definition at line 271 of file tool_event.h.
References m_synchronousState.
|
inline |
Definition at line 272 of file tool_event.h.
References m_synchronousState.
Referenced by SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), and EDIT_TOOL::Move().
|
friend |
Definition at line 539 of file tool_event.h.
|
friend |
Definition at line 538 of file tool_event.h.
|
friend |
Definition at line 540 of file tool_event.h.
|
friend |
Definition at line 541 of file tool_event.h.
|
private |
True when the tool is being re-activated from the stack.
Definition at line 590 of file tool_event.h.
Referenced by Format(), IsActionInGroup(), and SetActionGroup().
|
private |
Definition at line 582 of file tool_event.h.
Referenced by Action(), Format(), IsActivate(), IsCancel(), IsCancelInteractive(), IsChoiceMenu(), IsClick(), IsDblClick(), IsDrag(), IsKeyPressed(), IsMotion(), IsMouseAction(), IsMouseDown(), IsMouseUp(), IsPrime(), IsUndoRedo(), and Matches().
|
private |
Definition at line 581 of file tool_event.h.
Referenced by Buttons(), Category(), Format(), init(), and Matches().
|
private |
Definition at line 625 of file tool_event.h.
Referenced by Format(), GetCommandId(), IsCancelInteractive(), IsPointEditor(), Matches(), and TOOL_EVENT().
|
private |
Definition at line 626 of file tool_event.h.
Referenced by Format(), getCommandStr(), IsCancelInteractive(), IsEditorTool(), IsMoveTool(), IsPointEditor(), IsSimulator(), Matches(), and TOOL_EVENT().
|
private |
Commit the tool handling the event should add to.
Generic parameter used for passing non-standard data.
Definition at line 617 of file tool_event.h.
Referenced by Commit(), and SetCommit().
|
private |
Definition at line 623 of file tool_event.h.
Referenced by FirstResponder(), and SetFirstResponder().
|
private |
Optional group that the parent action for the event belongs to.
Definition at line 586 of file tool_event.h.
Referenced by ForceImmediate(), init(), and SetForceImmediate().
|
private |
Definition at line 585 of file tool_event.h.
Referenced by HasPosition(), init(), and SetHasPosition().
|
private |
State of key modifiers (Ctrl/Alt/etc.)
Definition at line 609 of file tool_event.h.
Referenced by Format(), KeyCode(), and TOOL_EVENT().
|
private |
Definition at line 612 of file tool_event.h.
Referenced by Format(), Modifier(), setModifiers(), and TOOL_EVENT().
|
private |
Stores code of pressed/released key.
Definition at line 606 of file tool_event.h.
Referenced by Buttons(), Format(), IsClick(), IsDblClick(), IsDrag(), IsMouseDown(), IsMouseUp(), and setMouseButtons().
|
private |
Current mouse cursor position.
Definition at line 597 of file tool_event.h.
Referenced by Delta(), and setMouseDelta().
|
private |
State of mouse buttons.
Definition at line 603 of file tool_event.h.
Referenced by DragOrigin(), and setMouseDragOrigin().
|
private |
Point where dragging has started.
Definition at line 600 of file tool_event.h.
Referenced by Position(), and SetMousePosition().
|
private |
The first tool to receive the event.
Definition at line 620 of file tool_event.h.
Referenced by Parameter(), and SetParameter().
|
private |
Definition at line 584 of file tool_event.h.
Referenced by init(), PassEvent(), and SetPassEvent().
|
private |
Difference between mouse cursor position and the point where dragging event has started.
Definition at line 593 of file tool_event.h.
Referenced by init(), IsReactivate(), and SetReactivate().
|
private |
Definition at line 583 of file tool_event.h.
|
private |
Definition at line 614 of file tool_event.h.
Referenced by SetSynchronous(), and SynchronousState().