14#include "../../../ui/ChannelVRulerControls.h"
16#include "../../../../HitTestResult.h"
18#include "../../../../RefreshCode.h"
19#include "../../../../TrackArtist.h"
20#include "../../../../TrackPanelMouseEvent.h"
22#include "../../../../../images/Cursors.h"
27 return hasDragZoom && (abs(zoomEnd - zoomStart) >
DragThreshold);
61 static wxCursor crossCursor{wxCURSOR_CROSS};
62 static wxCursor arrowCursor{ wxCURSOR_ARROW };
63 const auto message =
bVZoom ?
64 XO(
"Drag to specify a zoom region. Right-click for menu. Ctrl+scroll to zoom.") :
65 XO(
"Right-click for menu. Ctrl+scroll to zoom.");
69 bVZoom ? &crossCursor : &arrowCursor
76 const int zoomStart,
int &zoomEnd,
bool hasDragZooming)
80 const wxMouseEvent &
event = evt.
event;
81 if ( event.RightIsDown() )
91 wxWindow *pParent,
WaveChannel &wc,
const wxRect &rect,
93 int zoomStart,
int zoomEnd)
96 const wxMouseEvent &
event = evt.
event;
97 const bool shiftDown =
event.ShiftDown();
98 const bool rightUp =
event.RightUp();
105 !(event.ShiftDown() || event.CmdDown()))
112 pMenu->Popup( *pParent, {
event.m_x,
event.m_y } );
120 if( shiftDown && notLost)
123 rect, zoomStart, zoomEnd, !shiftDown);
132 const wxRect &rect,
unsigned iPass,
const int zoomStart,
const int zoomEnd,
bool hasDragZoom)
141 const wxRect &rect,
const wxRect &panelRect,
unsigned iPass)
const int kCaptureLostEventId
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
static wxRect ZoomingArea(const wxRect &rect, const wxRect &panelRect)
static void DrawZooming(TrackPanelDrawingContext &context, const wxRect &rect, int zoomStart, int zoomEnd)
Namespace containing an enum 'what to do on a refresh?'.
AUDACITY_DLL_API Result DoRelease(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent, WaveChannel &wc, const wxRect &mRect, DoZoomFunction doZoom, PopupMenuTable &table, int zoomStart, int zoomEnd)
AUDACITY_DLL_API bool IsDragZooming(int zoomStart, int zoomEnd, bool hasDragZoom)
AUDACITY_DLL_API HitTestPreview HitPreview(const bool bVZoom)
AUDACITY_DLL_API void DoDraw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass, int zoomStart, int zoomEnd, bool hasDragZoom)
void(*)(AudacityProject *pProject, WaveChannel &wc, WaveChannelViewConstants::ZoomActions ZoomKind, const wxRect &rect, int zoomStart, int zoomEnd, bool fixedMousePoint) DoZoomFunction
AUDACITY_DLL_API wxRect DoDrawingArea(const wxRect &rect, const wxRect &panelRect, unsigned iPass)
AUDACITY_DLL_API Result DoDrag(const TrackPanelMouseEvent &event, AudacityProject *pProject, int zoomStart, int &zoomEnd, bool hasDragZoom)
bool IsDragZooming(int zoomStart, int zoomEnd)