Audacity  2.2.0
LabelDefaultClickHandle.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 LabelDefaultClickHandle.h
6 
7 Paul Licameli split from TrackPanel.cpp
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_LABEL_DEFAULT_CLICK_HANDLE__
12 #define __AUDACITY_LABEL_DEFAULT_CLICK_HANDLE__
13 
14 #include "../../../UIHandle.h"
15 #include "../../../MemoryX.h"
16 
17 class wxMouseEvent;
18 class LabelTrack;
19 
20 // Used as a base class.
21 // Adds some behavior to clicks.
22 class LabelDefaultClickHandle /* not final */ : public UIHandle
23 {
24 public:
26  virtual ~LabelDefaultClickHandle();
27 
28  LabelDefaultClickHandle &operator=
29  (const LabelDefaultClickHandle&) = default;
30 
32  (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
33 
34  Result Drag
35  (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
36 
37  // does not override Preview()
38 
40  (const TrackPanelMouseEvent &event, AudacityProject *pProject,
41  wxWindow *pParent) override;
42 
43  Result Cancel(AudacityProject *pProject) override;
44 
45 private:
46  struct LabelState;
47  std::shared_ptr< LabelState > mLabelState;
48  void SaveState( AudacityProject *pProject );
49  void RestoreState( AudacityProject *pProject );
50 };
51 
52 #endif
std::shared_ptr< LabelState > mLabelState
Definition: LabelDefaultClickHandle.h:46
Result Cancel(AudacityProject *pProject) override
Definition: LabelDefaultClickHandle.cpp:104
Definition: LabelDefaultClickHandle.cpp:28
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: LabelDefaultClickHandle.cpp:91
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:114
virtual ~LabelDefaultClickHandle()
Definition: LabelDefaultClickHandle.cpp:24
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:161
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: LabelDefaultClickHandle.cpp:63
LabelDefaultClickHandle()
Definition: LabelDefaultClickHandle.cpp:20
unsigned Result
Definition: UIHandle.h:37
void SaveState(AudacityProject *pProject)
Definition: LabelDefaultClickHandle.cpp:32
void RestoreState(AudacityProject *pProject)
Definition: LabelDefaultClickHandle.cpp:52
Definition: UIHandle.h:33
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
Definition: LabelDefaultClickHandle.cpp:97
Definition: LabelDefaultClickHandle.h:22
Definition: TrackPanelMouseEvent.h:41