Audacity  2.2.0
TrackPanelResizeHandle Class Referencefinal

#include <TrackPanelResizeHandle.h>

Inheritance diagram for TrackPanelResizeHandle:
UIHandle

Public Member Functions

 TrackPanelResizeHandle (const std::shared_ptr< Track > &pTrack, int y, const AudacityProject *pProject)
 
TrackPanelResizeHandleoperator= (const TrackPanelResizeHandle &)=default
 
virtual ~TrackPanelResizeHandle ()
 
std::shared_ptr< TrackGetTrack () const
 
Result Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
Result Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
HitTestPreview Preview (const TrackPanelMouseState &state, const AudacityProject *pProject) override
 
Result Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
 
Result Cancel (AudacityProject *pProject) override
 
- Public Member Functions inherited from UIHandle
virtual ~UIHandle ()=0
 
virtual void Enter (bool forward)
 
virtual bool HasRotation () const
 
virtual bool Rotate (bool forward)
 
virtual bool HasEscape () const
 
virtual bool Escape ()
 
virtual void DrawExtras (DrawingPass pass, wxDC *dc, const wxRegion &updateRegion, const wxRect &panelRect)
 
virtual bool StopsOnKeystroke ()
 
virtual void OnProjectChange (AudacityProject *pProject)
 
Result GetChangeHighlight () const
 
void SetChangeHighlight (Result val)
 

Static Public Member Functions

static HitTestPreview HitPreview (bool bLinked)
 
- Static Public Member Functions inherited from UIHandle
static UIHandle::Result NeedChangeHighlight (const UIHandle &, const UIHandle &)
 

Private Types

enum  Mode { IsResizing, IsResizingBetweenLinkedTracks, IsResizingBelowLinkedTracks }
 

Private Member Functions

 TrackPanelResizeHandle (const TrackPanelResizeHandle &)=delete
 

Private Attributes

Mode mMode { IsResizing }
 
std::weak_ptr< TrackmpTrack
 
bool mInitialMinimized {}
 
int mInitialTrackHeight {}
 
int mInitialActualHeight {}
 
int mInitialUpperTrackHeight {}
 
int mInitialUpperActualHeight {}
 
int mMouseClickY {}
 

Additional Inherited Members

- Public Types inherited from UIHandle
enum  DrawingPass { Cells, Panel }
 
using Result = unsigned
 
using Cell = TrackPanelCell
 
- Protected Attributes inherited from UIHandle
Result mChangeHighlight { 0 }
 

Member Enumeration Documentation

Enumerator
IsResizing 
IsResizingBetweenLinkedTracks 
IsResizingBelowLinkedTracks 

Constructor & Destructor Documentation

TrackPanelResizeHandle::TrackPanelResizeHandle ( const TrackPanelResizeHandle )
privatedelete
TrackPanelResizeHandle::TrackPanelResizeHandle ( const std::shared_ptr< Track > &  pTrack,
int  y,
const AudacityProject pProject 
)
explicit
TrackPanelResizeHandle::~TrackPanelResizeHandle ( )
virtual

Member Function Documentation

UIHandle::Result TrackPanelResizeHandle::Click ( const TrackPanelMouseEvent event,
AudacityProject pProject 
)
overridevirtual

Implements UIHandle.

References RefreshCode::RefreshNone.

std::shared_ptr<Track> TrackPanelResizeHandle::GetTrack ( ) const
inline

References mpTrack.

HitTestPreview TrackPanelResizeHandle::HitPreview ( bool  bLinked)
static

When in the resize area we can adjust size or relative size.

References _().

TrackPanelResizeHandle& TrackPanelResizeHandle::operator= ( const TrackPanelResizeHandle )
default
HitTestPreview TrackPanelResizeHandle::Preview ( const TrackPanelMouseState state,
const AudacityProject pProject 
)
overridevirtual

Implements UIHandle.

UIHandle::Result TrackPanelResizeHandle::Release ( const TrackPanelMouseEvent event,
AudacityProject pProject,
wxWindow *  pParent 
)
overridevirtual

This happens when the button is released from a drag. Since we actually took care of resizing the track when we got drag events, all we have to do here is clean up. We also modify the undo state (the action doesn't become undo-able, but it gets merged with the previous undo-able event).

Implements UIHandle.

References RefreshCode::FixScrollbars, and AudacityProject::ModifyState().

Member Data Documentation

int TrackPanelResizeHandle::mInitialActualHeight {}
private

Referenced by Cancel().

bool TrackPanelResizeHandle::mInitialMinimized {}
private

Referenced by Cancel().

int TrackPanelResizeHandle::mInitialTrackHeight {}
private
int TrackPanelResizeHandle::mInitialUpperActualHeight {}
private

Referenced by Cancel().

int TrackPanelResizeHandle::mInitialUpperTrackHeight {}
private
Mode TrackPanelResizeHandle::mMode { IsResizing }
private

Referenced by Cancel().

int TrackPanelResizeHandle::mMouseClickY {}
private
std::weak_ptr<Track> TrackPanelResizeHandle::mpTrack
private

Referenced by Cancel(), and GetTrack().


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