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 |
Public Member Functions | |
PICKER_TOOL_BASE () | |
virtual | ~PICKER_TOOL_BASE ()=default |
void | SetCursor (KICURSOR aCursor) |
void | SetSnapping (bool aSnap) |
void | SetClickHandler (CLICK_HANDLER aHandler) |
Set a handler for mouse click event. | |
void | SetMotionHandler (MOTION_HANDLER aHandler) |
Set a handler for mouse motion. | |
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< CANCEL_HANDLER > | m_cancelHandler |
std::optional< FINALIZE_HANDLER > | m_finalizeHandler |
std::optional< VECTOR2D > | m_picked |
Definition at line 36 of file picker_tool.h.
typedef std::function<void(void)> PICKER_TOOL_BASE::CANCEL_HANDLER |
Definition at line 42 of file picker_tool.h.
typedef std::function<bool(const VECTOR2D&)> PICKER_TOOL_BASE::CLICK_HANDLER |
< Event handler types.
Definition at line 40 of file picker_tool.h.
typedef std::function<void(const int&)> PICKER_TOOL_BASE::FINALIZE_HANDLER |
Definition at line 43 of file picker_tool.h.
typedef std::function<void(const VECTOR2D&)> PICKER_TOOL_BASE::MOTION_HANDLER |
Definition at line 41 of file picker_tool.h.
Enumerator | |
---|---|
WAIT_CANCEL | |
CLICK_CANCEL | |
END_ACTIVATE | |
EVT_CANCEL | |
EXCEPTION_CANCEL |
Definition at line 45 of file picker_tool.h.
|
inline |
Definition at line 54 of file picker_tool.h.
References reset().
|
virtualdefault |
|
inline |
Definition at line 110 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 32 of file picker_tool.cpp.
References 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 cancel events (ESC or context-menu Cancel).
Definition at line 93 of file picker_tool.h.
References m_cancelHandler.
Referenced by EDIT_TOOL::pickReferencePoint(), 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 73 of file picker_tool.h.
References m_clickHandler.
Referenced by BOARD_EDITOR_CONTROL::DrillOrigin(), PCB_CONTROL::GridPlaceOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), SCH_EDIT_TOOL::InteractiveDelete(), SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete(), PL_EDIT_TOOL::InteractiveDelete(), PCB_CONTROL::InteractiveDelete(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), PCB_PICKER_TOOL::SelectItemInteractively(), PCB_PICKER_TOOL::SelectPointInteractively(), SCH_EDITOR_CONTROL::SimProbe(), and SCH_EDITOR_CONTROL::SimTune().
|
inline |
Definition at line 64 of file picker_tool.h.
References m_cursor.
Referenced by SCH_EDITOR_CONTROL::HighlightNetCursor(), SCH_EDIT_TOOL::InteractiveDelete(), SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete(), PL_EDIT_TOOL::InteractiveDelete(), PCB_CONTROL::InteractiveDelete(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), 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 104 of file picker_tool.h.
References m_finalizeHandler.
Referenced by SCH_EDIT_TOOL::InteractiveDelete(), SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete(), PL_EDIT_TOOL::InteractiveDelete(), PCB_CONTROL::InteractiveDelete(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), EDIT_TOOL::pickReferencePoint(), 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 84 of file picker_tool.h.
References m_motionHandler.
Referenced by SCH_EDIT_TOOL::InteractiveDelete(), SYMBOL_EDITOR_EDIT_TOOL::InteractiveDelete(), PL_EDIT_TOOL::InteractiveDelete(), PCB_CONTROL::InteractiveDelete(), EDIT_TOOL::pickReferencePoint(), PCB_PICKER_TOOL::SelectItemInteractively(), PCB_PICKER_TOOL::SelectPointInteractively(), SCH_EDITOR_CONTROL::SimProbe(), and SCH_EDITOR_CONTROL::SimTune().
|
inline |
Definition at line 66 of file picker_tool.h.
References m_snap.
Referenced by SCH_EDITOR_CONTROL::HighlightNetCursor(), SCH_EDIT_TOOL::InteractiveDelete(), EDIT_TOOL::pickReferencePoint(), SCH_EDITOR_CONTROL::SimProbe(), and SCH_EDITOR_CONTROL::SimTune().
|
protected |
Definition at line 123 of file picker_tool.h.
Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetCancelHandler().
|
protected |
Definition at line 121 of file picker_tool.h.
Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetClickHandler().
|
protected |
Definition at line 117 of file picker_tool.h.
Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetCursor().
|
protected |
Definition at line 124 of file picker_tool.h.
Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetFinalizeHandler().
|
protected |
Definition at line 116 of file picker_tool.h.
Referenced by PICKER_TOOL::Init(), and PICKER_TOOL::Main().
|
protected |
Definition at line 119 of file picker_tool.h.
Referenced by CurrentModifiers(), and PICKER_TOOL::Main().
|
protected |
Definition at line 122 of file picker_tool.h.
Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetMotionHandler().
|
protected |
Definition at line 126 of file picker_tool.h.
Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), and reset().
|
protected |
Definition at line 118 of file picker_tool.h.
Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetSnapping().