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 ChannelFindChannel () 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 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 35 of file UIHandle.h.

Member Typedef Documentation

◆ Cell

Definition at line 42 of file UIHandle.h.

◆ Result

using UIHandle::Result = unsigned

Definition at line 39 of file UIHandle.h.

Constructor & Destructor Documentation

◆ ~UIHandle()

UIHandle::~UIHandle ( )
pure virtual

Definition at line 16 of file UIHandle.cpp.

17{
18}

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 39 of file UIHandle.cpp.

40{
41 return false;
42}

◆ FindChannel()

virtual std::shared_ptr< const Channel > UIHandle::FindChannel ( ) const
pure virtual

◆ GetChangeHighlight()

Result UIHandle::GetChangeHighlight ( ) const
inline

Definition at line 130 of file UIHandle.h.

130{ return mChangeHighlight; }
Result mChangeHighlight
Definition: UIHandle.h:147

◆ 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 44 of file UIHandle.cpp.

45{
46 return false;
47}

◆ HasEscape()

bool UIHandle::HasEscape ( AudacityProject pProject) const
virtual

Reimplemented in AdornedRulerPanel::PlayRegionAdjustingHandle, and SelectHandle.

Definition at line 34 of file UIHandle.cpp.

35{
36 return false;
37}

◆ HasRotation()

bool UIHandle::HasRotation ( ) const
virtual

Definition at line 24 of file UIHandle.cpp.

25{
26 return false;
27}

◆ 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 58 of file UIHandle.cpp.

59{
60 return false;
61}

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 137 of file UIHandle.h.

139 {
140 return 0;
141 }

◆ OnProjectChange()

void UIHandle::OnProjectChange ( AudacityProject pProject)
virtual

Definition at line 54 of file UIHandle.cpp.

55{
56}

◆ 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 29 of file UIHandle.cpp.

30{
31 return false;
32}

◆ SetChangeHighlight()

void UIHandle::SetChangeHighlight ( Result  val)
inline

Definition at line 131 of file UIHandle.h.

131{ mChangeHighlight = val; }

Referenced by AffordanceHandle::Enter().

Here is the caller graph for this function:

◆ StopsOnKeystroke()

bool UIHandle::StopsOnKeystroke ( )
virtual

Member Data Documentation

◆ mChangeHighlight

Result UIHandle::mChangeHighlight { 0 }
protected

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