#include <TrackSelectHandle.h>
|
| TrackSelectHandle (const std::shared_ptr< Track > &pTrack) |
|
TrackSelectHandle & | operator= (const TrackSelectHandle &)=default |
|
virtual | ~TrackSelectHandle () |
|
Result | Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) override |
|
Result | Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) override |
|
HitTestPreview | Preview (const TrackPanelMouseState &state, AudacityProject *pProject) override |
|
Result | Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override |
|
Result | Cancel (AudacityProject *) override |
|
bool | StopsOnKeystroke () override |
|
Public Member Functions inherited from UIHandle |
virtual | ~UIHandle ()=0 |
|
virtual void | Enter (bool forward, AudacityProject *pProject) |
|
virtual bool | HasRotation () const |
|
virtual bool | Rotate (bool forward) |
|
virtual bool | HasEscape (AudacityProject *pProject) const |
|
virtual bool | Escape (AudacityProject *pProject) |
|
virtual bool | HandlesRightClick () |
| Whether the handle has any special right-button handling. More...
|
|
virtual Result | Click (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0 |
|
virtual Result | Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0 |
|
virtual HitTestPreview | Preview (const TrackPanelMouseState &state, AudacityProject *pProject)=0 |
|
virtual Result | Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)=0 |
|
virtual Result | Cancel (AudacityProject *pProject)=0 |
|
virtual bool | StopsOnKeystroke () |
|
virtual void | OnProjectChange (AudacityProject *pProject) |
|
Result | GetChangeHighlight () const |
|
void | SetChangeHighlight (Result val) |
|
virtual | ~TrackPanelDrawable ()=0 |
|
virtual void | Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) |
|
virtual wxRect | DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass) |
|
Definition at line 19 of file TrackSelectHandle.h.
◆ TrackSelectHandle() [1/2]
◆ TrackSelectHandle() [2/2]
TrackSelectHandle::TrackSelectHandle |
( |
const std::shared_ptr< Track > & |
pTrack | ) |
|
|
explicit |
◆ ~TrackSelectHandle()
TrackSelectHandle::~TrackSelectHandle |
( |
| ) |
|
|
virtual |
◆ CalculateRearrangingThresholds()
void TrackSelectHandle::CalculateRearrangingThresholds |
( |
const wxMouseEvent & |
event, |
|
|
AudacityProject * |
project |
|
) |
| |
|
private |
◆ Cancel()
◆ Click()
Implements UIHandle.
Definition at line 68 of file TrackSelectHandle.cpp.
70{
71
72
73
76
77 const wxMouseEvent &event = evt.event;
78
79
80 if (!event.ButtonDown() && !event.ButtonDClick())
82 if (!event.Button(wxMOUSE_BTN_LEFT))
84
86 if (!pTrack)
89
90
91
92
93
94
95 if (unsafe)
97 else {
100 }
101
103 pTrack.get(), event.ShiftDown(), event.ControlDown(), !unsafe);
104
106 return result;
107}
bool IsAudioActive() const
static ProjectAudioIO & Get(AudacityProject &project)
void CalculateRearrangingThresholds(const wxMouseEvent &event, AudacityProject *project)
Namespace containing an enum 'what to do on a refresh?'.
void DoListSelection(AudacityProject &project, Track *t, bool shift, bool ctrl, bool modifyState)
References CalculateRearrangingThresholds(), RefreshCode::Cancelled, SelectUtilities::DoListSelection(), TrackPanelMouseEvent::event, ProjectAudioIO::Get(), ProjectAudioIO::IsAudioActive(), mClicked, mpTrack, mRearrangeCount, and RefreshCode::RefreshNone.
◆ Drag()
Implements UIHandle.
Definition at line 109 of file TrackSelectHandle.cpp.
111{
114
115 const wxMouseEvent &event = evt.event;
116
118
119
121 if (unsafe)
122 return result;
123
127 }
129 || event.m_y > evt.
whole.GetHeight() ) {
130 tracks.MoveDown(
mpTrack.get());
132 }
133 else
134 return result;
135
136
137
139
141 return result;
142}
References CalculateRearrangingThresholds(), RefreshCode::EnsureVisible, TrackPanelMouseEvent::event, ProjectAudioIO::Get(), TrackList::Get(), ProjectAudioIO::IsAudioActive(), mMoveDownThreshold, mMoveUpThreshold, mpTrack, mRearrangeCount, RefreshCode::RefreshAll, RefreshCode::RefreshNone, and TrackPanelMouseEvent::whole.
◆ HitAnywhere()
◆ operator=()
◆ Preview()
Implements UIHandle.
Definition at line 144 of file TrackSelectHandle.cpp.
146{
147 static auto disabledCursor =
148 ::MakeCursor(wxCURSOR_NO_ENTRY, DisabledCursorXpm, 16, 16);
149
150 static auto rearrangingCursor =
151 ::MakeCursor(wxCURSOR_HAND, RearrangingCursorXpm, 16, 16);
152 static wxCursor arrowCursor{ wxCURSOR_ARROW };
153
154
155
156
157
158
160 auto message =
Message(trackCount);
162 const bool unsafe =
165 return {
166 message,
167 (unsafe
168 ? &*disabledCursor
169 : canMove
170 ? &*rearrangingCursor
171 : &arrowCursor)
172
173 };
174 }
175 else {
176
177
178 return {
179 message,
180 &arrowCursor,
181 message
182 };
183 }
184}
std::unique_ptr< wxCursor > MakeCursor(int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
auto Leaders() -> TrackIterRange< TrackType >
TranslatableString Message(unsigned trackCount)
References ProjectAudioIO::Get(), TrackList::Get(), ProjectAudioIO::IsAudioActive(), TrackList::Leaders(), MakeCursor(), mClicked, and anonymous_namespace{TrackSelectHandle.cpp}::Message().
◆ Release()
◆ StopsOnKeystroke()
bool TrackSelectHandle::StopsOnKeystroke |
( |
| ) |
|
|
inlineoverridevirtual |
◆ mClicked
bool TrackSelectHandle::mClicked {} |
|
private |
◆ mMoveDownThreshold
int TrackSelectHandle::mMoveDownThreshold {} |
|
private |
◆ mMoveUpThreshold
int TrackSelectHandle::mMoveUpThreshold {} |
|
private |
◆ mpTrack
std::shared_ptr<Track> TrackSelectHandle::mpTrack |
|
private |
◆ mRearrangeCount
int TrackSelectHandle::mRearrangeCount {} |
|
private |
The documentation for this class was generated from the following files: