Audacity 3.2.0
|
Constructed from one channel, but changes height of all channels in a track. More...
#include <TrackPanelResizeHandle.h>
Public Member Functions | |
TrackPanelResizeHandle (const std::shared_ptr< Channel > &pChannel, int y) | |
TrackPanelResizeHandle & | operator= (const TrackPanelResizeHandle &)=default |
virtual | ~TrackPanelResizeHandle () |
std::shared_ptr< const Track > | FindTrack () const override |
std::shared_ptr< Channel > | FindChannel () |
Result | Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) override |
Result | Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) override |
HitTestPreview | Preview (const TrackPanelMouseState &state, 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, 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) |
Static Public Member Functions | |
static HitTestPreview | HitPreview (bool bLinked) |
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) |
Private Types | |
enum | Mode { IsResizing , IsResizingBetweenLinkedTracks , IsResizingBelowLinkedTracks } |
Private Member Functions | |
TrackPanelResizeHandle (const TrackPanelResizeHandle &)=delete | |
Channel * | PrevChannel (Channel &channel) |
Channel * | NextChannel (Channel &channel) |
Static Private Member Functions | |
static Track & | GetTrack (Channel &channel) |
Private Attributes | |
Mode | mMode { IsResizing } |
std::weak_ptr< Channel > | mwChannel |
bool | mInitialMinimized {} |
int | mInitialTrackHeight {} |
int | mInitialExpandedHeight {} |
int | mInitialUpperTrackHeight {} |
int | mInitialUpperExpandedHeight {} |
int | mMouseClickY {} |
Additional Inherited Members | |
Public Types inherited from UIHandle | |
using | Result = unsigned |
using | Cell = TrackPanelCell |
Protected Attributes inherited from UIHandle | |
Result | mChangeHighlight { 0 } |
Constructed from one channel, but changes height of all channels in a track.
Definition at line 20 of file TrackPanelResizeHandle.h.
|
private |
Enumerator | |
---|---|
IsResizing | |
IsResizingBetweenLinkedTracks | |
IsResizingBelowLinkedTracks |
Definition at line 60 of file TrackPanelResizeHandle.h.
|
privatedelete |
TrackPanelResizeHandle::TrackPanelResizeHandle | ( | const std::shared_ptr< Channel > & | pChannel, |
int | y | ||
) |
pChannel != nullptr
Definition at line 96 of file TrackPanelResizeHandle.cpp.
References ChannelGroup::Channels(), ChannelView::Get(), GetTrack(), IsResizing, IsResizingBelowLinkedTracks, IsResizingBetweenLinkedTracks, mInitialExpandedHeight, mInitialMinimized, mInitialTrackHeight, mInitialUpperExpandedHeight, mInitialUpperTrackHeight, and mMode.
|
virtual |
Definition at line 52 of file TrackPanelResizeHandle.cpp.
|
overridevirtual |
Implements UIHandle.
Definition at line 293 of file TrackPanelResizeHandle.cpp.
References RefreshCode::Cancelled, FindChannel(), TrackList::Get(), ChannelView::Get(), IsResizing, IsResizingBelowLinkedTracks, IsResizingBetweenLinkedTracks, mInitialExpandedHeight, mInitialMinimized, mInitialUpperExpandedHeight, mMode, NextChannel(), PrevChannel(), RefreshCode::RefreshAll, and tracks.
|
overridevirtual |
Implements UIHandle.
Definition at line 66 of file TrackPanelResizeHandle.cpp.
References Cancelled, ChannelGroup::Channels(), TrackPanelMouseEvent::event, FindChannel(), ProjectHistory::Get(), TrackList::Get(), ChannelView::Get(), ChannelView::GetHeight(), GetTrack(), IsResizingBetweenLinkedTracks, mMode, ProjectHistory::ModifyState(), RefreshCode::RefreshAll, RefreshCode::RefreshNone, ChannelView::SetExpandedHeight(), size, and tracks.
|
overridevirtual |
Implements UIHandle.
Definition at line 148 of file TrackPanelResizeHandle.cpp.
References RefreshCode::Cancelled, ChannelGroup::Channels(), TrackPanelMouseEvent::event, FindChannel(), TrackList::Get(), ChannelView::Get(), GetTrack(), IsResizing, IsResizingBelowLinkedTracks, IsResizingBetweenLinkedTracks, mInitialTrackHeight, mInitialUpperTrackHeight, mMode, mMouseClickY, NextChannel(), PrevChannel(), RefreshCode::RefreshAll, RefreshCode::RefreshNone, and tracks.
std::shared_ptr< Channel > TrackPanelResizeHandle::FindChannel | ( | ) |
|
overridevirtual |
Implements UIHandle.
Definition at line 56 of file TrackPanelResizeHandle.cpp.
References mwChannel, and UIHandle::TrackFromChannel().
Definition at line 338 of file TrackPanelResizeHandle.cpp.
References Channel::GetChannelGroup().
Referenced by Click(), Drag(), NextChannel(), PrevChannel(), and TrackPanelResizeHandle().
|
static |
When in the resize area we can adjust size or relative size.
Definition at line 25 of file TrackPanelResizeHandle.cpp.
References XO().
Referenced by Preview().
Definition at line 140 of file TrackPanelResizeHandle.cpp.
References ChannelGroup::Channels(), and GetTrack().
Referenced by Cancel(), and Drag().
|
default |
Definition at line 132 of file TrackPanelResizeHandle.cpp.
References ChannelGroup::Channels(), and GetTrack().
Referenced by Cancel(), and Drag().
|
overridevirtual |
Implements UIHandle.
Definition at line 273 of file TrackPanelResizeHandle.cpp.
References HitPreview(), IsResizingBetweenLinkedTracks, and mMode.
|
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.
Definition at line 279 of file TrackPanelResizeHandle.cpp.
References RefreshCode::FixScrollbars, ProjectHistory::Get(), and ProjectHistory::ModifyState().
|
private |
Definition at line 71 of file TrackPanelResizeHandle.h.
Referenced by Cancel(), and TrackPanelResizeHandle().
|
private |
Definition at line 69 of file TrackPanelResizeHandle.h.
Referenced by Cancel(), and TrackPanelResizeHandle().
|
private |
Definition at line 70 of file TrackPanelResizeHandle.h.
Referenced by Drag(), and TrackPanelResizeHandle().
|
private |
Definition at line 73 of file TrackPanelResizeHandle.h.
Referenced by Cancel(), and TrackPanelResizeHandle().
|
private |
Definition at line 72 of file TrackPanelResizeHandle.h.
Referenced by Drag(), and TrackPanelResizeHandle().
|
private |
Definition at line 65 of file TrackPanelResizeHandle.h.
Referenced by Cancel(), Click(), Drag(), Preview(), and TrackPanelResizeHandle().
|
private |
Definition at line 75 of file TrackPanelResizeHandle.h.
Referenced by Drag().
|
private |
Definition at line 67 of file TrackPanelResizeHandle.h.
Referenced by FindChannel(), and FindTrack().