Audacity 3.2.0
TrackButtonHandles.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5WavelTrackButtonHandles.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_TRACK_BUTTON_HANDLES__
12#define __AUDACITY_TRACK_BUTTON_HANDLES__
13
14#include "../ui/ButtonHandle.h"
15
16class wxMouseState;
17
19{
21
22protected:
24 (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
25 override;
26
28 const wxMouseState &state, AudacityProject &) const override;
29
30public:
32 ( const std::shared_ptr<Track> &pTrack, const wxRect &rect );
33
35
36 virtual ~MinimizeButtonHandle();
37
38 static UIHandlePtr HitTest
39 (std::weak_ptr<MinimizeButtonHandle> &holder,
40 const wxMouseState &state, const wxRect &rect, TrackPanelCell *pCell);
41};
42
44class SelectButtonHandle final : public ButtonHandle
45{
47
48protected:
50 (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
51 override;
52
54 const wxMouseState &state, AudacityProject &) const override;
55
56public:
57 explicit SelectButtonHandle
58 ( const std::shared_ptr<Track> &pTrack, const wxRect &rect );
59
61
62 virtual ~SelectButtonHandle();
63
64 static UIHandlePtr HitTest
65 (std::weak_ptr<SelectButtonHandle> &holder,
66 const wxMouseState &state, const wxRect &rect, TrackPanelCell *pCell);
67};
68
70class CloseButtonHandle final : public ButtonHandle
71{
73
74protected:
76 (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
77 override;
78
80 const wxMouseState &state, AudacityProject &project) const override;
81
82 bool StopsOnKeystroke () override { return true; }
83
84public:
85 explicit CloseButtonHandle
86 ( const std::shared_ptr<Track> &pTrack, const wxRect &rect );
87
89
90 virtual ~CloseButtonHandle();
91
92 static UIHandlePtr HitTest
93 (std::weak_ptr<CloseButtonHandle> &holder,
94 const wxMouseState &state, const wxRect &rect, TrackPanelCell *pCell);
95};
96
98
99class MenuButtonHandle final : public ButtonHandle
100{
102
103protected:
105 (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
106 override;
107
109 const wxMouseState &state, AudacityProject &) const override;
110
111public:
112 explicit MenuButtonHandle
113 ( const std::shared_ptr<TrackPanelCell> &pCell,
114 const std::shared_ptr<Track> &pTrack, const wxRect &rect );
115
117
118 virtual ~MenuButtonHandle();
119
120 static UIHandlePtr HitTest
121 (std::weak_ptr<MenuButtonHandle> &holder,
122 const wxMouseState &state, const wxRect &rect,
123 const std::shared_ptr<TrackPanelCell> &pCell);
124
125private:
126 std::weak_ptr<TrackPanelCell> mpCell;
127};
128
129#endif
std::shared_ptr< UIHandle > UIHandlePtr
Definition: CellularPanel.h:28
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
A UIHandle for a TrackPanel button, such as the Mute and Solo buttons.
Definition: ButtonHandle.h:26
CloseButtonHandle(const CloseButtonHandle &)=delete
CloseButtonHandle & operator=(const CloseButtonHandle &)=default
bool StopsOnKeystroke() override
static UIHandlePtr HitTest(std::weak_ptr< CloseButtonHandle > &holder, const wxMouseState &state, const wxRect &rect, TrackPanelCell *pCell)
TranslatableString Tip(const wxMouseState &state, AudacityProject &project) const override
Result CommitChanges(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
MenuButtonHandle(const MenuButtonHandle &)=delete
Result CommitChanges(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
static UIHandlePtr HitTest(std::weak_ptr< MenuButtonHandle > &holder, const wxMouseState &state, const wxRect &rect, const std::shared_ptr< TrackPanelCell > &pCell)
TranslatableString Tip(const wxMouseState &state, AudacityProject &) const override
MenuButtonHandle & operator=(const MenuButtonHandle &)=default
std::weak_ptr< TrackPanelCell > mpCell
MinimizeButtonHandle(const MinimizeButtonHandle &)=delete
Result CommitChanges(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
MinimizeButtonHandle & operator=(const MinimizeButtonHandle &)=default
static UIHandlePtr HitTest(std::weak_ptr< MinimizeButtonHandle > &holder, const wxMouseState &state, const wxRect &rect, TrackPanelCell *pCell)
TranslatableString Tip(const wxMouseState &state, AudacityProject &) const override
SelectButtonHandle(const SelectButtonHandle &)=delete
TranslatableString Tip(const wxMouseState &state, AudacityProject &) const override
Result CommitChanges(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
SelectButtonHandle & operator=(const SelectButtonHandle &)=default
static UIHandlePtr HitTest(std::weak_ptr< SelectButtonHandle > &holder, const wxMouseState &state, const wxRect &rect, TrackPanelCell *pCell)
Holds a msgid for the translation catalog; may also bind format arguments.
unsigned Result
Definition: UIHandle.h:40