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
44
45class CloseButtonHandle final : public ButtonHandle
46{
48
49protected:
51 (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
52 override;
53
55 const wxMouseState &state, AudacityProject &project) const override;
56
57 bool StopsOnKeystroke () override { return true; }
58
59public:
60 explicit CloseButtonHandle
61 ( const std::shared_ptr<Track> &pTrack, const wxRect &rect );
62
64
65 virtual ~CloseButtonHandle();
66
67 static UIHandlePtr HitTest
68 (std::weak_ptr<CloseButtonHandle> &holder,
69 const wxMouseState &state, const wxRect &rect, TrackPanelCell *pCell);
70};
71
73
74class MenuButtonHandle final : public ButtonHandle
75{
77
78protected:
80 (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
81 override;
82
84 const wxMouseState &state, AudacityProject &) const override;
85
86public:
87 explicit MenuButtonHandle
88 ( const std::shared_ptr<TrackPanelCell> &pCell,
89 const std::shared_ptr<Track> &pTrack, const wxRect &rect );
90
92
93 virtual ~MenuButtonHandle();
94
95 static UIHandlePtr HitTest
96 (std::weak_ptr<MenuButtonHandle> &holder,
97 const wxMouseState &state, const wxRect &rect,
98 const std::shared_ptr<TrackPanelCell> &pCell);
99
100private:
101 std::weak_ptr<TrackPanelCell> mpCell;
102};
103
104#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
Holds a msgid for the translation catalog; may also bind format arguments.
unsigned Result
Definition: UIHandle.h:40