25#include <wx/mousestate.h>
28 :
CommonTrackCell{ channel.GetChannelGroup(), channel.GetChannelIndex() }
35 std::vector<UIHandlePtr> results;
38 auto result = std::make_shared<TrackPanelResizeHandle>(
39 pTrack->GetChannel(0), st.
state.m_y );
41 results.push_back(result);
48 const wxRect &rect,
unsigned iPass )
53 auto dc = &context.
dc;
59 dc->DrawRectangle( rect );
71 auto labelw = artist->pZoomInfo->GetLeftOffset() - 1;
74 rect.GetX(), rect.GetY(), labelw, rect.GetHeight() );
77 dc->SetPen(*wxBLACK_PEN);
79 const auto left = rect.GetLeft();
80 AColor::Line( *dc, left, rect.GetTop(), left, rect.GetBottom() );
86 rec.width -= labelw - rec.x;
93 dc->SetBrush(*wxTRANSPARENT_BRUSH);
94 dc->SetPen(*wxBLACK_PEN);
95 const auto left = rec.GetLeft();
96 const auto right = rec.GetRight();
97 const auto top = rec.GetTop();
98 const auto bottom = rec.GetBottom();
110 return std::make_shared<ResizerCellAttachments>(track,
114 return std::make_shared<TrackPanelResizerCell>(
declares abstract base class Track, TrackList, and iterators over TrackList
static const AttachedTrackObjects::RegisteredFactory key
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
static void MediumTrackInfo(wxDC *dc, bool selected)
static void TrackPanelBackground(wxDC *dc, bool selected)
Makes temporary drawing context changes that you back out of, RAII style.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Holds multiple objects of the parameter type as a single attachment to Track.
static Attachment & Get(const AttachedTrackObjects::RegisteredFactory &key, Track &track, size_t iChannel)
virtual size_t NChannels() const =0
Report the number of channels.
std::shared_ptr< ChannelType > GetChannel(size_t iChannel)
Retrieve a channel, cast to the given type.
ChannelGroup & GetChannelGroup()
Channel object's lifetime is assumed to be nested in its Track's.
size_t GetChannelIndex() const
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
std::shared_ptr< Track > FindTrack()
static TrackArtist * Get(TrackPanelDrawingContext &)
Abstract base class for an object holding data associated with points on a time axis.
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
std::weak_ptr< TrackPanelResizeHandle > mResizeHandle
TrackPanelResizerCell(const TrackPanelResizerCell &)=delete
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
static TrackPanelResizerCell & Get(Channel &channel)
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &, const AudacityProject *) override