Audacity  3.0.3
TrackPanelResizeHandle.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 TrackPanelResizeHandle.h
6 
7 Paul Licameli split from TrackPanel.cpp
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_TRACK_PANEL_RESIZE_HANDLE__
12 #define __AUDACITY_TRACK_PANEL_RESIZE_HANDLE__
13 
14 #include "UIHandle.h"
15 
16 class Track;
17 
18 class TrackPanelResizeHandle final : public UIHandle
19 {
21 
22 public:
23  explicit TrackPanelResizeHandle( const std::shared_ptr<Track> &pTrack, int y );
24 
26 
27  static HitTestPreview HitPreview(bool bLinked);
28 
29  virtual ~TrackPanelResizeHandle();
30 
31  std::shared_ptr<Track> GetTrack() const { return mpTrack.lock(); }
32 
34  (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
35 
36  Result Drag
37  (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
38 
40  (const TrackPanelMouseState &state, AudacityProject *pProject)
41  override;
42 
44  (const TrackPanelMouseEvent &event, AudacityProject *pProject,
45  wxWindow *pParent) override;
46 
47  Result Cancel(AudacityProject *pProject) override;
48 
49 private:
50  enum Mode {
54  };
56 
57  std::weak_ptr<Track> mpTrack;
58 
64 
65  int mMouseClickY{};
66 };
67 
68 #endif
TrackPanelResizeHandle::IsResizingBelowLinkedTracks
@ IsResizingBelowLinkedTracks
Definition: TrackPanelResizeHandle.h:53
TrackPanelResizeHandle::IsResizingBetweenLinkedTracks
@ IsResizingBetweenLinkedTracks
Definition: TrackPanelResizeHandle.h:52
TrackPanelResizeHandle::mMouseClickY
int mMouseClickY
Definition: TrackPanelResizeHandle.h:65
TrackPanelResizeHandle::~TrackPanelResizeHandle
virtual ~TrackPanelResizeHandle()
Definition: TrackPanelResizeHandle.cpp:51
TrackPanelResizeHandle::Mode
Mode
Definition: TrackPanelResizeHandle.h:50
TrackPanelResizeHandle::GetTrack
std::shared_ptr< Track > GetTrack() const
Definition: TrackPanelResizeHandle.h:31
TrackPanelResizeHandle
Definition: TrackPanelResizeHandle.h:19
TrackPanelResizeHandle::HitPreview
static HitTestPreview HitPreview(bool bLinked)
Definition: TrackPanelResizeHandle.cpp:24
UIHandle
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:34
TrackPanelResizeHandle::mInitialUpperTrackHeight
int mInitialUpperTrackHeight
Definition: TrackPanelResizeHandle.h:62
TrackPanelResizeHandle::Release
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
Definition: TrackPanelResizeHandle.cpp:246
TrackPanelResizeHandle::mpTrack
std::weak_ptr< Track > mpTrack
Definition: TrackPanelResizeHandle.h:57
TrackPanelResizeHandle::mInitialMinimized
bool mInitialMinimized
Definition: TrackPanelResizeHandle.h:59
UIHandle::Result
unsigned Result
Definition: UIHandle.h:37
TrackPanelResizeHandle::mMode
Mode mMode
Definition: TrackPanelResizeHandle.h:55
TrackPanelResizeHandle::IsResizing
@ IsResizing
Definition: TrackPanelResizeHandle.h:51
HitTestPreview
Definition: HitTestResult.h:20
TrackPanelResizeHandle::Click
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: TrackPanelResizeHandle.cpp:55
TrackPanelResizeHandle::mInitialTrackHeight
int mInitialTrackHeight
Definition: TrackPanelResizeHandle.h:60
TrackPanelResizeHandle::Preview
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Definition: TrackPanelResizeHandle.cpp:240
TrackPanelResizeHandle::Cancel
Result Cancel(AudacityProject *pProject) override
Definition: TrackPanelResizeHandle.cpp:259
UIHandle.h
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:239
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:113
TrackPanelResizeHandle::operator=
TrackPanelResizeHandle & operator=(const TrackPanelResizeHandle &)=default
TrackPanelMouseEvent
Definition: TrackPanelMouseEvent.h:46
TrackPanelMouseState
Definition: TrackPanelMouseEvent.h:28
TrackPanelResizeHandle::mInitialUpperActualHeight
int mInitialUpperActualHeight
Definition: TrackPanelResizeHandle.h:63
TrackPanelResizeHandle::Drag
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: TrackPanelResizeHandle.cpp:117
TrackPanelResizeHandle::mInitialActualHeight
int mInitialActualHeight
Definition: TrackPanelResizeHandle.h:61
TrackPanelResizeHandle::TrackPanelResizeHandle
TrackPanelResizeHandle(const TrackPanelResizeHandle &)=delete