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"
63 static auto zoomInCursor =
64 ::MakeCursor(wxCURSOR_MAGNIFIER, ZoomInCursorXpm, 19, 15);
65 static auto zoomOutCursor =
66 ::MakeCursor(wxCURSOR_MAGNIFIER, ZoomOutCursorXpm, 19, 15);
67 static wxCursor arrowCursor{ wxCURSOR_ARROW };
70 bVZoom &= !state.RightIsDown();
71 const auto message =
bVZoom ?
72 XO(
"Click to vertically zoom in. Shift-click to zoom out. Drag to specify a zoom region.") :
73 XO(
"Right-click for menu.");
77 bVZoom ? (state.ShiftDown() ? &*zoomOutCursor : &*zoomInCursor) : &arrowCursor
84 const int zoomStart,
int &zoomEnd)
88 const wxMouseEvent &
event = evt.
event;
89 if ( event.RightIsDown() )
99 wxWindow *pParent,
WaveTrack *pTrack,
const wxRect &rect,
101 int zoomStart,
int zoomEnd)
107 const wxMouseEvent &
event = evt.
event;
108 const bool shiftDown =
event.ShiftDown();
109 const bool rightUp =
event.RightUp();
116 !(event.ShiftDown() || event.CmdDown()))
123 pMenu->Popup( *pParent, {
event.m_x,
event.m_y } );
139 doZoom(pProject, pTrack,
143 rect, zoomStart, zoomEnd, !shiftDown);
152 const wxRect &rect,
unsigned iPass,
const int zoomStart,
const int zoomEnd)
161 const wxRect &rect,
const wxRect &panelRect,
unsigned iPass)
audacity::BasicSettings * gPrefs
std::unique_ptr< wxCursor > MakeCursor(int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
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)
A Track that contains audio waveform data.
virtual bool Read(const wxString &key, bool *value) const =0
Namespace containing an enum 'what to do on a refresh?'.
AUDACITY_DLL_API Result DoRelease(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent, WaveTrack *pTrack, const wxRect &mRect, DoZoomFunction doZoom, PopupMenuTable &table, int zoomStart, int zoomEnd)
AUDACITY_DLL_API Result DoDrag(const TrackPanelMouseEvent &event, AudacityProject *pProject, int zoomStart, int &zoomEnd)
void(*)(AudacityProject *pProject, WaveTrack *pTrack, WaveChannelViewConstants::ZoomActions ZoomKind, const wxRect &rect, int zoomStart, int zoomEnd, bool fixedMousePoint) DoZoomFunction
AUDACITY_DLL_API HitTestPreview HitPreview(const wxMouseState &state)
AUDACITY_DLL_API void DoDraw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass, int zoomStart, int zoomEnd)
AUDACITY_DLL_API wxRect DoDrawingArea(const wxRect &rect, const wxRect &panelRect, unsigned iPass)
AUDACITY_DLL_API bool IsDragZooming(int zoomStart, int zoomEnd)
bool IsDragZooming(int zoomStart, int zoomEnd)