Audacity 3.2.0
NoteTrackVZoomHandle.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5NoteTrackVZoomHandle.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_NOTE_TRACK_VZOOM_HANDLE__
12#define __AUDACITY_NOTE_TRACK_VZOOM_HANDLE__
13
14class wxMouseState;
15class NoteTrack;
16
17#include "../../../../UIHandle.h"
18
20{
22 static HitTestPreview HitPreview(const wxMouseState &state);
23
24public:
26 (const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect, int y);
27
29
30 static UIHandlePtr HitTest
31 (std::weak_ptr<NoteTrackVZoomHandle> &holder,
32 const wxMouseState &state,
33 const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect);
34
35 virtual ~NoteTrackVZoomHandle();
36
37 std::shared_ptr<const Track> FindTrack() const override;
38
39 void Enter(bool forward, AudacityProject *) override;
40
41 bool HandlesRightClick() override;
42
44 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
45
47 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
48
50 (const TrackPanelMouseState &state, AudacityProject *pProject)
51 override;
52
54 (const TrackPanelMouseEvent &event, AudacityProject *pProject,
55 wxWindow *pParent) override;
56
57 Result Cancel(AudacityProject *pProject) override;
58
59private:
60 // TrackPanelDrawable implementation
61 void Draw(
63 const wxRect &rect, unsigned iPass ) override;
64
65 wxRect DrawingArea(
67 const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
68
69 std::weak_ptr<NoteTrack> mpTrack;
70
72 wxRect mRect;
73};
74
75#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
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:78
std::shared_ptr< const Track > FindTrack() const override
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
NoteTrackVZoomHandle(const NoteTrackVZoomHandle &)
std::weak_ptr< NoteTrack > mpTrack
wxRect DrawingArea(TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
static HitTestPreview HitPreview(const wxMouseState &state)
Result Cancel(AudacityProject *pProject) override
bool HandlesRightClick() override
Whether the handle has any special right-button handling.
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
NoteTrackVZoomHandle & operator=(const NoteTrackVZoomHandle &)=default
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
void Enter(bool forward, AudacityProject *) override
static UIHandlePtr HitTest(std::weak_ptr< NoteTrackVZoomHandle > &holder, const wxMouseState &state, const std::shared_ptr< NoteTrack > &pTrack, const wxRect &rect)
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:37
unsigned Result
Definition: UIHandle.h:40