40 m_frame = getEditFrame<EDA_DRAW_FRAME>();
46 ctxMenu.AddSeparator( 1 );
60 std::string tool = *aEvent.
Parameter<std::string*>();
74 if( evt->IsCancelInteractive() || evt->IsActivate() )
82 catch( std::exception& e )
84 std::cerr <<
"PICKER_TOOL cancel handler error: " << e.what() << std::endl;
90 if( evt->IsActivate() )
100 bool getNext =
false;
108 getNext = (*m_clickHandler)( *m_picked );
110 catch( std::exception& e )
112 std::cerr <<
"PICKER_TOOL click handler error: " << e.what() << std::endl;
127 else if( evt->IsMotion() )
133 (*m_motionHandler)( cursorPos );
135 catch( std::exception& e )
137 std::cerr <<
"PICKER_TOOL motion handler error: " << e.what() << std::endl;
160 (*m_finalizeHandler)( finalize_state );
162 catch( std::exception& e )
164 std::cerr <<
"PICKER_TOOL finalize handler error: " << e.what() << std::endl;
183 m_cursor = wxStockCursor( wxCURSOR_ARROW );
static bool ShowAlways(const SELECTION &aSelection)
Function ShowAlways The default condition function (always returns true).
void AddStandardSubMenus(TOOL_MENU &aMenu)
Function CreateBasicMenu.
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
void SetCurrentCursor(wxStockCursor aStockCursorID)
Function SetCurrentCursor Set the current cursor shape for this panel.
VIEW_CONTROLS class definition.
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
static TOOL_ACTION cancelInteractive
static TOOL_ACTION pickerTool
virtual void CaptureCursor(bool aEnabled)
Function CaptureCursor() Forces the cursor to stay within the drawing panel area.
Class VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (...
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Function ForceCursorPosition() Places the cursor immediately at a given point.
virtual void SetAutoPan(bool aEnabled)
Function SetAutoPan Turns on/off auto panning (this feature is used when there is a tool active (eg.
bool IsType(FRAME_T aType) const
virtual void PopTool(const std::string &actionName)
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.