mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 09:09:47 +02:00
... those handles that force a simulated button-up when play interrupts drag, and can assume that pointers to tracks remain nonNULL and part of the current project state (not the undo history). Also pass shared_ptr to Track into more hit test routines.
50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
/**********************************************************************
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
LabelTrackUI.cpp
|
|
|
|
Paul Licameli split from TrackPanel.cpp
|
|
|
|
**********************************************************************/
|
|
|
|
#include "../../../LabelTrack.h"
|
|
#include "LabelTrackControls.h"
|
|
#include "LabelDefaultClickHandle.h"
|
|
#include "LabelTrackVRulerControls.h"
|
|
#include "LabelGlyphHandle.h"
|
|
#include "LabelTextHandle.h"
|
|
|
|
#include "../../ui/SelectHandle.h"
|
|
|
|
#include "../../../HitTestResult.h"
|
|
#include "../../../Project.h"
|
|
#include "../../../TrackPanelMouseEvent.h"
|
|
|
|
HitTestResult LabelTrack::DetailedHitTest
|
|
(const TrackPanelMouseEvent &evt,
|
|
const AudacityProject *pProject, int, bool)
|
|
{
|
|
HitTestResult result;
|
|
const wxMouseEvent &event = evt.event;
|
|
|
|
// Try label movement handles first
|
|
result = LabelGlyphHandle::HitTest(event, Pointer<LabelTrack>(this));
|
|
|
|
if ( !result.handle )
|
|
// Missed glyph, try text box
|
|
result = LabelTextHandle::HitTest(event, Pointer<LabelTrack>(this));
|
|
|
|
return result;
|
|
}
|
|
|
|
std::shared_ptr<TrackControls> LabelTrack::GetControls()
|
|
{
|
|
return std::make_shared<LabelTrackControls>( Pointer( this ) );
|
|
}
|
|
|
|
std::shared_ptr<TrackVRulerControls> LabelTrack::GetVRulerControls()
|
|
{
|
|
return std::make_shared<LabelTrackVRulerControls>( Pointer( this ) );
|
|
}
|