#include <TrackSelectHandle.h>
|
| TrackSelectHandle (const std::shared_ptr< Track > &pTrack) |
|
TrackSelectHandle & | operator= (const TrackSelectHandle &)=default |
|
virtual | ~TrackSelectHandle () |
|
std::shared_ptr< const Track > | FindTrack () const override |
|
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) |
|
virtual std::shared_ptr< const Track > | FindTrack () const =0 |
|
virtual bool | IsDragging () const |
|
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 73 of file TrackSelectHandle.cpp.
75{
76
77
78
81
82 const wxMouseEvent &event = evt.event;
83
84
85 if (!event.ButtonDown() && !event.ButtonDClick())
87 if (!event.Button(wxMOUSE_BTN_LEFT))
89
91 if (!pTrack)
94
95
96
97
98
99
100 if (unsafe)
102 else {
105 }
106
108 *pTrack, event.ShiftDown(), event.ControlDown(), !unsafe);
109
111 return result;
112}
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(), Cancelled, SelectUtilities::DoListSelection(), TrackPanelMouseEvent::event, ProjectAudioIO::Get(), ProjectAudioIO::IsAudioActive(), mClicked, mpTrack, mRearrangeCount, and RefreshCode::RefreshNone.
◆ Drag()
Implements UIHandle.
Definition at line 114 of file TrackSelectHandle.cpp.
116{
120 return result;
121
122 const wxMouseEvent &event = evt.event;
123
125
126
128 if (unsafe)
129 return result;
130
134 }
136 || event.m_y > evt.
whole.GetHeight() ) {
139 }
140 else
141 return result;
142
143
144
146
148 return result;
149}
References CalculateRearrangingThresholds(), RefreshCode::EnsureVisible, TrackPanelMouseEvent::event, ProjectAudioIO::Get(), TrackList::Get(), ProjectAudioIO::IsAudioActive(), mMoveDownThreshold, mMoveUpThreshold, mpTrack, mRearrangeCount, RefreshCode::RefreshAll, RefreshCode::RefreshNone, tracks, and TrackPanelMouseEvent::whole.
◆ FindTrack()
std::shared_ptr< const Track > TrackSelectHandle::FindTrack |
( |
| ) |
const |
|
overridevirtual |
◆ HitAnywhere()
◆ operator=()
◆ Preview()
Implements UIHandle.
Definition at line 151 of file TrackSelectHandle.cpp.
153{
154 static auto disabledCursor =
155 ::MakeCursor(wxCURSOR_NO_ENTRY, DisabledCursorXpm, 16, 16);
156
157 static auto rearrangingCursor =
158 ::MakeCursor(wxCURSOR_HAND, RearrangingCursorXpm, 16, 16);
159 static wxCursor arrowCursor{ wxCURSOR_ARROW };
160
161
162
163
164
165
167 auto message =
Message(trackCount);
169 const bool unsafe =
172 return {
173 message,
174 (unsafe
175 ? &*disabledCursor
176 : canMove
177 ? &*rearrangingCursor
178 : &arrowCursor)
179
180 };
181 }
182 else {
183
184
185 return {
186 message,
187 &arrowCursor,
188 message
189 };
190 }
191}
std::unique_ptr< wxCursor > MakeCursor(int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
auto Any() -> TrackIterRange< TrackType >
TranslatableString Message(unsigned trackCount)
References TrackList::Any(), ProjectAudioIO::Get(), TrackList::Get(), ProjectAudioIO::IsAudioActive(), 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: