Audacity 3.2.0
BackgroundCell.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5BackgroundCell.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_BACKGROUND_CELL__
12#define __AUDACITY_BACKGROUND_CELL__
13
14#include "ClientData.h"
16
17class AudacityProject;
18
20class ZoomHandle;
21
22
25class BackgroundCell final
27 , public ClientData::Base
28{
29public:
31 static const BackgroundCell &Get( const AudacityProject &project );
32
33 explicit
35 : mpProject(pProject)
36 {}
37
38 virtual ~BackgroundCell();
39
40protected:
41 std::vector<UIHandlePtr> HitTest
42 (const TrackPanelMouseState &state,
43 const AudacityProject *) override;
44
45 std::shared_ptr<Track> DoFindTrack() override;
46
47private:
48 // TrackPanelDrawable implementation
49 void Draw(
51 const wxRect &rect, unsigned iPass ) override;
52
53 wxRect DrawingArea(
55 const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
56
57 std::vector<MenuItem> GetMenuItems(
58 const wxRect &rect, const wxPoint *pPosition, AudacityProject *pProject )
59 override;
60
62
63 std::weak_ptr<BackgroundHandle> mHandle;
64
65public:
66 // For want of a better place...
67 mutable std::weak_ptr<ZoomHandle> mZoomHandle;
68};
69
70#endif
Utility ClientData::Site to register hooks into a host class that attach client data.
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
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)
BackgroundCell(AudacityProject *pProject)
std::weak_ptr< ZoomHandle > mZoomHandle
std::shared_ptr< Track > DoFindTrack() override
virtual ~BackgroundCell()
AudacityProject * mpProject
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
A convenient default parameter for class template Site.
Definition: ClientData.h:29