15#include "../../HitTestResult.h"
17#include "../../RefreshCode.h"
20#include "../../TrackArtist.h"
21#include "../../TrackPanel.h"
22#include "../../TrackPanelConstants.h"
23#include "../../TrackPanelDrawingContext.h"
24#include "../../TrackPanelMouseEvent.h"
25#include "../../UIHandle.h"
45 static wxCursor arrowCursor{ wxCURSOR_ARROW };
46 return { {}, &arrowCursor };
52 std::shared_ptr<const Track>
FindTrack()
const override
59 const wxMouseEvent &
event = evt.
event;
65 if ((event.ButtonDown() || event.ButtonDClick())) {
93 auto result = std::make_shared< BackgroundCell >( &parent );
128 const wxRect &rect,
unsigned iPass )
131 auto &dc = context.
dc;
134 dc.DrawRectangle( rect );
140 const wxRect &rect,
const wxRect &,
unsigned iPass )
157 -> std::vector<MenuItem>
163 { L
"NewMonoTrack",
XO(
"Add Mono Track")},
164 { L
"NewStereoTrack",
XO(
"Add Stereo Track") },
165 { L
"NewLabelTrack",
XO(
"Add Label Track"), },
167 { L
"Export",
XO(
"Export Audio..."), },
169 { L
"SelectAll",
XO(
"Select All") },
static const AudacityProject::AttachedObjects::RegisteredFactory key
declares abstract base class Track, TrackList, and iterators over TrackList
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
static void TrackPanelBackground(wxDC *dc, bool selected)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Class representing the background of a Track. It provides the hit test function that tells us what wa...
static BackgroundCell & Get(AudacityProject &project)
std::vector< MenuItem > GetMenuItems(const wxRect &rect, const wxPoint *pPosition, AudacityProject *pProject) override
Return a list of items for DoContextMenu() (empties for separators)
std::shared_ptr< Track > DoFindTrack() override
virtual ~BackgroundCell()
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *) override
wxRect DrawingArea(TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
std::weak_ptr< BackgroundHandle > mHandle
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
Result Release(const TrackPanelMouseEvent &, AudacityProject *, wxWindow *) override
Result Cancel(AudacityProject *) override
BackgroundHandle(const BackgroundHandle &)=delete
Result Drag(const TrackPanelMouseEvent &, AudacityProject *) override
BackgroundHandle & operator=(const BackgroundHandle &)=delete
std::shared_ptr< const Track > FindTrack() const override
BackgroundHandle & operator=(BackgroundHandle &&)=default
BackgroundHandle(BackgroundHandle &&)=default
virtual ~BackgroundHandle()
HitTestPreview Preview(const TrackPanelMouseState &, AudacityProject *) override
Result Click(const TrackPanelMouseEvent &evt, AudacityProject *pProject) override
static HitTestPreview HitPreview()
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
void SelectNone(TrackList &tracks)
static SelectionState & Get(AudacityProject &project)
static TrackList & Get(AudacityProject &project)
static TrackPanel & Get(AudacityProject &project)
void SetBackgroundCell(const std::shared_ptr< CommonTrackPanelCell > &pCell)
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Namespace containing an enum 'what to do on a refresh?'.