Audacity 3.2.0
|
A UIHandle for a TrackPanel button, such as the Mute and Solo buttons. More...
#include <ButtonHandle.h>
Public Member Functions | |
std::shared_ptr< Track > | GetTrack () const |
bool | IsDragging () const override |
Public Member Functions inherited from UIHandle | |
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 Track > | FindTrack () 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) |
Protected Member Functions | |
ButtonHandle (const std::shared_ptr< Track > &pTrack, const wxRect &rect) | |
ButtonHandle & | operator= (const ButtonHandle &)=default |
virtual | ~ButtonHandle () |
std::shared_ptr< const Track > | FindTrack () const override |
virtual Result | CommitChanges (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)=0 |
virtual TranslatableString | Tip (const wxMouseState &state, AudacityProject &project) const =0 |
void | Enter (bool forward, AudacityProject *) final override |
Result | Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) final override |
Result | Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) final override |
HitTestPreview | Preview (const TrackPanelMouseState &state, AudacityProject *pProject) final override |
Result | Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) final override |
Result | Cancel (AudacityProject *pProject) final override |
Protected Attributes | |
std::weak_ptr< Track > | mpTrack |
wxRect | mRect |
bool | mWasIn { true } |
bool | mIsDragging {} |
Protected Attributes inherited from UIHandle | |
Result | mChangeHighlight { 0 } |
Private Member Functions | |
ButtonHandle (const ButtonHandle &)=delete | |
Additional Inherited Members | |
Public Types inherited from UIHandle | |
using | Result = unsigned |
using | Cell = TrackPanelCell |
Static Public Member Functions inherited from UIHandle | |
static UIHandle::Result | NeedChangeHighlight (const UIHandle &, const UIHandle &) |
static std::shared_ptr< const Track > | TrackFromChannel (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) |
A UIHandle for a TrackPanel button, such as the Mute and Solo buttons.
Definition at line 25 of file ButtonHandle.h.
|
privatedelete |
|
explicitprotected |
Definition at line 21 of file ButtonHandle.cpp.
|
protectedvirtual |
Definition at line 28 of file ButtonHandle.cpp.
|
finaloverrideprotectedvirtual |
Implements UIHandle.
Definition at line 111 of file ButtonHandle.cpp.
References RefreshCode::RefreshCell.
|
finaloverrideprotectedvirtual |
Implements UIHandle.
Definition at line 47 of file ButtonHandle.cpp.
References Cancelled, TrackPanelMouseEvent::event, TrackList::Get(), TrackList::Lock(), mIsDragging, mpTrack, mRect, mWasIn, and RefreshCode::RefreshCell.
|
protectedpure virtual |
Implemented in MuteButtonHandle, SoloButtonHandle, EffectsButtonHandle, SubViewCloseHandle, MinimizeButtonHandle, CloseButtonHandle, and MenuButtonHandle.
Referenced by Release().
|
finaloverrideprotectedvirtual |
Implements UIHandle.
Definition at line 70 of file ButtonHandle.cpp.
References Cancelled, TrackPanelMouseEvent::event, TrackList::Get(), TrackList::Lock(), mpTrack, mRect, mWasIn, RefreshCode::RefreshCell, and RefreshCode::RefreshNone.
|
finaloverrideprotectedvirtual |
Reimplemented from UIHandle.
Definition at line 42 of file ButtonHandle.cpp.
References UIHandle::mChangeHighlight, and RefreshCode::RefreshCell.
|
overrideprotectedvirtual |
Implements UIHandle.
Definition at line 32 of file ButtonHandle.cpp.
References mpTrack.
Referenced by MenuButtonHandle::CommitChanges(), CloseButtonHandle::HitTest(), MenuButtonHandle::HitTest(), and MinimizeButtonHandle::HitTest().
|
inline |
Definition at line 30 of file ButtonHandle.h.
Referenced by anonymous_namespace{PlayableTrackControls.cpp}::EffectsDrawFunction(), anonymous_namespace{PlayableTrackControls.cpp}::MuteAndSoloDrawFunction(), MuteButtonHandle::Tip(), SoloButtonHandle::Tip(), EffectsButtonHandle::Tip(), MinimizeButtonHandle::Tip(), MenuButtonHandle::Tip(), CloseButtonHandle::Tip(), anonymous_namespace{PlayableTrackControls.cpp}::WideMuteDrawFunction(), and anonymous_namespace{PlayableTrackControls.cpp}::WideSoloDrawFunction().
|
overridevirtual |
Whether the handle is dragging, affecting other panel painting; default returns false
Reimplemented from UIHandle.
Definition at line 37 of file ButtonHandle.cpp.
References mIsDragging.
|
protecteddefault |
|
finaloverrideprotectedvirtual |
Implements UIHandle.
Definition at line 85 of file ButtonHandle.cpp.
References project, TrackPanelMouseState::state, and Tip().
|
finaloverrideprotectedvirtual |
Implements UIHandle.
Definition at line 95 of file ButtonHandle.cpp.
References Cancelled, CommitChanges(), TrackPanelMouseEvent::event, TrackList::Get(), TrackList::Lock(), mpTrack, mRect, RefreshCode::RefreshCell, and RefreshCode::RefreshNone.
|
protectedpure virtual |
Implemented in MuteButtonHandle, SoloButtonHandle, EffectsButtonHandle, MinimizeButtonHandle, MenuButtonHandle, SubViewCloseHandle, and CloseButtonHandle.
Referenced by Preview().
|
protected |
Definition at line 77 of file ButtonHandle.h.
Referenced by Click(), and IsDragging().
|
protected |
Definition at line 74 of file ButtonHandle.h.
Referenced by Click(), MuteButtonHandle::CommitChanges(), SoloButtonHandle::CommitChanges(), EffectsButtonHandle::CommitChanges(), MinimizeButtonHandle::CommitChanges(), CloseButtonHandle::CommitChanges(), Drag(), FindTrack(), and Release().
|
protected |
Definition at line 75 of file ButtonHandle.h.
|
protected |
Definition at line 76 of file ButtonHandle.h.