Audacity 3.2.0
|
#include <ZoomHandle.h>
Public Member Functions | |
ZoomHandle () | |
ZoomHandle & | operator= (const ZoomHandle &)=default |
virtual | ~ZoomHandle () |
std::shared_ptr< const Track > | FindTrack () const override |
bool | HandlesRightClick () override |
Whether the handle has any special right-button handling. More... | |
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 UIHandlePtr | HitAnywhere (std::weak_ptr< ZoomHandle > &holder) |
static UIHandlePtr | HitTest (std::weak_ptr< ZoomHandle > &holder, const wxMouseState &state) |
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 Member Functions | |
ZoomHandle (const ZoomHandle &)=delete | |
void | Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override |
wxRect | DrawingArea (TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override |
bool | IsDragZooming () const |
Static Private Member Functions | |
static HitTestPreview | HitPreview (const wxMouseState &state, const AudacityProject *pProject) |
Private Attributes | |
int | mZoomStart {} |
int | mZoomEnd {} |
wxRect | mRect {} |
Additional Inherited Members | |
Public Types inherited from UIHandle | |
using | Result = unsigned |
using | Cell = TrackPanelCell |
Protected Attributes inherited from UIHandle | |
Result | mChangeHighlight { 0 } |
Definition at line 19 of file ZoomHandle.h.
|
privatedelete |
ZoomHandle::ZoomHandle | ( | ) |
This class takes care of our different zoom possibilities. It is possible for a user to just "zoom in" or "zoom out," but it is also possible for a user to drag and select an area that he or she wants to be zoomed in on. We use mZoomStart and mZoomEnd to track the beginning and end of such a zoom area. Note that the ViewInfo actually keeps track of our zoom constant, so we achieve zooming by altering the zoom constant and forcing a refresh.
Definition at line 39 of file ZoomHandle.cpp.
|
virtual |
Definition at line 82 of file ZoomHandle.cpp.
|
overridevirtual |
Implements UIHandle.
Definition at line 191 of file ZoomHandle.cpp.
References RefreshCode::RefreshAll.
|
overridevirtual |
Zoom button down, record the position.
Implements UIHandle.
Definition at line 96 of file ZoomHandle.cpp.
References TrackPanelMouseEvent::event, mRect, mZoomEnd, mZoomStart, TrackPanelMouseEvent::rect, and RefreshCode::RefreshNone.
|
overridevirtual |
Implements UIHandle.
Definition at line 109 of file ZoomHandle.cpp.
References TrackPanelMouseEvent::event, mRect, mZoomEnd, and RefreshCode::RefreshAll.
|
overrideprivatevirtual |
Reimplemented from TrackPanelDrawable.
Definition at line 198 of file ZoomHandle.cpp.
References TrackPanelDrawingContext::dc, IsDragZooming(), min(), mZoomEnd, mZoomStart, and TrackArtist::PassZooming.
|
overrideprivatevirtual |
Reimplemented from TrackPanelDrawable.
Definition at line 220 of file ZoomHandle.cpp.
References TrackPanelDrawable::MaximizeHeight(), and TrackArtist::PassZooming.
|
overridevirtual |
Implements UIHandle.
Definition at line 86 of file ZoomHandle.cpp.
|
overridevirtual |
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 from UIHandle.
Definition at line 91 of file ZoomHandle.cpp.
|
static |
Definition at line 64 of file ZoomHandle.cpp.
References AssignUIHandlePtr().
Referenced by HitTest().
|
staticprivate |
Definition at line 42 of file ZoomHandle.cpp.
References MakeCursor(), and XO().
Referenced by Preview().
|
static |
Definition at line 72 of file ZoomHandle.cpp.
References HitAnywhere().
Referenced by CommonChannelView::HitTest().
|
private |
Definition at line 230 of file ZoomHandle.cpp.
References DragThreshold, mZoomEnd, and mZoomStart.
Referenced by Draw(), and Release().
|
default |
|
overridevirtual |
Implements UIHandle.
Definition at line 130 of file ZoomHandle.cpp.
References HitPreview(), and TrackPanelMouseState::state.
|
overridevirtual |
This actually sets the Zoom value when you're done doing a drag zoom.
This handles normal Zoom In/Out, if you just clicked; IOW, if you were NOT dragging to zoom an area.
Implements UIHandle.
Definition at line 136 of file ZoomHandle.cpp.
References TrackPanelMouseEvent::event, RefreshCode::FixScrollbars, ViewInfo::Get(), ZoomInfo::GetDefaultZoom(), IsDragZooming(), mRect, mZoomEnd, mZoomStart, RefreshCode::RefreshAll, and anonymous_namespace{NoteTrack.cpp}::swap().
|
private |
Definition at line 71 of file ZoomHandle.h.
|
private |
Definition at line 70 of file ZoomHandle.h.
Referenced by Click(), Drag(), Draw(), IsDragZooming(), and Release().
|
private |
Definition at line 70 of file ZoomHandle.h.
Referenced by Click(), Draw(), IsDragZooming(), and Release().