KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::VIEW_CONTROLS Class Referenceabstract

An interface for classes handling user events controlling the view behavior such as zooming, panning, mouse grab, etc. More...

#include <view_controls.h>

Inheritance diagram for KIGFX::VIEW_CONTROLS:
KIGFX::WX_VIEW_CONTROLS

Public Member Functions

 VIEW_CONTROLS (VIEW *aView)
 
virtual ~VIEW_CONTROLS ()
 
virtual void SetGrabMouse (bool aEnabled)
 Turn on/off mouse grabbing.
 
virtual void SetAutoPan (bool aEnabled)
 Turn on/off auto panning (this feature is used when there is a tool active (eg.
 
virtual void EnableAutoPan (bool aEnabled)
 Turn on/off auto panning (user setting to disable it entirely).
 
virtual void SetAutoPanSpeed (float aSpeed)
 Set the speed of autopanning.
 
virtual void SetAutoPanAcceleration (float aAcceleration)
 Set the speed of autopanning.
 
virtual void SetAutoPanMargin (float aMargin)
 Set the margin for autopanning (ie.
 
virtual void PinCursorInsideNonAutoscrollArea (bool aWarpMouseCursor)=0
 
virtual VECTOR2D GetMousePosition (bool aWorldCoordinates=true) const =0
 Return the current mouse pointer position.
 
VECTOR2D GetCursorPosition () const
 Return the current cursor position in world coordinates.
 
virtual VECTOR2D GetRawCursorPosition (bool aSnappingEnabled=true) const =0
 Return the current cursor position in world coordinates ignoring the cursorUp position force mode.
 
virtual VECTOR2D GetCursorPosition (bool aEnableSnapping) const =0
 Return the current cursor position in world coordinates.
 
virtual void ForceCursorPosition (bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
 Place the cursor immediately at a given point.
 
virtual void SetCursorPosition (const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false, long aArrowCommand=0)=0
 Move cursor to the requested position expressed in world coordinates.
 
virtual void SetCrossHairCursorPosition (const VECTOR2D &aPosition, bool aWarpView=true)=0
 Move the graphic crosshair cursor to the requested position expressed in world coordinates.
 
virtual void ShowCursor (bool aEnabled)
 Enable or disables display of cursor.
 
bool IsCursorShown () const
 Return true when cursor is visible.
 
virtual void CaptureCursor (bool aEnabled)
 Force the cursor to stay within the drawing panel area.
 
virtual void WarpMouseCursor (const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
 If enabled (.
 
void EnableCursorWarping (bool aEnable)
 Enable or disable warping the cursor.
 
bool IsCursorWarpingEnabled () const
 
virtual void CenterOnCursor ()=0
 Set the viewport center to the current cursor position and warps the cursor to the screen center.
 
virtual void Reset ()
 Restore the default VIEW_CONTROLS settings.
 
const VC_SETTINGSGetSettings () const
 Apply VIEW_CONTROLS settings from an object.
 
void ApplySettings (const VC_SETTINGS &aSettings)
 Load new settings from program common settings.
 
virtual void LoadSettings ()
 

Protected Attributes

VIEWm_view
 < Pointer to controlled VIEW.
 
bool m_cursorWarped
 Current VIEW_CONTROLS settings.
 
VC_SETTINGS m_settings
 

Detailed Description

An interface for classes handling user events controlling the view behavior such as zooming, panning, mouse grab, etc.

Definition at line 138 of file view_controls.h.

Constructor & Destructor Documentation

◆ VIEW_CONTROLS()

KIGFX::VIEW_CONTROLS::VIEW_CONTROLS ( VIEW aView)
inline

Definition at line 141 of file view_controls.h.

◆ ~VIEW_CONTROLS()

virtual KIGFX::VIEW_CONTROLS::~VIEW_CONTROLS ( )
inlinevirtual

Definition at line 147 of file view_controls.h.

Member Function Documentation

◆ ApplySettings()

◆ CaptureCursor()

◆ CenterOnCursor()

virtual void KIGFX::VIEW_CONTROLS::CenterOnCursor ( )
pure virtual

Set the viewport center to the current cursor position and warps the cursor to the screen center.

Implemented in KIGFX::WX_VIEW_CONTROLS.

Referenced by COMMON_TOOLS::doZoomToPreset(), SCH_BASE_FRAME::RedrawScreen(), and COMMON_TOOLS::ZoomCenter().

◆ EnableAutoPan()

virtual void KIGFX::VIEW_CONTROLS::EnableAutoPan ( bool  aEnabled)
inlinevirtual

Turn on/off auto panning (user setting to disable it entirely).

Parameters
aEnabledtells if the autopanning should be enabled.

Definition at line 178 of file view_controls.h.

◆ EnableCursorWarping()

void KIGFX::VIEW_CONTROLS::EnableCursorWarping ( bool  aEnable)
inline

Enable or disable warping the cursor.

Parameters
aEnableis true if the cursor is allowed to be warped.

Definition at line 349 of file view_controls.h.

◆ ForceCursorPosition()

virtual void KIGFX::VIEW_CONTROLS::ForceCursorPosition ( bool  aEnabled,
const VECTOR2D aPosition = VECTOR2D( 0, 0 ) 
)
inlinevirtual

Place the cursor immediately at a given point.

Mouse movement is ignored.

Note
The position is clamped if outside of coordinates representation limits.
Parameters
aEnabledenable forced cursor position
aPositionthe position (world coordinates).

Reimplemented in KIGFX::WX_VIEW_CONTROLS.

Definition at line 273 of file view_controls.h.

Referenced by ApplySettings(), EE_SELECTION_TOOL::autostartEvent(), TOOL_MANAGER::DispatchContextMenu(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawOneBezier(), SCH_DRAWING_TOOLS::DrawRuleArea(), SCH_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_DRAWING_TOOLS::DrawTable(), DRAWING_TOOL::DrawTable(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::finishInteractive(), SCH_DRAWING_TOOLS::ImportGraphics(), SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics(), SCH_DRAWING_TOOLS::ImportSheet(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EE_POINT_EDITOR::Main(), EE_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), PCB_POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PAD_TOOL::PlacePad(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::PlaceTuningPattern(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), ROUTER_TOOL::RouteSelected(), DRAWING_TOOL::SetAnchor(), EE_POINT_EDITOR::setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), PCB_POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), PNS::TOOL_BASE::updateEndItem(), and PNS::TOOL_BASE::updateStartItem().

◆ GetCursorPosition() [1/2]

VECTOR2D KIGFX::VIEW_CONTROLS::GetCursorPosition ( ) const
inline

Return the current cursor position in world coordinates.

Note
The position may be different from the mouse pointer position if snapping is enabled or cursor position is forced to a specific point.
The position is clamped if outside of coordinates representation limits.
Returns
The current cursor position in world coordinates.

Definition at line 239 of file view_controls.h.

Referenced by EE_POINT_EDITOR::addCorner(), PCB_POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SCH_EDIT_TOOL::BreakWire(), PCB_POINT_EDITOR::chamferCorner(), ZONE_CREATE_HELPER::createNewZone(), EDIT_TOOL::DeleteItems(), TOOL_MANAGER::DispatchContextMenu(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), PL_DRAWING_TOOLS::DrawShape(), PAD_TOOL::EnumeratePads(), TOOL_MANAGER::GetCursorPosition(), SCH_EDITOR_CONTROL::HighlightNet(), SCH_DRAWING_TOOLS::ImportGraphics(), SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), EE_POINT_EDITOR::Main(), EE_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), COMMON_TOOLS::OnGridChanged(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceReferenceImage(), DRAWING_TOOL::PlaceText(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), COMMON_TOOLS::ResetLocalCoords(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), EE_SELECTION_TOOL::SelectNode(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), ARC_POINT_EDIT_BEHAVIOR::UpdateItem(), PL_EDIT_TOOL::updateModificationPoint(), SCH_BASE_FRAME::UpdateStatusBar(), GERBVIEW_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), and PL_EDITOR_FRAME::UpdateStatusBar().

◆ GetCursorPosition() [2/2]

virtual VECTOR2D KIGFX::VIEW_CONTROLS::GetCursorPosition ( bool  aEnableSnapping) const
pure virtual

Return the current cursor position in world coordinates.

Note
The position may be different from the mouse pointer position if snapping is enabled or cursor position is forced to a specific point.
The position is clamped if outside of coordinates representation limits.
Parameters
aEnableSnappingselects whether cursor position should be snapped to the grid.
Returns
The current cursor position in world coordinates.

Implemented in KIGFX::WX_VIEW_CONTROLS, and KIGFX::WX_VIEW_CONTROLS.

◆ GetMousePosition()

virtual VECTOR2D KIGFX::VIEW_CONTROLS::GetMousePosition ( bool  aWorldCoordinates = true) const
pure virtual

Return the current mouse pointer position.

Note
The position may be different from the cursor position if snapping is enabled (
See also
GetCursorPosition()).
Note
The position is clamped if outside of coordinates representation limits.
Parameters
aWorldCoordinatesif true, the result is given in world coordinates, otherwise it is given in screen coordinates.
Returns
The current mouse pointer position in either world or screen coordinates.

Implemented in KIGFX::WX_VIEW_CONTROLS.

Referenced by TOOL_DISPATCHER::DispatchWxEvent(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawOneBezier(), SCH_DRAWING_TOOLS::DrawRuleArea(), SCH_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_DRAWING_TOOLS::DrawTable(), DRAWING_TOOL::DrawTable(), DRAWING_TOOL::DrawZone(), TOOL_MANAGER::GetMousePosition(), NL_SCHEMATIC_PLUGIN_IMPL::GetPointerPosition(), NL_GERBVIEW_PLUGIN_IMPL::GetPointerPosition(), NL_PL_EDITOR_PLUGIN_IMPL::GetPointerPosition(), NL_PCBNEW_PLUGIN_IMPL::GetPointerPosition(), SCH_DRAWING_TOOLS::ImportGraphics(), SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics(), SCH_DRAWING_TOOLS::ImportSheet(), SYMBOL_EDITOR_EDIT_TOOL::Increment(), EE_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::PlaceTuningPattern(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::SyncSheetsPins(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), PNS::TOOL_BASE::updateStartItem(), DIALOG_IMPORT_NETLIST::~DIALOG_IMPORT_NETLIST(), and DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB().

◆ GetRawCursorPosition()

virtual VECTOR2D KIGFX::VIEW_CONTROLS::GetRawCursorPosition ( bool  aSnappingEnabled = true) const
pure virtual

Return the current cursor position in world coordinates ignoring the cursorUp position force mode.

Returns
The current cursor position in world coordinates.

Implemented in KIGFX::WX_VIEW_CONTROLS.

Referenced by COMMON_TOOLS::CursorControl().

◆ GetSettings()

const VC_SETTINGS & KIGFX::VIEW_CONTROLS::GetSettings ( ) const
inline

◆ IsCursorShown()

bool VIEW_CONTROLS::IsCursorShown ( ) const

Return true when cursor is visible.

Returns
True if cursor is visible.

Definition at line 41 of file view_controls.cpp.

References m_settings, and KIGFX::VC_SETTINGS::m_showCursor.

◆ IsCursorWarpingEnabled()

bool KIGFX::VIEW_CONTROLS::IsCursorWarpingEnabled ( ) const
inline
Returns
the current setting for cursor warping.

Definition at line 357 of file view_controls.h.

Referenced by KIGFX::WX_VIEW_CONTROLS::onWheel().

◆ LoadSettings()

virtual void KIGFX::VIEW_CONTROLS::LoadSettings ( )
inlinevirtual

Reimplemented in KIGFX::WX_VIEW_CONTROLS.

Definition at line 383 of file view_controls.h.

Referenced by EDA_DRAW_FRAME::CommonSettingsChanged().

◆ PinCursorInsideNonAutoscrollArea()

◆ Reset()

void VIEW_CONTROLS::Reset ( )
virtual

Restore the default VIEW_CONTROLS settings.

Return the current VIEW_CONTROLS settings.

Definition at line 50 of file view_controls.cpp.

References ApplySettings(), and KIGFX::dummy().

◆ SetAutoPan()

virtual void KIGFX::VIEW_CONTROLS::SetAutoPan ( bool  aEnabled)
inlinevirtual

Turn on/off auto panning (this feature is used when there is a tool active (eg.

drawing a track) and user moves mouse to the VIEW edge - then the view can be translated or not).

Parameters
aEnabledtells if the autopanning should be active.

Definition at line 168 of file view_controls.h.

Referenced by ApplySettings(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawOneBezier(), SCH_DRAWING_TOOLS::DrawRuleArea(), SCH_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_DRAWING_TOOLS::DrawTable(), DRAWING_TOOL::DrawTable(), DRAWING_TOOL::DrawZone(), ROUTER_TOOL::finishInteractive(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), ROUTER_TOOL::InlineDrag(), EE_POINT_EDITOR::Main(), EE_SELECTION_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::PlaceTuningPattern(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), ROUTER_TOOL::prepareInteractive(), PCB_POINT_EDITOR::Reset(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), PCB_SELECTION_TOOL::selectTableCells(), EE_SELECTION_TOOL::selectTableCells(), DRAWING_TOOL::SetAnchor(), PICKER_TOOL::setControls(), PCB_PICKER_TOOL::setControls(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().

◆ SetAutoPanAcceleration()

virtual void KIGFX::VIEW_CONTROLS::SetAutoPanAcceleration ( float  aAcceleration)
inlinevirtual

Set the speed of autopanning.

Parameters
aSpeedis a new speed for autopanning.

Definition at line 198 of file view_controls.h.

◆ SetAutoPanMargin()

virtual void KIGFX::VIEW_CONTROLS::SetAutoPanMargin ( float  aMargin)
inlinevirtual

Set the margin for autopanning (ie.

the area when autopanning becomes active).

Parameters
aMarginis a new margin for autopanning.

Definition at line 208 of file view_controls.h.

Referenced by ApplySettings().

◆ SetAutoPanSpeed()

virtual void KIGFX::VIEW_CONTROLS::SetAutoPanSpeed ( float  aSpeed)
inlinevirtual

Set the speed of autopanning.

Parameters
aSpeedis a new speed for autopanning.

Definition at line 188 of file view_controls.h.

Referenced by ApplySettings().

◆ SetCrossHairCursorPosition()

virtual void KIGFX::VIEW_CONTROLS::SetCrossHairCursorPosition ( const VECTOR2D aPosition,
bool  aWarpView = true 
)
pure virtual

Move the graphic crosshair cursor to the requested position expressed in world coordinates.

Note
The position is clamped if outside of coordinates representation limits.
Parameters
aPositionis the requested cursor position in the world coordinates.
aWarpViewenables/disables view warp if the cursor is outside the current viewport.

Implemented in KIGFX::WX_VIEW_CONTROLS.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), EDA_DRAW_FRAME::FocusOnLocation(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), EE_SELECTION_TOOL::Main(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), COMMON_TOOLS::OnGridChanged(), DIALOG_MIGRATE_BUSES::onItemSelected(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), and SCH_DRAWING_TOOLS::SingleClickPlace().

◆ SetCursorPosition()

virtual void KIGFX::VIEW_CONTROLS::SetCursorPosition ( const VECTOR2D aPosition,
bool  aWarpView = true,
bool  aTriggeredByArrows = false,
long  aArrowCommand = 0 
)
pure virtual

Move cursor to the requested position expressed in world coordinates.

The position is not forced and will be overridden with the next mouse motion event. Mouse cursor follows the world cursor.

Note
The position is clamped if outside of coordinates representation limits.
Parameters
aPositionis the requested cursor position in the world coordinates.
aWarpViewenables/disables view warp if the cursor is outside the current viewport.

Implemented in KIGFX::WX_VIEW_CONTROLS.

Referenced by COMMON_TOOLS::CursorControl(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), ROUTER_TOOL::handleLayerSwitch(), ROUTER_TOOL::InlineDrag(), PL_EDIT_TOOL::Main(), PCB_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), DIALOG_IMPORT_NETLIST::~DIALOG_IMPORT_NETLIST(), and DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB().

◆ SetGrabMouse()

virtual void KIGFX::VIEW_CONTROLS::SetGrabMouse ( bool  aEnabled)
inlinevirtual

Turn on/off mouse grabbing.

When the mouse is grabbed, it cannot go outside the VIEW.

Parameters
aEnabledtells if mouse should be grabbed or not.

Definition at line 157 of file view_controls.h.

Referenced by ApplySettings().

◆ ShowCursor()

void VIEW_CONTROLS::ShowCursor ( bool  aEnabled)
virtual

Enable or disables display of cursor.

Parameters
aEnableddecides if the cursor should be shown.

Definition at line 34 of file view_controls.cpp.

References KIGFX::VIEW::GetGAL(), m_settings, KIGFX::VC_SETTINGS::m_showCursor, m_view, and KIGFX::GAL::SetCursorEnabled().

Referenced by ApplySettings(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), SCH_MOVE_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawOneBezier(), SCH_DRAWING_TOOLS::DrawRuleArea(), SCH_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_DRAWING_TOOLS::DrawTable(), DRAWING_TOOL::DrawTable(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), SCH_DRAWING_TOOLS::ImportGraphics(), SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics(), SCH_DRAWING_TOOLS::ImportSheet(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), EE_POINT_EDITOR::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::PlaceTuningPattern(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), ROUTER_TOOL::RouteSelected(), DRAWING_TOOL::SetAnchor(), EE_POINT_EDITOR::setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), PCB_POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().

◆ WarpMouseCursor()

virtual void KIGFX::VIEW_CONTROLS::WarpMouseCursor ( const VECTOR2D aPosition,
bool  aWorldCoordinates = false,
bool  aWarpView = false 
)
pure virtual

If enabled (.

See also
SetEnableCursorWarping(), warps the cursor to the specified position, expressed either in the screen coordinates or the world coordinates.
Note
The position is clamped if outside of coordinates representation limits.
Parameters
aPositionis the position where the cursor should be warped.
aWorldCoordinatesif true treats aPosition as the world coordinates, otherwise it uses it as the screen coordinates.
aWarpViewdetermines if the view can be warped too (only matters if the position is specified in the world coordinates and its not visible in the current viewport).

Implemented in KIGFX::WX_VIEW_CONTROLS.

Referenced by ZONE_CREATE_HELPER::createNewZone(), TOOL_MANAGER::DispatchContextMenu(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_DRAWING_TOOLS::DrawRuleArea(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawZone(), EE_SELECTION_TOOL::Main(), ROUTER_TOOL::performRouting(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().

Member Data Documentation

◆ m_cursorWarped

bool KIGFX::VIEW_CONTROLS::m_cursorWarped
protected

◆ m_settings

◆ m_view


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