Audacity 3.2.0
ZoomHandle.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5ZoomHandle.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_ZOOM_HANDLE__
12#define __AUDACITY_ZOOM_HANDLE__
13
14#include "../../UIHandle.h"
15
16class wxMouseState;
17
18// This handle class, unlike most, doesn't associate with any particular cell.
19class ZoomHandle final : public UIHandle
20{
21 ZoomHandle(const ZoomHandle&) = delete;
23 (const wxMouseState &state, const AudacityProject *pProject);
24
25public:
26 ZoomHandle();
27
28 ZoomHandle &operator=(const ZoomHandle&) = default;
29
31 (std::weak_ptr<ZoomHandle> &holder);
32 static UIHandlePtr HitTest
33 (std::weak_ptr<ZoomHandle> &holder, const wxMouseState &state);
34
35 virtual ~ZoomHandle();
36
37 std::shared_ptr<const Channel> FindChannel() const override;
38
39 bool HandlesRightClick() override;
40
42 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
43
45 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
46
48 (const TrackPanelMouseState &state, AudacityProject *pProject)
49 override;
50
52 (const TrackPanelMouseEvent &event, AudacityProject *pProject,
53 wxWindow *pParent) override;
54
55 Result Cancel(AudacityProject *pProject) override;
56
57private:
58
59 // TrackPanelDrawable implementation
60 void Draw(
62 const wxRect &rect, unsigned iPass ) override;
63
64 wxRect DrawingArea(
66 const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
67
68 bool IsDragZooming() const;
69
71 wxRect mRect{};
72};
73
74#endif
std::shared_ptr< UIHandle > UIHandlePtr
Definition: CellularPanel.h:28
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:36
unsigned Result
Definition: UIHandle.h:39
virtual ~ZoomHandle()
Definition: ZoomHandle.cpp:82
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: ZoomHandle.cpp:97
ZoomHandle & operator=(const ZoomHandle &)=default
Result Cancel(AudacityProject *pProject) override
Definition: ZoomHandle.cpp:191
int mZoomStart
Definition: ZoomHandle.h:70
bool IsDragZooming() const
Definition: ZoomHandle.cpp:230
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
Definition: ZoomHandle.cpp:137
std::shared_ptr< const Channel > FindChannel() const override
Definition: ZoomHandle.cpp:86
static UIHandlePtr HitAnywhere(std::weak_ptr< ZoomHandle > &holder)
Definition: ZoomHandle.cpp:65
int mZoomEnd
Definition: ZoomHandle.h:70
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Definition: ZoomHandle.cpp:131
ZoomHandle(const ZoomHandle &)=delete
bool HandlesRightClick() override
Whether the handle has any special right-button handling.
Definition: ZoomHandle.cpp:91
wxRect mRect
Definition: ZoomHandle.h:71
static HitTestPreview HitPreview(const wxMouseState &state, const AudacityProject *pProject)
Definition: ZoomHandle.cpp:43
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
Definition: ZoomHandle.cpp:198
static UIHandlePtr HitTest(std::weak_ptr< ZoomHandle > &holder, const wxMouseState &state)
Definition: ZoomHandle.cpp:73
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: ZoomHandle.cpp:110
wxRect DrawingArea(TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
Definition: ZoomHandle.cpp:220