Audacity 3.2.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
UIHandle Class Referenceabstract

Short-lived drawing and event-handling object associated with a TrackPanelCell. More...

#include <UIHandle.h>

Inheritance diagram for UIHandle:
[legend]
Collaboration diagram for UIHandle:
[legend]

Public Types

using Result = unsigned
 
using Cell = TrackPanelCell
 

Public Member Functions

virtual ~UIHandle ()=0
 
virtual void Enter (bool forward, AudacityProject *pProject)
 
virtual bool HasRotation () const
 
virtual bool Rotate (bool forward)
 
virtual bool HasEscape (AudacityProject *pProject) const
 
virtual bool Escape (AudacityProject *pProject)
 
virtual bool HandlesRightClick ()
 Whether the handle has any special right-button handling. More...
 
virtual Result Click (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0
 
virtual Result Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0
 
virtual HitTestPreview Preview (const TrackPanelMouseState &state, AudacityProject *pProject)=0
 
virtual Result Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)=0
 
virtual Result Cancel (AudacityProject *pProject)=0
 
virtual bool StopsOnKeystroke ()
 
virtual void OnProjectChange (AudacityProject *pProject)
 
virtual std::shared_ptr< const TrackFindTrack () const =0
 
virtual bool IsDragging () const
 
Result GetChangeHighlight () const
 
void SetChangeHighlight (Result val)
 
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
 
virtual void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
 
virtual wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)
 

Static Public Member Functions

static UIHandle::Result NeedChangeHighlight (const UIHandle &, const UIHandle &)
 
static std::shared_ptr< const TrackTrackFromChannel (const std::shared_ptr< const Channel > &pChannel)
 A frequent convenience in the definition of UIHandles. More...
 
- Static Public Member Functions inherited from TrackPanelDrawable
static wxRect MaximizeWidth (const wxRect &rect, const wxRect &panelRect)
 
static wxRect MaximizeHeight (const wxRect &rect, const wxRect &panelRect)
 

Protected Attributes

Result mChangeHighlight { 0 }
 

Detailed Description

Short-lived drawing and event-handling object associated with a TrackPanelCell.

Definition at line 36 of file UIHandle.h.

Member Typedef Documentation

◆ Cell

Definition at line 43 of file UIHandle.h.

◆ Result

using UIHandle::Result = unsigned

Definition at line 40 of file UIHandle.h.

Constructor & Destructor Documentation

◆ ~UIHandle()

UIHandle::~UIHandle ( )
pure virtual

Definition at line 15 of file UIHandle.cpp.

16{
17}

Member Function Documentation

◆ Cancel()

virtual Result UIHandle::Cancel ( AudacityProject pProject)
pure virtual

◆ Click()

virtual Result UIHandle::Click ( const TrackPanelMouseEvent event,
AudacityProject pProject 
)
pure virtual

◆ Drag()

virtual Result UIHandle::Drag ( const TrackPanelMouseEvent event,
AudacityProject pProject 
)
pure virtual

◆ Enter()

void UIHandle::Enter ( bool  forward,
AudacityProject pProject 
)
virtual

◆ Escape()

bool UIHandle::Escape ( AudacityProject pProject)
virtual

Reimplemented in AdornedRulerPanel::PlayRegionAdjustingHandle, BrushHandle, and SelectHandle.

Definition at line 38 of file UIHandle.cpp.

39{
40 return false;
41}

◆ FindTrack()

virtual std::shared_ptr< const Track > UIHandle::FindTrack ( ) const
pure virtual

◆ GetChangeHighlight()

Result UIHandle::GetChangeHighlight ( ) const
inline

Definition at line 131 of file UIHandle.h.

131{ return mChangeHighlight; }
Result mChangeHighlight
Definition: UIHandle.h:152

◆ HandlesRightClick()

bool UIHandle::HandlesRightClick ( )
virtual

Whether the handle has any special right-button handling.

If not, then Click() will not be called for right click. Default is always false

Reimplemented in AdornedRulerPanel::CommonRulerHandle, LabelTextHandle, NoteTrackVZoomHandle, CutlineHandle, SpectrumVZoomHandle, WaveformVZoomHandle, WaveTrackAffordanceHandle, TimeTrackVZoomHandle, and ZoomHandle.

Definition at line 43 of file UIHandle.cpp.

44{
45 return false;
46}

◆ HasEscape()

bool UIHandle::HasEscape ( AudacityProject pProject) const
virtual

Reimplemented in AdornedRulerPanel::PlayRegionAdjustingHandle, and SelectHandle.

Definition at line 33 of file UIHandle.cpp.

34{
35 return false;
36}

◆ HasRotation()

bool UIHandle::HasRotation ( ) const
virtual

Definition at line 23 of file UIHandle.cpp.

24{
25 return false;
26}

◆ IsDragging()

bool UIHandle::IsDragging ( ) const
virtual

Whether the handle is dragging, affecting other panel painting; default returns false

Reimplemented in BrushHandle, ButtonHandle, SelectHandle, and SliderHandle.

Definition at line 57 of file UIHandle.cpp.

58{
59 return false;
60}

Referenced by CommonTrackInfo::DrawCloseButton().

Here is the caller graph for this function:

◆ NeedChangeHighlight()

static UIHandle::Result UIHandle::NeedChangeHighlight ( const UIHandle ,
const UIHandle  
)
inlinestatic

Definition at line 138 of file UIHandle.h.

140 {
141 return 0;
142 }

◆ OnProjectChange()

void UIHandle::OnProjectChange ( AudacityProject pProject)
virtual

Definition at line 53 of file UIHandle.cpp.

54{
55}

◆ Preview()

virtual HitTestPreview UIHandle::Preview ( const TrackPanelMouseState state,
AudacityProject pProject 
)
pure virtual

◆ Release()

virtual Result UIHandle::Release ( const TrackPanelMouseEvent event,
AudacityProject pProject,
wxWindow *  pParent 
)
pure virtual

◆ Rotate()

bool UIHandle::Rotate ( bool  forward)
virtual

Definition at line 28 of file UIHandle.cpp.

29{
30 return false;
31}

◆ SetChangeHighlight()

void UIHandle::SetChangeHighlight ( Result  val)
inline

Definition at line 132 of file UIHandle.h.

132{ mChangeHighlight = val; }

Referenced by AffordanceHandle::Enter().

Here is the caller graph for this function:

◆ StopsOnKeystroke()

bool UIHandle::StopsOnKeystroke ( )
virtual

◆ TrackFromChannel()

std::shared_ptr< const Track > UIHandle::TrackFromChannel ( const std::shared_ptr< const Channel > &  pChannel)
static

A frequent convenience in the definition of UIHandles.

Definition at line 63 of file UIHandle.cpp.

64{
65 return pChannel
66 ? static_cast<const Track &>(pChannel->GetChannelGroup())
67 .shared_from_this()
68 : nullptr;
69}
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:110

Referenced by TrackPanelResizeHandle::FindTrack(), SampleHandle::FindTrack(), SpectrumVZoomHandle::FindTrack(), SubViewAdjustHandle::FindTrack(), SubViewRearrangeHandle::FindTrack(), WaveformVZoomHandle::FindTrack(), BrushHandle::FindTrack(), EnvelopeHandle::FindTrack(), and SelectHandle::FindTrack().

Here is the caller graph for this function:

Member Data Documentation

◆ mChangeHighlight

Result UIHandle::mChangeHighlight { 0 }
protected

The documentation for this class was generated from the following files: