|
KiCad PCB EDA Suite
|
#include <picker_tool.h>
Public Types | |
| enum | pickerEndState { WAIT_CANCEL , CLICK_CANCEL , END_ACTIVATE , EVT_CANCEL , EXCEPTION_CANCEL } |
| typedef std::function< bool(const VECTOR2D &)> | CLICK_HANDLER |
| Event handler types. | |
| typedef std::function< void(const VECTOR2D &)> | MOTION_HANDLER |
| typedef std::function< void(void)> | CANCEL_HANDLER |
| typedef std::function< void(const int &)> | FINALIZE_HANDLER |
| typedef std::function< bool(void)> | AREA_HANDLER |
| Called once a rubber-band drag has left its result in the selection. | |
Public Member Functions | |
| PICKER_TOOL_BASE () | |
| virtual | ~PICKER_TOOL_BASE ()=default |
| void | SetCursor (KICURSOR aCursor) |
| void | SetSnapping (bool aSnap) |
| void | ClearHandlers () |
| void | SetClickHandler (CLICK_HANDLER aHandler) |
| Set a handler for mouse click event. | |
| void | SetMotionHandler (MOTION_HANDLER aHandler) |
| Set a handler for mouse motion. | |
| void | SetAreaHandler (AREA_HANDLER aHandler) |
| Set a handler for a rubber-band drag. | |
| void | SetCancelHandler (CANCEL_HANDLER aHandler) |
| Set a handler for cancel events (ESC or context-menu Cancel). | |
| void | SetFinalizeHandler (FINALIZE_HANDLER aHandler) |
| Set a handler for the finalize event. | |
| int | CurrentModifiers () const |
Protected Member Functions | |
| virtual void | reset () |
| Reinitializes tool to its initial state. | |
Protected Attributes | |
| EDA_DRAW_FRAME * | m_frame |
| KICURSOR | m_cursor |
| bool | m_snap |
| int | m_modifiers |
| std::optional< CLICK_HANDLER > | m_clickHandler |
| std::optional< MOTION_HANDLER > | m_motionHandler |
| std::optional< AREA_HANDLER > | m_areaHandler |
| std::optional< CANCEL_HANDLER > | m_cancelHandler |
| std::optional< FINALIZE_HANDLER > | m_finalizeHandler |
| std::optional< VECTOR2D > | m_picked |
Definition at line 32 of file picker_tool.h.
| typedef std::function<bool(void)> PICKER_TOOL_BASE::AREA_HANDLER |
Called once a rubber-band drag has left its result in the selection.
Definition at line 42 of file picker_tool.h.
| typedef std::function<void(void)> PICKER_TOOL_BASE::CANCEL_HANDLER |
Definition at line 38 of file picker_tool.h.
| typedef std::function<bool(const VECTOR2D&)> PICKER_TOOL_BASE::CLICK_HANDLER |
Event handler types.
Definition at line 36 of file picker_tool.h.
| typedef std::function<void(const int&)> PICKER_TOOL_BASE::FINALIZE_HANDLER |
Definition at line 39 of file picker_tool.h.
| typedef std::function<void(const VECTOR2D&)> PICKER_TOOL_BASE::MOTION_HANDLER |
Definition at line 37 of file picker_tool.h.
| Enumerator | |
|---|---|
| WAIT_CANCEL | |
| CLICK_CANCEL | |
| END_ACTIVATE | |
| EVT_CANCEL | |
| EXCEPTION_CANCEL | |
Definition at line 44 of file picker_tool.h.
|
inline |
Definition at line 53 of file picker_tool.h.
References m_frame, m_modifiers, m_snap, and reset().
Referenced by PCB_PICKER_TOOL::PCB_PICKER_TOOL(), PICKER_TOOL::PICKER_TOOL(), and PICKER_TOOL::PICKER_TOOL().
|
virtualdefault |
|
inline |
Definition at line 67 of file picker_tool.h.
References m_areaHandler, m_cancelHandler, m_clickHandler, m_finalizeHandler, and m_motionHandler.
Referenced by PCB_PICKER_TOOL::ClearHandlers(), SCH_EDITOR_CONTROL::HighlightNetCursor(), SCH_TOOL_BASE< T >::InteractiveDelete(), SCH_EDITOR_CONTROL::SimProbe(), and SCH_EDITOR_CONTROL::SimTune().
|
inline |
Definition at line 130 of file picker_tool.h.
References m_modifiers.
Referenced by PCB_PICKER_TOOL::SelectPointInteractively().
|
protectedvirtual |
Reinitializes tool to its initial state.
Reimplemented in PCB_PICKER_TOOL.
Definition at line 28 of file picker_tool.cpp.
References ARROW, m_areaHandler, m_cancelHandler, m_clickHandler, m_cursor, m_finalizeHandler, m_motionHandler, m_picked, and m_snap.
Referenced by PICKER_TOOL::Main(), PICKER_TOOL_BASE(), and PCB_PICKER_TOOL::reset().
|
inline |
Set a handler for a rubber-band drag.
The picker otherwise swallows it.
The drag runs the selection tool's own area loop, so the selection already holds what the box caught. Return true to stay armed, as with the click handler.
Definition at line 104 of file picker_tool.h.
References m_areaHandler.
Referenced by MATCH_PROPERTIES_TOOL::runInteractive().
|
inline |
Set a handler for cancel events (ESC or context-menu Cancel).
Definition at line 113 of file picker_tool.h.
References m_cancelHandler.
Referenced by EDIT_TOOL::pickReferencePoint(), GRAPHIC_EDIT_TOOL::runInteractive(), MATCH_PROPERTIES_TOOL::runInteractive(), PCB_PICKER_TOOL::SelectItemInteractively(), and PCB_PICKER_TOOL::SelectPointInteractively().
|
inline |
Set a handler for mouse click event.
The handler may decide to receive further click by returning true.
Definition at line 81 of file picker_tool.h.
References m_clickHandler.
Referenced by CONSTRAINT_EDIT_TOOL::AddPointConstraint(), BOARD_EDITOR_CONTROL::DrillOrigin(), PCB_CONTROL::GridPlaceOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_CONTROL::InteractiveDelete(), PL_EDIT_TOOL::InteractiveDelete(), SCH_TOOL_BASE< T >::InteractiveDelete(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), CONSTRAINT_EDIT_TOOL::pickLinearConstraint(), EDIT_TOOL::pickReferencePoint(), CONSTRAINT_EDIT_TOOL::pickShapeConstraint(), GRAPHIC_EDIT_TOOL::runInteractive(), MATCH_PROPERTIES_TOOL::runInteractive(), PCB_PICKER_TOOL::SelectItemInteractively(), PCB_PICKER_TOOL::SelectPointInteractively(), SCH_EDITOR_CONTROL::SimProbe(), and SCH_EDITOR_CONTROL::SimTune().
|
inline |
Definition at line 63 of file picker_tool.h.
References m_cursor.
Referenced by CONSTRAINT_EDIT_TOOL::AddPointConstraint(), BOARD_EDITOR_CONTROL::DrillOrigin(), PCB_CONTROL::GridPlaceOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_CONTROL::InteractiveDelete(), PL_EDIT_TOOL::InteractiveDelete(), SCH_TOOL_BASE< T >::InteractiveDelete(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), CONSTRAINT_EDIT_TOOL::pickLinearConstraint(), EDIT_TOOL::pickReferencePoint(), CONSTRAINT_EDIT_TOOL::pickShapeConstraint(), GRAPHIC_EDIT_TOOL::runInteractive(), MATCH_PROPERTIES_TOOL::runInteractive(), PCB_PICKER_TOOL::SelectItemInteractively(), PCB_PICKER_TOOL::SelectPointInteractively(), SCH_EDITOR_CONTROL::SimProbe(), and SCH_EDITOR_CONTROL::SimTune().
|
inline |
Set a handler for the finalize event.
Takes the state of the exit from the main loop.
Definition at line 124 of file picker_tool.h.
References m_finalizeHandler.
Referenced by CONSTRAINT_EDIT_TOOL::AddPointConstraint(), PCB_CONTROL::InteractiveDelete(), PL_EDIT_TOOL::InteractiveDelete(), SCH_TOOL_BASE< T >::InteractiveDelete(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), CONSTRAINT_EDIT_TOOL::pickLinearConstraint(), EDIT_TOOL::pickReferencePoint(), CONSTRAINT_EDIT_TOOL::pickShapeConstraint(), GRAPHIC_EDIT_TOOL::runInteractive(), MATCH_PROPERTIES_TOOL::runInteractive(), PCB_PICKER_TOOL::SelectItemInteractively(), PCB_PICKER_TOOL::SelectPointInteractively(), SCH_EDITOR_CONTROL::SimProbe(), and SCH_EDITOR_CONTROL::SimTune().
|
inline |
Set a handler for mouse motion.
This is used for roll-over highlighting.
Definition at line 92 of file picker_tool.h.
References m_motionHandler.
Referenced by CONSTRAINT_EDIT_TOOL::AddPointConstraint(), PCB_CONTROL::InteractiveDelete(), PL_EDIT_TOOL::InteractiveDelete(), SCH_TOOL_BASE< T >::InteractiveDelete(), CONSTRAINT_EDIT_TOOL::pickLinearConstraint(), EDIT_TOOL::pickReferencePoint(), CONSTRAINT_EDIT_TOOL::pickShapeConstraint(), GRAPHIC_EDIT_TOOL::runInteractive(), MATCH_PROPERTIES_TOOL::runInteractive(), PCB_PICKER_TOOL::SelectItemInteractively(), PCB_PICKER_TOOL::SelectPointInteractively(), SCH_EDITOR_CONTROL::SimProbe(), and SCH_EDITOR_CONTROL::SimTune().
|
inline |
Definition at line 65 of file picker_tool.h.
References m_snap.
Referenced by CONSTRAINT_EDIT_TOOL::AddPointConstraint(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_CONTROL::InteractiveDelete(), SCH_TOOL_BASE< T >::InteractiveDelete(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), CONSTRAINT_EDIT_TOOL::pickLinearConstraint(), EDIT_TOOL::pickReferencePoint(), CONSTRAINT_EDIT_TOOL::pickShapeConstraint(), GRAPHIC_EDIT_TOOL::runInteractive(), MATCH_PROPERTIES_TOOL::runInteractive(), PCB_PICKER_TOOL::SelectItemInteractively(), PCB_PICKER_TOOL::SelectPointInteractively(), SCH_EDITOR_CONTROL::SimProbe(), and SCH_EDITOR_CONTROL::SimTune().
|
protected |
Definition at line 143 of file picker_tool.h.
Referenced by ClearHandlers(), PCB_PICKER_TOOL::Main(), reset(), and SetAreaHandler().
|
protected |
Definition at line 144 of file picker_tool.h.
Referenced by ClearHandlers(), PCB_PICKER_TOOL::Main(), PICKER_TOOL::Main(), reset(), and SetCancelHandler().
|
protected |
Definition at line 141 of file picker_tool.h.
Referenced by ClearHandlers(), PCB_PICKER_TOOL::Main(), PICKER_TOOL::Main(), reset(), and SetClickHandler().
|
protected |
Definition at line 137 of file picker_tool.h.
Referenced by PCB_PICKER_TOOL::Main(), PICKER_TOOL::Main(), reset(), and SetCursor().
|
protected |
Definition at line 145 of file picker_tool.h.
Referenced by ClearHandlers(), PCB_PICKER_TOOL::Main(), PICKER_TOOL::Main(), reset(), and SetFinalizeHandler().
|
protected |
Definition at line 136 of file picker_tool.h.
Referenced by PICKER_TOOL::Init(), PICKER_TOOL::Main(), and PICKER_TOOL_BASE().
|
protected |
Definition at line 139 of file picker_tool.h.
Referenced by CurrentModifiers(), PICKER_TOOL::Main(), and PICKER_TOOL_BASE().
|
protected |
Definition at line 142 of file picker_tool.h.
Referenced by ClearHandlers(), PCB_PICKER_TOOL::Main(), PICKER_TOOL::Main(), reset(), and SetMotionHandler().
|
protected |
Definition at line 147 of file picker_tool.h.
Referenced by PCB_PICKER_TOOL::Main(), PICKER_TOOL::Main(), and reset().
|
protected |
Definition at line 138 of file picker_tool.h.
Referenced by PCB_PICKER_TOOL::Main(), PICKER_TOOL::Main(), PICKER_TOOL_BASE(), reset(), and SetSnapping().