KiCad PCB EDA Suite
wx_view_controls.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
5  * Copyright (C) 2013-2015 CERN
6  * Copyright (C) 2012-2016 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
9  * @author Maciej Suminski <maciej.suminski@cern.ch>
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, you may find one here:
23  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24  * or you may search the http://www.gnu.org website for the version 2 license,
25  * or you may write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
27  */
28 
29 #include <view/view.h>
30 #include <view/wx_view_controls.h>
32 #include <tool/tool_dispatcher.h>
33 
34 using namespace KIGFX;
35 
36 const wxEventType WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE = wxNewEventType();
37 
38 WX_VIEW_CONTROLS::WX_VIEW_CONTROLS( VIEW* aView, wxScrolledCanvas* aParentPanel ) :
39  VIEW_CONTROLS( aView ), m_state( IDLE ), m_parentPanel( aParentPanel ), m_scrollScale( 1.0, 1.0 )
40 {
41  m_parentPanel->Connect( wxEVT_MOTION,
42  wxMouseEventHandler( WX_VIEW_CONTROLS::onMotion ), NULL, this );
43 #if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT )
44  m_parentPanel->Connect( wxEVT_MAGNIFY,
45  wxMouseEventHandler( WX_VIEW_CONTROLS::onMagnify ), NULL, this );
46 #endif
47  m_parentPanel->Connect( wxEVT_MOUSEWHEEL,
48  wxMouseEventHandler( WX_VIEW_CONTROLS::onWheel ), NULL, this );
49  m_parentPanel->Connect( wxEVT_MIDDLE_UP,
50  wxMouseEventHandler( WX_VIEW_CONTROLS::onButton ), NULL, this );
51  m_parentPanel->Connect( wxEVT_MIDDLE_DOWN,
52  wxMouseEventHandler( WX_VIEW_CONTROLS::onButton ), NULL, this );
53  m_parentPanel->Connect( wxEVT_LEFT_UP,
54  wxMouseEventHandler( WX_VIEW_CONTROLS::onButton ), NULL, this );
55  m_parentPanel->Connect( wxEVT_LEFT_DOWN,
56  wxMouseEventHandler( WX_VIEW_CONTROLS::onButton ), NULL, this );
57 #if defined _WIN32 || defined _WIN64
58  m_parentPanel->Connect( wxEVT_ENTER_WINDOW,
59  wxMouseEventHandler( WX_VIEW_CONTROLS::onEnter ), NULL, this );
60 #endif
61  m_parentPanel->Connect( wxEVT_LEAVE_WINDOW,
62  wxMouseEventHandler( WX_VIEW_CONTROLS::onLeave ), NULL, this );
63  m_parentPanel->Connect( wxEVT_SCROLLWIN_THUMBTRACK,
64  wxScrollWinEventHandler( WX_VIEW_CONTROLS::onScroll ), NULL, this );
65 
66  m_panTimer.SetOwner( this );
67  this->Connect( wxEVT_TIMER,
68  wxTimerEventHandler( WX_VIEW_CONTROLS::onTimer ), NULL, this );
69 }
70 
71 
72 void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
73 {
74  bool isAutoPanning = false;
75 
77  isAutoPanning = handleAutoPanning( aEvent );
78 
79  if( !isAutoPanning && aEvent.Dragging() )
80  {
81  if( m_state == DRAG_PANNING )
82  {
83  VECTOR2D d = m_dragStartPoint - VECTOR2D( aEvent.GetX(), aEvent.GetY() );
84  VECTOR2D delta = m_view->ToWorld( d, false );
85 
86  m_view->SetCenter( m_lookStartPoint + delta );
87  aEvent.StopPropagation();
88  }
89  }
90 
91  aEvent.Skip();
92 }
93 
94 
95 void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent )
96 {
97  const double wheelPanSpeed = 0.001;
98 
99  // mousewheelpan disabled:
100  // wheel + ctrl -> horizontal scrolling;
101  // wheel + shift -> vertical scrolling;
102  // wheel -> zooming;
103  // mousewheelpan enabled:
104  // wheel -> pan;
105  // wheel + ctrl -> zooming;
106  // wheel + shift -> horizontal scrolling.
107 
108  if( ( !m_settings.m_enableMousewheelPan && ( aEvent.ControlDown() || aEvent.ShiftDown() ) ) ||
109  ( m_settings.m_enableMousewheelPan && !aEvent.ControlDown() ) )
110  {
111  // Scrolling
112  VECTOR2D scrollVec = m_view->ToWorld( m_view->GetScreenPixelSize(), false ) *
113  ( (double) aEvent.GetWheelRotation() * wheelPanSpeed );
114  int axis = aEvent.GetWheelAxis();
115  double scrollX = 0.0;
116  double scrollY = 0.0;
117 
119  {
120  if ( axis == wxMOUSE_WHEEL_HORIZONTAL || aEvent.ShiftDown() )
121  scrollX = scrollVec.x;
122  else
123  scrollY = -scrollVec.y;
124  }
125  else
126  {
127  if( aEvent.ControlDown() )
128  scrollX = -scrollVec.x;
129  else
130  scrollY = -scrollVec.y;
131  }
132 
133  VECTOR2D delta( scrollX, scrollY );
134 
136  }
137  else
138  {
139  // Zooming
140  wxLongLong timeStamp = wxGetLocalTimeMillis();
141  double timeDiff = timeStamp.ToDouble() - m_timeStamp.ToDouble();
142  int rotation = aEvent.GetWheelRotation();
143  double zoomScale;
144 
145 #ifdef __WXMAC__
146  // The following is to support Apple pointer devices (MagicMouse &
147  // Macbook touchpad), which send events more frequently, but with smaller
148  // wheel rotation.
149  //
150  // It should not break other platforms, but I prefer to be safe than
151  // sorry. If you find a device that behaves in the same way on another
152  // platform, feel free to remove #ifdef directives.
153  if( timeDiff > 0 && timeDiff < 100 && std::abs( rotation ) < 20 )
154  {
155  aEvent.Skip();
156  return;
157  }
158 #endif
159 
161 
162  // Set scaling speed depending on scroll wheel event interval
163  if( timeDiff < 500 && timeDiff > 0 )
164  {
165  zoomScale = 2.05 - timeDiff / 500;
166 
167  if( rotation < 0 )
168  zoomScale = 1.0 / zoomScale;
169  }
170  else
171  {
172  zoomScale = ( rotation > 0 ) ? 1.05 : 1/1.05;
173  }
174 
175  if( IsCursorWarpingEnabled() )
176  {
177  CenterOnCursor();
178  m_view->SetScale( m_view->GetScale() * zoomScale );
179  }
180  else
181  {
182  VECTOR2D anchor = m_view->ToWorld( VECTOR2D( aEvent.GetX(), aEvent.GetY() ) );
183  m_view->SetScale( m_view->GetScale() * zoomScale, anchor );
184  }
185  }
186 
187  aEvent.Skip();
188 }
189 
190 
191 #if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT )
192 void WX_VIEW_CONTROLS::onMagnify( wxMouseEvent& aEvent )
193 {
194  // Scale based on the magnification from our underlying magnification event.
195  VECTOR2D anchor = m_view->ToWorld( VECTOR2D( aEvent.GetX(), aEvent.GetY() ) );
196  m_view->SetScale( m_view->GetScale() * ( aEvent.GetMagnification() + 1.0f ), anchor );
197 
198  aEvent.Skip();
199 }
200 #endif
201 
202 
203 void WX_VIEW_CONTROLS::onButton( wxMouseEvent& aEvent )
204 {
205  switch( m_state )
206  {
207  case IDLE:
208  case AUTO_PANNING:
209  if( aEvent.MiddleDown() )
210  {
211  m_dragStartPoint = VECTOR2D( aEvent.GetX(), aEvent.GetY() );
214  }
215 
216  if( aEvent.LeftUp() )
217  m_state = IDLE; // Stop autopanning when user release left mouse button
218 
219  break;
220 
221  case DRAG_PANNING:
222  if( aEvent.MiddleUp() )
223  m_state = IDLE;
224 
225  break;
226  }
227 
228  aEvent.Skip();
229 }
230 
231 
232 void WX_VIEW_CONTROLS::onEnter( wxMouseEvent& aEvent )
233 {
234  m_parentPanel->SetFocus();
235 }
236 
237 
238 void WX_VIEW_CONTROLS::onLeave( wxMouseEvent& aEvent )
239 {
241  {
242  bool warp = false;
243  int x = aEvent.GetX();
244  int y = aEvent.GetY();
245  wxSize parentSize = m_parentPanel->GetClientSize();
246 
247  if( x < 0 )
248  {
249  x = 0;
250  warp = true;
251  }
252  else if( x >= parentSize.x )
253  {
254  x = parentSize.x - 1;
255  warp = true;
256  }
257 
258  if( y < 0 )
259  {
260  y = 0;
261  warp = true;
262  }
263  else if( y >= parentSize.y )
264  {
265  y = parentSize.y - 1;
266  warp = true;
267  }
268 
269  if( warp )
270  m_parentPanel->WarpPointer( x, y );
271  }
272 }
273 
274 
275 void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent )
276 {
277  switch( m_state )
278  {
279  case AUTO_PANNING:
280  {
282  {
283  m_state = IDLE;
284  return;
285  }
286 
287 #if wxCHECK_VERSION( 3, 0, 0 )
288  if( !m_parentPanel->HasFocus() )
289  break;
290 #endif
291 
292  double borderSize = std::min( m_settings.m_autoPanMargin * m_view->GetScreenPixelSize().x,
294 
295  VECTOR2D dir( m_panDirection );
296 
297  if( dir.EuclideanNorm() > borderSize )
298  dir = dir.Resize( borderSize );
299 
300  dir = m_view->ToWorld( dir, false );
302 
303  // Notify tools that the cursor position has changed in the world coordinates
304  wxMouseEvent moveEvent( EVT_REFRESH_MOUSE );
305 
306  // Set the modifiers state
307 #if wxCHECK_VERSION( 3, 0, 0 )
308  moveEvent.SetControlDown( wxGetKeyState( WXK_CONTROL ) );
309  moveEvent.SetShiftDown( wxGetKeyState( WXK_SHIFT ) );
310  moveEvent.SetAltDown( wxGetKeyState( WXK_ALT ) );
311 #else
312  // wx <3.0 do not have accessors, but the fields are exposed
313  moveEvent.m_controlDown = wxGetKeyState( WXK_CONTROL );
314  moveEvent.m_shiftDown = wxGetKeyState( WXK_SHIFT );
315  moveEvent.m_altDown = wxGetKeyState( WXK_ALT );
316 #endif
317 
318  wxPostEvent( m_parentPanel, moveEvent );
319  }
320  break;
321 
322  case IDLE: // Just remove unnecessary warnings
323  case DRAG_PANNING:
324  break;
325  }
326 }
327 
328 
329 void WX_VIEW_CONTROLS::onScroll( wxScrollWinEvent& aEvent )
330 {
331  VECTOR2D center = m_view->GetCenter();
332  const BOX2I& boundary = m_view->GetBoundary();
333 
334  if( aEvent.GetOrientation() == wxHORIZONTAL )
335  center.x = boundary.GetLeft() + aEvent.GetPosition() / m_scrollScale.x;
336  else if( aEvent.GetOrientation() == wxVERTICAL )
337  center.y = boundary.GetTop() + aEvent.GetPosition() / m_scrollScale.y;
338 
339  m_view->SetCenter( center );
340  m_parentPanel->Refresh();
341 }
342 
343 
344 void WX_VIEW_CONTROLS::SetGrabMouse( bool aEnabled )
345 {
346  if( aEnabled && !m_settings.m_grabMouse )
347  m_parentPanel->CaptureMouse();
348  else if( !aEnabled && m_settings.m_grabMouse )
349  m_parentPanel->ReleaseMouse();
350 
351  VIEW_CONTROLS::SetGrabMouse( aEnabled );
352 }
353 
354 
356 {
357  wxPoint msp = wxGetMousePosition();
358  wxPoint winp = m_parentPanel->GetScreenPosition();
359 
360  return VECTOR2I( msp.x - winp.x, msp.y - winp.y );
361 }
362 
363 
365 {
367  {
369  }
370  else
371  {
372  VECTOR2D mousePosition = GetMousePosition();
373 
375  return m_view->GetGAL()->GetGridPoint( m_view->ToWorld( mousePosition ) );
376  else
377  return m_view->ToWorld( mousePosition );
378  }
379 }
380 
381 
382 void WX_VIEW_CONTROLS::WarpCursor( const VECTOR2D& aPosition, bool aWorldCoordinates,
383  bool aWarpView ) const
384 {
385  if( aWorldCoordinates )
386  {
387  const VECTOR2I& screenSize = m_view->GetGAL()->GetScreenPixelSize();
388  BOX2I screen( VECTOR2I( 0, 0 ), screenSize );
389  VECTOR2D screenPos = m_view->ToScreen( aPosition );
390 
391  if( !screen.Contains( screenPos ) )
392  {
393  if( aWarpView )
394  {
395  m_view->SetCenter( aPosition );
396  m_parentPanel->WarpPointer( screenSize.x / 2, screenSize.y / 2 );
397  }
398  }
399  else
400  {
401  m_parentPanel->WarpPointer( screenPos.x, screenPos.y );
402  }
403  }
404  else
405  {
406  m_parentPanel->WarpPointer( aPosition.x, aPosition.y );
407  }
408 }
409 
410 
412 {
413  const VECTOR2I& screenSize = m_view->GetGAL()->GetScreenPixelSize();
414  VECTOR2I screenCenter( screenSize / 2 );
415 
416  if( GetMousePosition() != screenCenter )
417  {
419  m_parentPanel->WarpPointer( KiROUND( screenSize.x / 2 ), KiROUND( screenSize.y / 2 ) );
420  }
421 }
422 
423 
424 bool WX_VIEW_CONTROLS::handleAutoPanning( const wxMouseEvent& aEvent )
425 {
426  VECTOR2D p( aEvent.GetX(), aEvent.GetY() );
427 
428  // Compute areas where autopanning is active
429  double borderStart = std::min( m_settings.m_autoPanMargin * m_view->GetScreenPixelSize().x,
431  double borderEndX = m_view->GetScreenPixelSize().x - borderStart;
432  double borderEndY = m_view->GetScreenPixelSize().y - borderStart;
433 
434  if( p.x < borderStart )
435  m_panDirection.x = -( borderStart - p.x );
436  else if( p.x > borderEndX )
437  m_panDirection.x = ( p.x - borderEndX );
438  else
439  m_panDirection.x = 0;
440 
441  if( p.y < borderStart )
442  m_panDirection.y = -( borderStart - p.y );
443  else if( p.y > borderEndY )
444  m_panDirection.y = ( p.y - borderEndY );
445  else
446  m_panDirection.y = 0;
447 
448  bool borderHit = ( m_panDirection.x != 0 || m_panDirection.y != 0 );
449 
450  switch( m_state )
451  {
452  case AUTO_PANNING:
453  if( !borderHit )
454  {
455  m_panTimer.Stop();
456  m_state = IDLE;
457 
458  return false;
459  }
460 
461  return true;
462  break;
463 
464  case IDLE:
465  if( borderHit )
466  {
468  m_panTimer.Start( (int) ( 250.0 / 60.0 ) );
469 
470  return true;
471  }
472 
473  return false;
474  break;
475 
476  case DRAG_PANNING:
477  return false;
478  }
479 
480  wxASSERT_MSG( false, wxT( "This line should never be reached" ) );
481  return false; // Should not be reached, just avoid the compiler warnings..
482 }
483 
484 
486 {
487  const BOX2D viewport = m_view->GetViewport();
488  const BOX2I& boundary = m_view->GetBoundary();
489 
490  m_scrollScale.x = 2e3 / viewport.GetWidth(); // TODO it does not have to be updated so often
491  m_scrollScale.y = 2e3 / viewport.GetHeight();
492  VECTOR2I newScroll( ( viewport.Centre().x - boundary.GetLeft() ) * m_scrollScale.x,
493  ( viewport.Centre().y - boundary.GetTop() ) * m_scrollScale.y );
494 
495  // Adjust scrollbars only if it is needed. Otherwise there are cases when canvas is continuosly
496  // refreshed (Windows)
497  if( m_scrollPos != newScroll )
498  {
499  // Another example of wxWidgets being broken by design: scroll position is determined by the
500  // left (or top, if vertical) edge of the slider. Fortunately, slider size seems to be constant
501  // (at least for wxGTK and wxMSW), so we have to add its size to allow user to scroll the workspace
502  // till the end.
503 
504  m_parentPanel->SetScrollbars( 1, 1,
505 #if defined(__LINUX__)
506  m_scrollScale.x * boundary.GetWidth() + 1623, m_scrollScale.y * boundary.GetHeight() + 1623,
507 #elif defined(__WIN32__) || defined(__WIN64__)
508  m_scrollScale.x * boundary.GetWidth() + 1377, m_scrollScale.y * boundary.GetHeight() + 741,
509 #else
510  m_scrollScale.x * boundary.GetWidth(), m_scrollScale.y * boundary.GetHeight(),
511 #endif
512  newScroll.x, newScroll.y, false );
513 
514  m_scrollPos = newScroll;
515  }
516 }
bool m_enableMousewheelPan
Mousewheel (2-finger touchpad) panning
Definition: view_controls.h:85
const VECTOR2D & GetCenter() const
Function GetCenter() Returns the center point of this VIEW (in world space coordinates) ...
Definition: view.h:316
VECTOR2D m_lookStartPoint
Stores information about the center of viewport when dragging has started.
float m_autoPanSpeed
How fast is panning when in auto mode
Definition: view_controls.h:79
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:56
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
static const wxEventType EVT_REFRESH_MOUSE
Event that forces mouse move event in the dispatcher (eg.
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
const BOX2I & GetBoundary() const
Function GetBoundary()
Definition: view.h:284
bool Contains(const Vec &aPoint) const
Function Contains.
Definition: box2.h:139
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates...
Definition: view.cpp:440
void onButton(wxMouseEvent &aEvent)
VC_SETTINGS m_settings
Current VIEW_CONTROLS settings
VECTOR2I GetMousePosition() const override
Function SetAutoPan() Enables/disables autopanning (panning when mouse cursor reaches the panel borde...
VECTOR2D m_forcedPosition
Forced cursor position (world coordinates)
Definition: view_controls.h:58
VECTOR2D GetCursorPosition() const override
Function GetCursorPosition() Returns the current cursor position in world coordinates.
VIEW * m_view
Pointer to controlled VIEW.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590
#define abs(a)
Definition: auxiliary.h:84
void SetScale(double aScale)
Function SetScale() Sets the scaling factor.
Definition: view.h:247
VECTOR2D m_scrollScale
Ratio used for scaling world coordinates to scrollbar position.
coord_type GetTop() const
Definition: box2.h:192
static const int delta[8][2]
Definition: solve.cpp:112
WX_VIEW_CONTROLS class definition.
void UpdateScrollbars()
Adjusts the scrollbars position to match the current viewport.
coord_type GetWidth() const
Definition: box2.h:185
void onWheel(wxMouseEvent &aEvent)
Handler functions.
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:564
Panning with mouse button pressed.
BOX2D GetViewport() const
Function GetViewport() Returns the current viewport visible area rectangle.
Definition: view.cpp:501
bool m_forceCursorPosition
Is the forced cursor position enabled
Definition: view_controls.h:61
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589
GAL * GetGAL() const
Function GetGAL() Returns the GAL this view is using to draw graphical primitives.
Definition: view.h:177
Class VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (...
Definition: view_controls.h:94
float m_autoPanMargin
Distance from cursor to VIEW edge when panning is active
Definition: view_controls.h:76
void SetGrabMouse(bool aEnabled) override
Function SetGrabMouse() Enables/disables mouse cursor grabbing (limits the movement field only to the...
bool m_autoPanEnabled
Flag for turning on autopanning
Definition: view_controls.h:73
Vec Centre() const
Definition: box2.h:67
void onMotion(wxMouseEvent &aEvent)
const VECTOR2I & GetScreenPixelSize() const
Returns GAL canvas size in pixels.
coord_type GetHeight() const
Definition: box2.h:186
VECTOR2D GetGridPoint(const VECTOR2D &aPoint) const
Function GetGridPoint() For a given point it returns the nearest point belonging to the grid in world...
wxScrolledCanvas * m_parentPanel
Panel that is affected by VIEW_CONTROLS.
void onTimer(wxTimerEvent &WXUNUSED(aEvent))
VECTOR2D m_panDirection
Current direction of panning (only autopanning mode)
VECTOR2D ToScreen(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToScreen() Converts a world space point/vector to a point/vector in screen space coordinates...
Definition: view.cpp:459
bool IsCursorWarpingEnabled() const
Function IsCursorWarpingEnabled() Returns the current setting for cursor warping. ...
const VECTOR2I & GetScreenPixelSize() const
Function GetScreenPixelSize() Returns the size of the our rendering area, in pixels.
Definition: view.cpp:1041
virtual void SetGrabMouse(bool aEnabled)
Function SetGrabMouse Turns on/off mouse grabbing.
VECTOR2I m_scrollPos
Current scrollbar position.
WX_VIEW_CONTROLS(VIEW *aView, wxScrolledCanvas *aParentPanel)
void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false) const override
bool handleAutoPanning(const wxMouseEvent &aEvent)
Function handleAutoPanning() Computes new viewport settings while in autopanning mode.
double GetScale() const
Function GetScale()
Definition: view.h:265
void onEnter(wxMouseEvent &WXUNUSED(aEvent))
VECTOR2D m_dragStartPoint
Stores information about point where dragging has started.
STATE m_state
Current state of VIEW_CONTROLS.
coord_type GetLeft() const
Definition: box2.h:191
wxLongLong m_timeStamp
Used for determining time intervals between scroll & zoom events.
Class VIEW.
Definition: view.h:58
void CenterOnCursor() const override
Function CenterOnCursor() Sets the viewport center to the current cursor position and warps the curso...
bool m_cursorCaptured
Should the cursor be locked within the parent window area
Definition: view_controls.h:64
void onScroll(wxScrollWinEvent &aEvent)
static unsigned long timeStamp(CPTREE &aTree)
Make a unique time stamp.
#define min(a, b)
Definition: auxiliary.h:85
void onLeave(wxMouseEvent &WXUNUSED(aEvent))
wxTimer m_panTimer
Timer repsonsible for handling autopanning.