Audacity 3.2.0
LabelTextHandle.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5LabelTextHandle.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_LABEL_TEXT_HANDLE__
12#define __AUDACITY_LABEL_TEXT_HANDLE__
13
15#include "SelectedRegion.h"
16
17class wxMouseState;
18class LabelTrack;
20class ZoomInfo;
21
23{
25
26public:
27 static UIHandlePtr HitTest
28 (std::weak_ptr<LabelTextHandle> &holder,
29 const wxMouseState &state, const std::shared_ptr<LabelTrack> &pLT);
30
32
33 explicit LabelTextHandle
34 ( const std::shared_ptr<LabelTrack> &pLT, int labelNum );
35 virtual ~LabelTextHandle();
36
37 std::shared_ptr<const Channel> FindChannel() const override;
38 int GetLabelNum() const { return mLabelNum; }
39
40 void Enter(bool forward, AudacityProject *) override;
41
42 bool HandlesRightClick() override;
43
45 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
46
48 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
49
51 (const TrackPanelMouseState &state, AudacityProject *pProject)
52 override;
53
55 (const TrackPanelMouseEvent &event, AudacityProject *pProject,
56 wxWindow *pParent) override;
57
58 Result Cancel(AudacityProject *pProject) override;
59
60private:
62 (AudacityProject &project, const wxMouseEvent & evt);
64 AudacityProject &project, const wxMouseEvent & evt);
65
66 std::weak_ptr<LabelTrack> mpLT {};
67 int mLabelNum{ -1 };
70
72 bool mRightDragging{ false };
73};
74
75#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
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Result Cancel(AudacityProject *pProject) override
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
void HandleTextDragRelease(AudacityProject &project, const wxMouseEvent &evt)
virtual ~LabelTextHandle()
static UIHandlePtr HitTest(std::weak_ptr< LabelTextHandle > &holder, const wxMouseState &state, const std::shared_ptr< LabelTrack > &pLT)
void HandleTextClick(AudacityProject &project, const wxMouseEvent &evt)
bool mRightDragging
flag to tell if it's a valid dragging
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
void Enter(bool forward, AudacityProject *) override
LabelTextHandle(const std::shared_ptr< LabelTrack > &pLT, int labelNum)
bool HandlesRightClick() override
Whether the handle has any special right-button handling.
static HitTestPreview HitPreview()
LabelTextHandle & operator=(const LabelTextHandle &)=default
std::weak_ptr< LabelTrack > mpLT
std::shared_ptr< const Channel > FindChannel() const override
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
int GetLabelNum() const
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:87
unsigned Result
Definition: UIHandle.h:39