31 wxWindow* aParent,
const wxGLAttributes& aGLAttribs,
32 wxWindowID,
const wxPoint& aPos,
33 const wxSize& aSize,
long aStyle,
const wxString& aName,
34 const wxPalette& aPalette ) :
35 HIDPI_GL_CANVAS( aVcSettings, aParent, aGLAttribs, wxID_ANY, aPos, aSize, aStyle, aName, aPalette ),
36 m_mouse_is_moving( false ),
37 m_mouse_was_moved( false ),
38 m_camera_is_moving( false ),
54 if( event.Dragging() )
56 if( event.LeftIsDown() )
58 else if( event.MiddleIsDown() )
70 bool mouseActivity =
false;
76 int modifiers =
event.ShiftDown() ? WXK_SHIFT
77 : (
event.ControlDown() ? WXK_CONTROL
78 : (
event.AltDown() ? WXK_ALT : 0 ) );
85 delta_move *= 0.01f *
event.GetWheelRotation();
86 else if( event.GetWheelRotation() < 0 )
87 delta_move = -delta_move;
100 if( event.GetWheelAxis() == wxMOUSE_WHEEL_HORIZONTAL
106 mouseActivity =
true;
111 mouseActivity =
true;
116 mouseActivity =
true;
121 m_camera.
Zoom( ( event.GetWheelRotation() * zoomSign ) > 0 ? 1.1f : 1 / 1.1f );
A class used to derive camera objects from.
virtual void Pan(const wxPoint &aNewMousePosition)=0
virtual void Drag(const wxPoint &aNewMousePosition)=0
Calculate a new mouse drag position.
bool SetCurWindowSize(const wxSize &aSize)
Update the windows size of the camera.
void SetCurMousePosition(const wxPoint &aPosition)
Update the current mouse position without make any new calculations on camera.
static const float m_delta_move_step_factor
HIDPI_GL_3D_CANVAS(const KIGFX::VC_SETTINGS &aVcSettings, CAMERA &aCamera, wxWindow *parent, const wxGLAttributes &aGLAttribs, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxGLCanvasName, const wxPalette &palette=wxNullPalette)
void OnMouseWheelCamera(wxMouseEvent &event, bool aPan)
void OnMouseMoveCamera(wxMouseEvent &event)
wxGLCanvas wrapper for HiDPI/Retina support.
KIGFX::VC_SETTINGS m_settings
< Current VIEW_CONTROLS settings.
virtual wxSize GetNativePixelSize() const
wxPoint GetNativePosition(const wxPoint &aPoint) const
Convert the given point from client coordinates to native pixel coordinates.
Structure to keep VIEW_CONTROLS settings for easy store/restore operations.
int m_scrollModifierZoom
What modifier key to enable horizontal pan with the (vertical) scroll wheel.
int m_scrollModifierPanH
What modifier key to enable vertical with the (vertical) scroll wheel.
bool m_scrollReverseZoom
Whether to invert the scroll wheel movement for horizontal pan.