Audacity  2.2.2
LabelTrackUI.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 LabelTrackUI.cpp
6 
7 Paul Licameli split from TrackPanel.cpp
8 
9 **********************************************************************/
10 
11 #include "../../../LabelTrack.h"
12 #include "LabelTrackControls.h"
15 #include "LabelGlyphHandle.h"
16 #include "LabelTextHandle.h"
17 
18 #include "../../ui/SelectHandle.h"
19 
20 #include "../../../HitTestResult.h"
21 #include "../../../Project.h"
22 #include "../../../TrackPanelMouseEvent.h"
23 
24 std::vector<UIHandlePtr> LabelTrack::DetailedHitTest
26  const AudacityProject *WXUNUSED(pProject), int, bool)
27 {
28  UIHandlePtr result;
29  std::vector<UIHandlePtr> results;
30  const wxMouseState &state = st.state;
31 
33  mGlyphHandle, state, Pointer<LabelTrack>(this), st.rect);
34  if (result)
35  results.push_back(result);
36 
37  result = LabelTextHandle::HitTest(
38  mTextHandle, state, Pointer<LabelTrack>(this));
39  if (result)
40  results.push_back(result);
41 
42  return results;
43 }
44 
45 std::shared_ptr<TrackControls> LabelTrack::GetControls()
46 {
47  return std::make_shared<LabelTrackControls>( Pointer( this ) );
48 }
49 
50 std::shared_ptr<TrackVRulerControls> LabelTrack::GetVRulerControls()
51 {
52  return std::make_shared<LabelTrackVRulerControls>( Pointer( this ) );
53 }
std::vector< UIHandlePtr > DetailedHitTest(const TrackPanelMouseState &state, const AudacityProject *pProject, int currentTool, bool bMultiTool) override
static UIHandlePtr HitTest(std::weak_ptr< LabelGlyphHandle > &holder, const wxMouseState &state, const std::shared_ptr< LabelTrack > &pLT, const wxRect &rect)
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
std::shared_ptr< TrackControls > GetControls() override
std::shared_ptr< UIHandle > UIHandlePtr
Definition: TrackPanel.h:59
static UIHandlePtr HitTest(std::weak_ptr< LabelTextHandle > &holder, const wxMouseState &state, const std::shared_ptr< LabelTrack > &pLT)
static std::shared_ptr< Subclass > Pointer(Track *t)
Definition: Track.h:136
std::shared_ptr< TrackVRulerControls > GetVRulerControls() override