Audacity  2.2.2
NoteTrackVZoomHandle.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 NoteTrackVZoomHandle.h
6 
7 Paul Licameli split from TrackPanel.cpp
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_NOTE_TRACK_VZOOM_HANDLE__
12 #define __AUDACITY_NOTE_TRACK_VZOOM_HANDLE__
13 
14 class wxMouseState;
15 class NoteTrack;
16 
17 #include "../../../../MemoryX.h"
18 #include "../../../../UIHandle.h"
19 #include <wx/gdicmn.h>
20 
22 {
24  static HitTestPreview HitPreview(const wxMouseState &state);
25 
26 public:
27  explicit NoteTrackVZoomHandle
28  (const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect, int y);
29 
31 
32  static UIHandlePtr HitTest
33  (std::weak_ptr<NoteTrackVZoomHandle> &holder,
34  const wxMouseState &state,
35  const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect);
36 
37  virtual ~NoteTrackVZoomHandle();
38 
39  std::shared_ptr<NoteTrack> GetTrack() const { return mpTrack.lock(); }
40 
41  void Enter(bool forward) override;
42 
44  (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
45 
46  Result Drag
47  (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
48 
50  (const TrackPanelMouseState &state, const AudacityProject *pProject)
51  override;
52 
54  (const TrackPanelMouseEvent &event, AudacityProject *pProject,
55  wxWindow *pParent) override;
56 
57  Result Cancel(AudacityProject *pProject) override;
58 
59  void DrawExtras
60  (DrawingPass pass,
61  wxDC * dc, const wxRegion &updateRegion, const wxRect &panelRect)
62  override;
63 
64 private:
65  std::weak_ptr<NoteTrack> mpTrack;
66 
68  wxRect mRect;
69 };
70 
71 #endif
void Enter(bool forward) override
NoteTrackVZoomHandle(const NoteTrackVZoomHandle &)
std::weak_ptr< NoteTrack > mpTrack
static UIHandlePtr HitTest(std::weak_ptr< NoteTrackVZoomHandle > &holder, const wxMouseState &state, const std::shared_ptr< NoteTrack > &pTrack, const wxRect &rect)
static HitTestPreview HitPreview(const wxMouseState &state)
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
unsigned Result
Definition: UIHandle.h:37
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
std::shared_ptr< NoteTrack > GetTrack() const
std::shared_ptr< UIHandle > UIHandlePtr
Definition: TrackPanel.h:59
Result Cancel(AudacityProject *pProject) override
HitTestPreview Preview(const TrackPanelMouseState &state, const AudacityProject *pProject) override
void DrawExtras(DrawingPass pass, wxDC *dc, const wxRegion &updateRegion, const wxRect &panelRect) override
virtual ~NoteTrackVZoomHandle()
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
DrawingPass
Definition: UIHandle.h:43
NoteTrackVZoomHandle & operator=(const NoteTrackVZoomHandle &)=default
A Track that is used for Midi notes. (Somewhat old code).