29 #ifndef __VIEW_CONTROLS_H 30 #define __VIEW_CONTROLS_H 267 bool aTriggeredByArrows =
false,
long aArrowCommand = 0 ) = 0;
333 bool aWarpView =
false ) = 0;
362 virtual void Reset();
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
void Reset()
Flag determining the cursor visibility.
virtual void SetAutoPanSpeed(float aSpeed)
Set the speed of autopanning.
MOUSE_DRAG_ACTION m_dragRight
Is last cursor motion event coming from keyboard arrow cursor motion action.
float m_autoPanSpeed
How fast does panning accelerate when approaching the window boundary.
virtual VECTOR2D GetMousePosition(bool aWorldCoordinates=true) const =0
Return the current mouse pointer position.
The Cairo implementation of the graphics abstraction layer.
bool m_snappingEnabled
Flag for grabbing the mouse cursor.
VC_SETTINGS()
Restore the default settings.
bool m_grabMouse
Flag for turning on autopanning.
void ApplySettings(const VC_SETTINGS &aSettings)
Load new settings from program common settings.
VIEW_CONTROLS(VIEW *aView)
VECTOR2D m_forcedPosition
Is the forced cursor position enabled.
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 SetAutoPanMargin(float aMargin)
Set the margin for autopanning (ie.
VIEW * m_view
< Pointer to controlled VIEW.
virtual void Reset()
Restore the default VIEW_CONTROLS settings.
virtual void LoadSettings()
const VC_SETTINGS & GetSettings() const
Apply VIEW_CONTROLS settings from an object.
virtual void CenterOnCursor() const =0
Set the viewport center to the current cursor position and warps the cursor to the screen center.
bool IsCursorPositionForced() const
Return true if the cursor position is set by one of the tools.
void EnableCursorWarping(bool aEnable)
Enable or disable warping the cursor.
int m_scrollModifierPanH
What modifier key to enable vertical with the (vertical) scroll wheel.
VECTOR2D m_lastKeyboardCursorPosition
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
bool m_autoPanSettingEnabled
Distance from cursor to VIEW edge when panning is active.
MOUSE_DRAG_ACTION m_dragLeft
bool m_forceCursorPosition
Should the cursor be locked within the parent window area.
VECTOR2< double > VECTOR2D
MOUSE_DRAG_ACTION m_dragMiddle
bool m_zoomSpeedAuto
What modifier key to enable zoom with the (vertical) scroll wheel.
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
int m_scrollModifierZoom
What modifier key to enable horizontal pan with the (vertical) scroll wheel.
float m_autoPanAcceleration
If the cursor is allowed to be warped.
int m_zoomSpeed
When true, ignore zoom_speed and pick a platform-specific default.
Structure to keep VIEW_CONTROLS settings for easy store/restore operations.
bool IsCursorWarpingEnabled() const
An interface for classes handling user events controlling the view behavior such as zooming,...
bool m_warpCursor
Enable horizontal panning with the horizontal scroll/trackpad input.
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
virtual void EnableAutoPan(bool aEnabled)
Turn on/off auto panning (user setting to disable it entirely).
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Move the graphic crosshair cursor to the requested position expressed in world coordinates.
float m_autoPanMargin
How fast is panning when in auto mode.
bool m_horizontalPan
Enable the accelerating zoom controller.
bool m_cursorWarped
Current VIEW_CONTROLS settings.
bool ForcedCursorPosition() const
Return true if the current cursor position is forced to a specific location, ignoring the mouse curso...
bool m_autoPanEnabled
Flag for turning on autopanning.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
bool m_zoomAcceleration
Zoom speed for the non-accelerating zoom controller.
virtual void SetAutoPanAcceleration(float aAcceleration)
Set the speed of autopanning.
bool m_showCursor
Forced cursor position (world coordinates).
virtual VECTOR2D GetRawCursorPosition(bool aSnappingEnabled=true) const =0
Return the current cursor position in world coordinates ignoring the cursorUp position force mode.
bool IsCursorShown() const
Return true when cursor is visible.
long m_lastKeyboardCursorCommand
Position of the above event.
bool m_lastKeyboardCursorPositionValid
ACTIONS::CURSOR_UP, ACTIONS::CURSOR_DOWN, etc.
virtual void SetGrabMouse(bool aEnabled)
Turn on/off mouse grabbing.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
bool m_cursorCaptured
Should the cursor snap to grid or move freely.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.