15#include "../../HitTestResult.h"
19#include "../../RefreshCode.h"
20#include "../../SelectUtilities.h"
21#include "../../TrackPanelMouseEvent.h"
25#include <wx/translation.h>
27#include "../../../images/Cursors.h"
31#define CTRL_CLICK XO("Command+Click")
34#define CTRL_CLICK XO("Ctrl+Click")
42"%s to select or deselect track. Drag up or down to change track order.")
46 return XO(
"%s to select or deselect track.")
56(std::weak_ptr<TrackSelectHandle> &holder,
57 const std::shared_ptr<Track> &pTrack)
59 auto result = std::make_shared<TrackSelectHandle>(pTrack);
82 const wxMouseEvent &
event = evt.
event;
85 if (!event.ButtonDown() && !event.ButtonDClick())
87 if (!event.Button(wxMOUSE_BTN_LEFT))
108 *pTrack, event.ShiftDown(), event.ControlDown(), !unsafe);
122 const wxMouseEvent &
event = evt.
event;
136 || event.m_y > evt.
whole.GetHeight() ) {
154 static auto disabledCursor =
155 ::MakeCursor(wxCURSOR_NO_ENTRY, DisabledCursorXpm, 16, 16);
157 static auto rearrangingCursor =
158 ::MakeCursor(wxCURSOR_HAND, RearrangingCursorXpm, 16, 16);
159 static wxCursor arrowCursor{ wxCURSOR_ARROW };
167 auto message =
Message(trackCount);
177 ? &*rearrangingCursor
std::shared_ptr< UIHandle > UIHandlePtr
declares abstract base class Track, TrackList, and iterators over TrackList
std::unique_ptr< wxCursor > MakeCursor(int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
static int GetChannelGroupHeight(const Track *pTrack)
bool IsAudioActive() const
static ProjectAudioIO & Get(AudacityProject &project)
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
static ProjectHistory & Get(AudacityProject &project)
auto Any() -> TrackIterRange< TrackType >
static TrackList & Get(AudacityProject &project)
std::shared_ptr< const Track > FindTrack() const override
static UIHandlePtr HitAnywhere(std::weak_ptr< TrackSelectHandle > &holder, const std::shared_ptr< Track > &pTrack)
std::shared_ptr< Track > mpTrack
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
void CalculateRearrangingThresholds(const wxMouseEvent &event, AudacityProject *project)
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
virtual ~TrackSelectHandle()
Result Cancel(AudacityProject *) override
TrackSelectHandle(const TrackSelectHandle &)=delete
Holds a msgid for the translation catalog; may also bind format arguments.
Namespace containing an enum 'what to do on a refresh?'.
void DoListSelection(AudacityProject &project, Track &t, bool shift, bool ctrl, bool modifyState)
TranslatableString Message(unsigned trackCount)