KiCad PCB EDA Suite
KIGFX::VIEW_CONTROLS Class Referenceabstract

Class VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (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 SetSnapping (bool aEnabled)
 Function SetSnapping() Enables/disables snapping cursor to grid. More...
 
virtual void SetGrabMouse (bool aEnabled)
 Function SetGrabMouse Turns on/off mouse grabbing. More...
 
virtual void SetAutoPan (bool aEnabled)
 Function SetAutoPan Turns on/off auto panning (this feature is used when there is a tool active (eg. More...
 
virtual void SetAutoPanSpeed (float aSpeed)
 Function SetAutoPanSpeed() Sets speed of autopanning. More...
 
virtual void SetAutoPanMargin (float aMargin)
 Function SetAutoPanMArgin() Sets margin for autopanning (ie. More...
 
virtual VECTOR2D GetMousePosition (bool aWorldCoordinates=true) const =0
 Function GetMousePosition() Returns the current mouse pointer position. More...
 
VECTOR2D GetCursorPosition () const
 Returns the current cursor position in world coordinates. More...
 
virtual VECTOR2D GetCursorPosition (bool aEnableSnapping) const =0
 Returns the current cursor position in world coordinates. More...
 
virtual void ForceCursorPosition (bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
 Function ForceCursorPosition() Places the cursor immediately at a given point. More...
 
virtual void SetCursorPosition (const VECTOR2D &aPosition, bool aWarpView=true)=0
 Moves cursor to the requested position expressed in world coordinates. More...
 
bool ForcedCursorPosition () const
 Function ForcedCursorPosition() Returns true if the current cursor position is forced to a specific location, ignoring the mouse cursor position. More...
 
virtual void ShowCursor (bool aEnabled)
 Function ShowCursor() Enables or disables display of cursor. More...
 
bool IsCursorShown () const
 Function IsCursorShown() Returns true when cursor is visible. More...
 
virtual void CaptureCursor (bool aEnabled)
 Function CaptureCursor() Forces the cursor to stay within the drawing panel area. More...
 
bool IsCursorPositionForced () const
 Function IsCursorPositionForced() Returns true if the cursor position is set by one of the tools. More...
 
virtual void WarpCursor (const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false) const =0
 Function WarpCursor() If enabled (. More...
 
void EnableCursorWarping (bool aEnable)
 Function EnableCursorWarping() Enables or disables warping the cursor. More...
 
bool IsCursorWarpingEnabled () const
 Function IsCursorWarpingEnabled() More...
 
virtual void EnableMousewheelPan (bool aEnable)
 Function EnableMousewheelPan() Enables or disables mousewheel panning. More...
 
virtual bool IsMousewheelPanEnabled () const
 Function IsMousewheelPanEnabled() More...
 
virtual void CenterOnCursor () const =0
 Function CenterOnCursor() Sets the viewport center to the current cursor position and warps the cursor to the screen center. More...
 
void SetAdditionalPanButtons (bool aLeft=false, bool aRight=false)
 
virtual void Reset ()
 Function Reset() Restores the default VIEW_CONTROLS settings. More...
 
const VC_SETTINGSGetSettings () const
 

Returns the current VIEW_CONTROLS settings

More...
 
void ApplySettings (const VC_SETTINGS &aSettings)
 

Applies VIEW_CONTROLS settings from an object

More...
 

Protected Attributes

VIEWm_view
 

Pointer to controlled VIEW.

More...
 
VC_SETTINGS m_settings
 

Current VIEW_CONTROLS settings

More...
 

Detailed Description

Class VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (such as zooming, panning, mouse grab, etc.)

Definition at line 100 of file view_controls.h.

Constructor & Destructor Documentation

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

Definition at line 103 of file view_controls.h.

103  : m_view( aView )
104  {
105  }
VIEW * m_view
Pointer to controlled VIEW.
virtual KIGFX::VIEW_CONTROLS::~VIEW_CONTROLS ( )
inlinevirtual

Definition at line 107 of file view_controls.h.

108  {
109  }

Member Function Documentation

void VIEW_CONTROLS::ApplySettings ( const VC_SETTINGS aSettings)

Applies VIEW_CONTROLS settings from an object

Definition at line 74 of file view_controls.cpp.

References CaptureCursor(), ForceCursorPosition(), KIGFX::VC_SETTINGS::m_autoPanEnabled, KIGFX::VC_SETTINGS::m_autoPanMargin, KIGFX::VC_SETTINGS::m_autoPanSpeed, KIGFX::VC_SETTINGS::m_cursorCaptured, KIGFX::VC_SETTINGS::m_forceCursorPosition, KIGFX::VC_SETTINGS::m_forcedPosition, KIGFX::VC_SETTINGS::m_grabMouse, KIGFX::VC_SETTINGS::m_showCursor, KIGFX::VC_SETTINGS::m_snappingEnabled, SetAutoPan(), SetAutoPanMargin(), SetAutoPanSpeed(), SetGrabMouse(), SetSnapping(), and ShowCursor().

Referenced by TOOL_MANAGER::applyViewControls(), TOOL_MANAGER::popViewControls(), and Reset().

75 {
76  ShowCursor( aSettings.m_showCursor );
77  CaptureCursor( aSettings.m_cursorCaptured );
78  SetSnapping( aSettings.m_snappingEnabled );
79  SetGrabMouse( aSettings.m_grabMouse );
80  SetAutoPan( aSettings.m_autoPanEnabled );
81  SetAutoPanMargin( aSettings.m_autoPanMargin );
82  SetAutoPanSpeed( aSettings.m_autoPanSpeed );
84 }
virtual void ShowCursor(bool aEnabled)
Function ShowCursor() Enables or disables display of cursor.
virtual void SetAutoPanSpeed(float aSpeed)
Function SetAutoPanSpeed() Sets speed of autopanning.
float m_autoPanSpeed
How fast is panning when in auto mode
Definition: view_controls.h:79
bool m_snappingEnabled
Should the cursor snap to grid or move freely
Definition: view_controls.h:67
bool m_grabMouse
Flag for grabbing the mouse cursor
Definition: view_controls.h:70
VECTOR2D m_forcedPosition
Forced cursor position (world coordinates)
Definition: view_controls.h:58
virtual void SetSnapping(bool aEnabled)
Function SetSnapping() Enables/disables snapping cursor to grid.
virtual void SetAutoPanMargin(float aMargin)
Function SetAutoPanMArgin() Sets margin for autopanning (ie.
bool m_forceCursorPosition
Is the forced cursor position enabled
Definition: view_controls.h:61
virtual void CaptureCursor(bool aEnabled)
Function CaptureCursor() Forces the cursor to stay within the drawing panel area. ...
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Function ForceCursorPosition() Places the cursor immediately at a given point.
float m_autoPanMargin
Distance from cursor to VIEW edge when panning is active
Definition: view_controls.h:76
bool m_autoPanEnabled
Flag for turning on autopanning
Definition: view_controls.h:73
virtual void SetAutoPan(bool aEnabled)
Function SetAutoPan Turns on/off auto panning (this feature is used when there is a tool active (eg...
bool m_showCursor
Flag determining the cursor visibility
Definition: view_controls.h:55
virtual void SetGrabMouse(bool aEnabled)
Function SetGrabMouse Turns on/off mouse grabbing.
bool m_cursorCaptured
Should the cursor be locked within the parent window area
Definition: view_controls.h:64
virtual void KIGFX::VIEW_CONTROLS::CaptureCursor ( bool  aEnabled)
inlinevirtual

Function CaptureCursor() Forces the cursor to stay within the drawing panel area.

Parameters
aEnableddetermines if the cursor should be captured.

Definition at line 246 of file view_controls.h.

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

Referenced by ApplySettings(), PCB_TOOL::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), EDIT_TOOL::MeasureTool(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::runPolygonEventLoop(), DRAWING_TOOL::SetAnchor(), and PICKER_TOOL::setControls().

247  {
248  m_settings.m_cursorCaptured = aEnabled;
249  }
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
bool m_cursorCaptured
Should the cursor be locked within the parent window area
Definition: view_controls.h:64
virtual void KIGFX::VIEW_CONTROLS::CenterOnCursor ( ) const
pure virtual

Function CenterOnCursor() Sets 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::ZoomCenter(), and COMMON_TOOLS::ZoomInOut().

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

Function EnableCursorWarping() Enables or disables warping the cursor.

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

Definition at line 279 of file view_controls.h.

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

Referenced by EDA_DRAW_PANEL::SetEnableZoomNoCenter(), and EDA_DRAW_FRAME::UseGalCanvas().

280  {
281  m_settings.m_warpCursor = aEnable;
282  }
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
bool m_warpCursor
If the cursor is allowed to be warped
Definition: view_controls.h:82
virtual void KIGFX::VIEW_CONTROLS::EnableMousewheelPan ( bool  aEnable)
inlinevirtual

Function EnableMousewheelPan() Enables or disables mousewheel panning.

Parameters
aEnableis true if mouse-wheel panning is enabled.

Definition at line 298 of file view_controls.h.

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

Referenced by EDA_DRAW_PANEL::SetEnableMousewheelPan(), and EDA_DRAW_FRAME::UseGalCanvas().

299  {
301  }
bool m_enableMousewheelPan
Mousewheel (2-finger touchpad) panning
Definition: view_controls.h:85
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
virtual void KIGFX::VIEW_CONTROLS::ForceCursorPosition ( bool  aEnabled,
const VECTOR2D aPosition = VECTOR2D( 0, 0 ) 
)
inlinevirtual

Function ForceCursorPosition() Places the cursor immediately at a given point.

Mouse movement is ignored.

Parameters
aEnabledenable forced cursor position
aPositionthe position (world coordinates).

Definition at line 202 of file view_controls.h.

References KIGFX::VC_SETTINGS::m_forceCursorPosition, KIGFX::VC_SETTINGS::m_forcedPosition, and m_settings.

Referenced by ApplySettings(), TOOL_MANAGER::dispatchContextMenu(), SELECTION_TOOL::findMove(), ROUTER_TOOL::finishInteractive(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::Main(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), ROUTER_TOOL::prepareInteractive(), POINT_EDITOR::setEditedPoint(), PNS::TOOL_BASE::updateEndItem(), and PNS::TOOL_BASE::updateStartItem().

203  {
205  m_settings.m_forcedPosition = aPosition;
206  }
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
VECTOR2D m_forcedPosition
Forced cursor position (world coordinates)
Definition: view_controls.h:58
bool m_forceCursorPosition
Is the forced cursor position enabled
Definition: view_controls.h:61
bool KIGFX::VIEW_CONTROLS::ForcedCursorPosition ( ) const
inline

Function ForcedCursorPosition() Returns true if the current cursor position is forced to a specific location, ignoring the mouse cursor position.

Definition at line 222 of file view_controls.h.

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

Referenced by TOOL_MANAGER::dispatchContextMenu().

223  {
225  }
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
bool m_forceCursorPosition
Is the forced cursor position enabled
Definition: view_controls.h:61
VECTOR2D KIGFX::VIEW_CONTROLS::GetCursorPosition ( ) const
inline

Returns the current cursor position in world coordinates.

Note, that it may be different from the mouse pointer position if snapping is enabled or cursor position is forced to a specific point.

Returns
The current cursor position in world coordinates.

Definition at line 181 of file view_controls.h.

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

Referenced by POINT_EDITOR::addCorner(), KIGFX::WX_VIEW_CONTROLS::CenterOnCursor(), MODULE_EDITOR_TOOLS::CopyItems(), PCBNEW_CONTROL::CursorControl(), TOOL_MANAGER::dispatchContextMenu(), PCB_TOOL::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), MODULE_EDITOR_TOOLS::EnumeratePads(), SELECTION_TOOL::findMove(), EDA_DRAW_FRAME::GetCrossHairPosition(), EDIT_TOOL::getModificationPoint(), ROUTER_TOOL::InlineDrag(), PICKER_TOOL::Main(), EDIT_TOOL::Main(), ROUTER_TOOL::mainLoop(), DRAWING_TOOL::make45DegLine(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), MODULE_EDITOR_TOOLS::PasteItems(), DRAWING_TOOL::PlaceDXF(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCBNEW_CONTROL::ResetCoords(), DRAWING_TOOL::runPolygonEventLoop(), DRAWING_TOOL::SetAnchor(), PNS::TOOL_BASE::updateEndItem(), PNS::TOOL_BASE::updateStartItem(), and COMMON_TOOLS::ZoomInOut().

182  {
184  }
bool m_snappingEnabled
Should the cursor snap to grid or move freely
Definition: view_controls.h:67
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
virtual VECTOR2D KIGFX::VIEW_CONTROLS::GetCursorPosition ( bool  aEnableSnapping) const
pure virtual

Returns the current cursor position in world coordinates.

Note, that it may be different from the mouse pointer position if snapping is enabled or cursor position is forced to a specific point.

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.

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

Function GetMousePosition() Returns the current mouse pointer position.

Note, that it may be different from the cursor position if snapping is enabled (

See also
GetCursorPosition()).
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(), and PNS::TOOL_BASE::updateEndItem().

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

Returns the current VIEW_CONTROLS settings

Definition at line 332 of file view_controls.h.

References m_settings.

Referenced by TOOL_MANAGER::pushViewControls(), and TOOL_MANAGER::saveViewControls().

333  {
334  return m_settings;
335  }
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
bool KIGFX::VIEW_CONTROLS::IsCursorPositionForced ( ) const
inline

Function IsCursorPositionForced() Returns true if the cursor position is set by one of the tools.

Forced cursor position means it does not react to mouse movement.

Definition at line 256 of file view_controls.h.

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

257  {
259  }
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
bool m_forceCursorPosition
Is the forced cursor position enabled
Definition: view_controls.h:61
bool VIEW_CONTROLS::IsCursorShown ( ) const

Function IsCursorShown() Returns true when cursor is visible.

Returns
True if cursor is visible.

Definition at line 40 of file view_controls.cpp.

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

41 {
42  // this only says if the VIEW_CONTROLS say the cursor should be
43  // shown: m_view->GetGAL()->IsCursorEnabled() will say if the GAL is
44  // actually going to do show the cursor or not
45  return m_settings.m_showCursor;
46 }
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
bool m_showCursor
Flag determining the cursor visibility
Definition: view_controls.h:55
bool KIGFX::VIEW_CONTROLS::IsCursorWarpingEnabled ( ) const
inline

Function IsCursorWarpingEnabled()

Returns
the current setting for cursor warping.

Definition at line 288 of file view_controls.h.

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

Referenced by KIGFX::WX_VIEW_CONTROLS::onWheel(), and COMMON_TOOLS::ZoomInOut().

289  {
290  return m_settings.m_warpCursor;
291  }
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
bool m_warpCursor
If the cursor is allowed to be warped
Definition: view_controls.h:82
virtual bool KIGFX::VIEW_CONTROLS::IsMousewheelPanEnabled ( ) const
inlinevirtual

Function IsMousewheelPanEnabled()

Returns
the current setting for mousewheel panning

Definition at line 307 of file view_controls.h.

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

308  {
310  }
bool m_enableMousewheelPan
Mousewheel (2-finger touchpad) panning
Definition: view_controls.h:85
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
void VIEW_CONTROLS::Reset ( )
virtual

Function Reset() Restores the default VIEW_CONTROLS settings.

Definition at line 49 of file view_controls.cpp.

References ApplySettings(), and dummy().

50 {
51  // Get the default settings from the default constructor
53  ApplySettings( dummy );
54 }
void ApplySettings(const VC_SETTINGS &aSettings)
Applies VIEW_CONTROLS settings from an object
Structure to keep VIEW_CONTROLS settings for easy store/restore operations
Definition: view_controls.h:44
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
void KIGFX::VIEW_CONTROLS::SetAdditionalPanButtons ( bool  aLeft = false,
bool  aRight = false 
)
inline

Definition at line 319 of file view_controls.h.

References KIGFX::VC_SETTINGS::m_panWithLeftButton, KIGFX::VC_SETTINGS::m_panWithRightButton, and m_settings.

320  {
323  }
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
bool m_panWithRightButton
Allow panning with the right button in addition to middle
Definition: view_controls.h:88
bool m_panWithLeftButton
Allow panning with the left button in addition to middle
Definition: view_controls.h:91
virtual void KIGFX::VIEW_CONTROLS::SetAutoPan ( bool  aEnabled)
inlinevirtual
virtual void KIGFX::VIEW_CONTROLS::SetAutoPanMargin ( float  aMargin)
inlinevirtual

Function SetAutoPanMArgin() Sets margin for autopanning (ie.

the area when autopanning becomes active).

Parameters
aMarginis a new margin for autopanning.

Definition at line 158 of file view_controls.h.

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

Referenced by ApplySettings().

159  {
160  m_settings.m_autoPanMargin = aMargin;
161  }
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
float m_autoPanMargin
Distance from cursor to VIEW edge when panning is active
Definition: view_controls.h:76
virtual void KIGFX::VIEW_CONTROLS::SetAutoPanSpeed ( float  aSpeed)
inlinevirtual

Function SetAutoPanSpeed() Sets speed of autopanning.

Parameters
aSpeedis a new speed for autopanning.

Definition at line 148 of file view_controls.h.

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

Referenced by ApplySettings().

149  {
150  m_settings.m_autoPanSpeed = aSpeed;
151  }
float m_autoPanSpeed
How fast is panning when in auto mode
Definition: view_controls.h:79
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
virtual void KIGFX::VIEW_CONTROLS::SetCursorPosition ( const VECTOR2D aPosition,
bool  aWarpView = true 
)
pure virtual

Moves 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.

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 PCBNEW_CONTROL::CursorControl(), SELECTION_TOOL::findMove(), and EDIT_TOOL::Main().

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

Function SetGrabMouse Turns on/off mouse grabbing.

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

Parameters
aEnabledtells if mouse should be grabbed or not.

Reimplemented in KIGFX::WX_VIEW_CONTROLS.

Definition at line 127 of file view_controls.h.

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

Referenced by ApplySettings(), and KIGFX::WX_VIEW_CONTROLS::SetGrabMouse().

128  {
129  m_settings.m_grabMouse = aEnabled;
130  }
bool m_grabMouse
Flag for grabbing the mouse cursor
Definition: view_controls.h:70
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
virtual void KIGFX::VIEW_CONTROLS::SetSnapping ( bool  aEnabled)
inlinevirtual
void VIEW_CONTROLS::ShowCursor ( bool  aEnabled)
virtual

Function ShowCursor() Enables or disables display of cursor.

Parameters
aEnableddecides if the cursor should be shown.

Definition at line 33 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(), MODULE_EDITOR_TOOLS::CopyItems(), PCB_TOOL::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::drawZone(), MODULE_EDITOR_TOOLS::EnumeratePads(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), EDIT_TOOL::MeasureTool(), MODULE_EDITOR_TOOLS::PasteItems(), DRAWING_TOOL::PlaceDXF(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), PICKER_TOOL::setControls(), and POINT_EDITOR::setEditedPoint().

34 {
35  m_settings.m_showCursor = aEnabled;
36  m_view->GetGAL()->SetCursorEnabled( aEnabled );
37 }
void SetCursorEnabled(bool aCursorEnabled)
Enable/disable cursor.
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
VIEW * m_view
Pointer to controlled VIEW.
GAL * GetGAL() const
Function GetGAL() Returns the GAL this view is using to draw graphical primitives.
Definition: view.h:177
bool m_showCursor
Flag determining the cursor visibility
Definition: view_controls.h:55
virtual void KIGFX::VIEW_CONTROLS::WarpCursor ( const VECTOR2D aPosition,
bool  aWorldCoordinates = false,
bool  aWarpView = false 
) const
pure virtual

Function WarpCursor() If enabled (.

See also
SetEnableCursorWarping(), warps the cursor to the specified position, expressed either in the screen coordinates or the world coordinates.
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 PCBNEW_CONTROL::AppendBoard(), and TOOL_MANAGER::dispatchContextMenu().

Member Data Documentation


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