Distinguish TrackPanelMouseState from TrackPanelMouseEvent...
... Let cell hit tests, and handle preview, know states only, not transitions. Cell hit tests are passed a mouse state that does not always match the current, but anticipates the button click to come; usually left, but if the Control [sic] key on Mac is down, then right. Thus, pressing and releasing Mac Control in multi-tool switches in and out of the magnifier cursor.
This commit is contained in:
parent
c1f667f170
commit
3a8280c562
|
@ -122,7 +122,7 @@ class AUDACITY_DLL_API LabelTrack final : public Track
|
|||
virtual ~ LabelTrack();
|
||||
|
||||
HitTestResult DetailedHitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject, int currentTool, bool bMultiTool)
|
||||
override;
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class AUDACITY_DLL_API NoteTrack final
|
|||
virtual ~NoteTrack();
|
||||
|
||||
HitTestResult DetailedHitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject, int currentTool, bool bMultiTool)
|
||||
override;
|
||||
|
||||
|
|
|
@ -1384,7 +1384,7 @@ void AudacityProject::RedrawProject(const bool bForceWaveTracks /*= false*/)
|
|||
|
||||
void AudacityProject::RefreshCursor()
|
||||
{
|
||||
mTrackPanel->HandleCursorForLastMouseEvent();
|
||||
mTrackPanel->HandleCursorForLastMouseState();
|
||||
}
|
||||
|
||||
void AudacityProject::SetSel0(double newSel0)
|
||||
|
|
|
@ -50,7 +50,7 @@ class TimeTrack final : public Track {
|
|||
void InsertSilence(double t, double len) override;
|
||||
|
||||
HitTestResult DetailedHitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject, int currentTool, bool bMultiTool)
|
||||
override;
|
||||
|
||||
|
|
|
@ -134,14 +134,14 @@ class AUDACITY_DLL_API Track /* not final */
|
|||
// uniformly in all tracks, disregarding track contents.
|
||||
// Do not further override this...
|
||||
HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &, const AudacityProject *pProject)
|
||||
final;
|
||||
|
||||
public:
|
||||
|
||||
// Rather override this for subclasses:
|
||||
virtual HitTestResult DetailedHitTest
|
||||
(const TrackPanelMouseEvent &,
|
||||
(const TrackPanelMouseState &,
|
||||
const AudacityProject *pProject, int currentTool, bool bMultiTool)
|
||||
= 0;
|
||||
|
||||
|
|
|
@ -790,24 +790,31 @@ bool TrackPanel::HandleEscapeKey(bool down)
|
|||
return false;
|
||||
}
|
||||
|
||||
void TrackPanel::HandleAltKey(bool down)
|
||||
void TrackPanel::UpdateMouseState(const wxMouseState &state)
|
||||
{
|
||||
mLastMouseEvent.m_altDown = down;
|
||||
HandleCursorForLastMouseEvent();
|
||||
mLastMouseState = state;
|
||||
|
||||
// Simulate a down button if none, so hit test routines can anticipate
|
||||
// which button will be clicked
|
||||
if (!state.ButtonIsDown(wxMOUSE_BTN_ANY)) {
|
||||
#ifdef __WXOSX__
|
||||
if (state.RawControlDown())
|
||||
// On Mac we can distinctly anticipate "right" click (as Control+click)
|
||||
mLastMouseState.SetRightDown( true ),
|
||||
mLastMouseState.SetLeftDown( false );
|
||||
else
|
||||
#endif
|
||||
// Anticipate a left click by default
|
||||
mLastMouseState.SetRightDown( false ),
|
||||
mLastMouseState.SetLeftDown( true );
|
||||
}
|
||||
}
|
||||
|
||||
void TrackPanel::HandleShiftKey(bool down)
|
||||
void TrackPanel::HandleModifierKey()
|
||||
{
|
||||
mLastMouseEvent.m_shiftDown = down;
|
||||
HandleCursorForLastMouseEvent();
|
||||
UpdateMouseState(::wxGetMouseState());
|
||||
HandleCursorForLastMouseState();
|
||||
}
|
||||
|
||||
void TrackPanel::HandleControlKey(bool down)
|
||||
{
|
||||
mLastMouseEvent.m_controlDown = down;
|
||||
HandleCursorForLastMouseEvent();
|
||||
}
|
||||
|
||||
void TrackPanel::HandlePageUpKey()
|
||||
{
|
||||
mListener->TP_ScrollWindow(2 * mViewInfo->h - GetScreenEndTime());
|
||||
|
@ -818,12 +825,12 @@ void TrackPanel::HandlePageDownKey()
|
|||
mListener->TP_ScrollWindow(GetScreenEndTime());
|
||||
}
|
||||
|
||||
void TrackPanel::HandleCursorForLastMouseEvent()
|
||||
void TrackPanel::HandleCursorForLastMouseState()
|
||||
{
|
||||
// Come here on modifier key transitions,
|
||||
// Come here on modifier key or mouse button transitions,
|
||||
// or on starting or stopping of play or record,
|
||||
// and change the cursor appropriately.
|
||||
HandleCursor( &mLastMouseEvent );
|
||||
HandleCursor( &mLastMouseState );
|
||||
}
|
||||
|
||||
bool TrackPanel::IsAudioActive()
|
||||
|
@ -836,30 +843,29 @@ bool TrackPanel::IsAudioActive()
|
|||
/// TrackPanel::HandleCursor( ) sets the cursor drawn at the mouse location.
|
||||
/// As this procedure checks which region the mouse is over, it is
|
||||
/// appropriate to establish the message in the status bar.
|
||||
void TrackPanel::HandleCursor( wxMouseEvent *pEvent )
|
||||
void TrackPanel::HandleCursor( wxMouseState *pState )
|
||||
{
|
||||
wxMouseEvent dummy;
|
||||
if (!pEvent)
|
||||
pEvent = &dummy;
|
||||
wxMouseState dummy;
|
||||
if (!pState)
|
||||
pState = &dummy;
|
||||
else
|
||||
mLastMouseEvent = *pEvent;
|
||||
auto &event = *pEvent;
|
||||
UpdateMouseState( *pState ), pState = &mLastMouseState;
|
||||
auto &state = *pState;
|
||||
|
||||
const auto foundCell = FindCell( event.m_x, event.m_y );
|
||||
const auto foundCell = FindCell( state.m_x, state.m_y );
|
||||
auto &track = foundCell.pTrack;
|
||||
auto &rect = foundCell.rect;
|
||||
auto &pCell = foundCell.pCell;
|
||||
const auto size = GetSize();
|
||||
const TrackPanelMouseEvent tpmEvent{ event, rect, size, pCell };
|
||||
HandleCursor( tpmEvent );
|
||||
const TrackPanelMouseState tpmState{ state, rect, pCell };
|
||||
HandleCursor( tpmState );
|
||||
}
|
||||
|
||||
void TrackPanel::HandleCursor( const TrackPanelMouseEvent &tpmEvent )
|
||||
void TrackPanel::HandleCursor( const TrackPanelMouseState &tpmState )
|
||||
{
|
||||
if ( mUIHandle ) {
|
||||
// UIHANDLE PREVIEW
|
||||
// Update status message and cursor during drag
|
||||
HitTestPreview preview = mUIHandle->Preview( tpmEvent, GetProject() );
|
||||
HitTestPreview preview = mUIHandle->Preview( tpmState, GetProject() );
|
||||
mListener->TP_DisplayStatusMessage( preview.message );
|
||||
if ( preview.cursor )
|
||||
SetCursor( *preview.cursor );
|
||||
|
@ -869,11 +875,10 @@ void TrackPanel::HandleCursor( const TrackPanelMouseEvent &tpmEvent )
|
|||
|
||||
wxString tip;
|
||||
|
||||
auto pCell = tpmEvent.pCell;
|
||||
auto pCell = tpmState.pCell;
|
||||
auto track = static_cast<CommonTrackPanelCell*>( pCell.get() )->FindTrack();
|
||||
if (pCell && pCursor == NULL && tip == wxString()) {
|
||||
const auto size = GetSize();
|
||||
HitTestResult hitTest( pCell->HitTest(tpmEvent, GetProject()) );
|
||||
HitTestResult hitTest( pCell->HitTest(tpmState, GetProject()) );
|
||||
tip = hitTest.preview.message;
|
||||
ProcessUIHandleResult
|
||||
(this, mRuler, track.get(), track.get(), hitTest.preview.refreshCode);
|
||||
|
@ -976,7 +981,10 @@ void TrackPanel::UpdateViewIfNoTracks()
|
|||
void TrackPanel::OnPlayback(wxCommandEvent &e)
|
||||
{
|
||||
e.Skip();
|
||||
CallAfter( [this] { HandleCursorForLastMouseEvent(); } );
|
||||
// Starting or stopping of play or record affects some cursors.
|
||||
// Start or stop is in progress now, not completed; so delay the cursor
|
||||
// change until next idle time.
|
||||
CallAfter( [this] { HandleCursorForLastMouseState(); } );
|
||||
}
|
||||
|
||||
// The tracks positions within the list have changed, so update the vertical
|
||||
|
@ -1264,15 +1272,12 @@ void TrackPanel::OnKeyDown(wxKeyEvent & event)
|
|||
break;
|
||||
|
||||
case WXK_ALT:
|
||||
HandleAltKey(true);
|
||||
break;
|
||||
|
||||
case WXK_SHIFT:
|
||||
HandleShiftKey(true);
|
||||
break;
|
||||
|
||||
case WXK_CONTROL:
|
||||
HandleControlKey(true);
|
||||
#ifdef __WXOSX__
|
||||
case WXK_RAW_CONTROL:
|
||||
#endif
|
||||
HandleModifierKey();
|
||||
break;
|
||||
|
||||
// Allow PageUp and PageDown keys to
|
||||
|
@ -1328,16 +1333,14 @@ void TrackPanel::OnKeyUp(wxKeyEvent & event)
|
|||
case WXK_ESCAPE:
|
||||
didSomething = HandleEscapeKey(false);
|
||||
break;
|
||||
|
||||
case WXK_ALT:
|
||||
HandleAltKey(false);
|
||||
break;
|
||||
|
||||
case WXK_SHIFT:
|
||||
HandleShiftKey(false);
|
||||
break;
|
||||
|
||||
case WXK_CONTROL:
|
||||
HandleControlKey(false);
|
||||
#ifdef __WXOSX__
|
||||
case WXK_RAW_CONTROL:
|
||||
#endif
|
||||
HandleModifierKey();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1466,8 +1469,14 @@ try
|
|||
mpClickedTrack.reset();
|
||||
Uncapture( &event );
|
||||
}
|
||||
else
|
||||
HandleCursor( tpmEvent );
|
||||
else {
|
||||
TrackPanelMouseState tpmState{
|
||||
tpmEvent.event,
|
||||
tpmEvent.rect,
|
||||
tpmEvent.pCell
|
||||
};
|
||||
HandleCursor( tpmState );
|
||||
}
|
||||
}
|
||||
else if (event.ButtonUp()) {
|
||||
// UIHANDLE RELEASE
|
||||
|
@ -1529,9 +1538,15 @@ void TrackPanel::HandleClick( const TrackPanelMouseEvent &tpmEvent )
|
|||
const auto &rect = tpmEvent.rect;
|
||||
auto pTrack = static_cast<CommonTrackPanelCell *>( pCell.get() )->FindTrack();
|
||||
|
||||
if ( !mUIHandle && pCell )
|
||||
if ( !mUIHandle && pCell ) {
|
||||
TrackPanelMouseState tpmState{
|
||||
tpmEvent.event,
|
||||
tpmEvent.rect,
|
||||
tpmEvent.pCell
|
||||
};
|
||||
mUIHandle =
|
||||
pCell->HitTest( tpmEvent, GetProject() ).handle;
|
||||
pCell->HitTest( tpmState, GetProject() ).handle;
|
||||
}
|
||||
|
||||
if (mUIHandle) {
|
||||
// UIHANDLE CLICK
|
||||
|
@ -1543,7 +1558,12 @@ void TrackPanel::HandleClick( const TrackPanelMouseEvent &tpmEvent )
|
|||
mpClickedTrack = pTrack;
|
||||
ProcessUIHandleResult
|
||||
(this, mRuler, pTrack.get(), pTrack.get(), refreshResult);
|
||||
HandleCursor( tpmEvent );
|
||||
TrackPanelMouseState tpmState{
|
||||
tpmEvent.event,
|
||||
tpmEvent.rect,
|
||||
tpmEvent.pCell
|
||||
};
|
||||
HandleCursor( tpmState );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ class AudacityProject;
|
|||
class TrackPanelAx;
|
||||
class TrackPanelCellIterator;
|
||||
struct TrackPanelMouseEvent;
|
||||
struct TrackPanelMouseState;
|
||||
|
||||
class ViewInfo;
|
||||
|
||||
|
@ -310,9 +311,8 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
|
|||
void Uncapture( wxMouseEvent *pEvent = nullptr );
|
||||
void CancelDragging();
|
||||
bool HandleEscapeKey(bool down);
|
||||
void HandleAltKey(bool down);
|
||||
void HandleShiftKey(bool down);
|
||||
void HandleControlKey(bool down);
|
||||
void UpdateMouseState(const wxMouseState &state);
|
||||
void HandleModifierKey();
|
||||
void HandlePageUpKey();
|
||||
void HandlePageDownKey();
|
||||
AudacityProject * GetProject() const;
|
||||
|
@ -329,7 +329,7 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
|
|||
Track *GetFocusedTrack();
|
||||
void SetFocusedTrack(Track *t);
|
||||
|
||||
void HandleCursorForLastMouseEvent();
|
||||
void HandleCursorForLastMouseState();
|
||||
|
||||
void UpdateVRulers();
|
||||
void UpdateVRuler(Track *t);
|
||||
|
@ -372,8 +372,8 @@ protected:
|
|||
};
|
||||
FoundCell FindCell(int mouseX, int mouseY);
|
||||
|
||||
void HandleCursor( wxMouseEvent *pEvent );
|
||||
void HandleCursor( const TrackPanelMouseEvent &tpmEvent );
|
||||
void HandleCursor( wxMouseState *pState );
|
||||
void HandleCursor( const TrackPanelMouseState &tpmState );
|
||||
|
||||
// If label, rectangle includes track control panel only.
|
||||
// If !label, rectangle includes all of that, and the vertical ruler, and
|
||||
|
@ -484,7 +484,7 @@ protected:
|
|||
|
||||
bool mRedrawAfterStop;
|
||||
|
||||
wxMouseEvent mLastMouseEvent;
|
||||
wxMouseState mLastMouseState;
|
||||
|
||||
int mMouseMostRecentX;
|
||||
int mMouseMostRecentY;
|
||||
|
|
|
@ -14,6 +14,7 @@ Paul Licameli
|
|||
class AudacityProject;
|
||||
struct HitTestResult;
|
||||
struct TrackPanelMouseEvent;
|
||||
struct TrackPanelMouseState;
|
||||
class ViewInfo;
|
||||
class wxKeyEvent;
|
||||
class wxPoint;
|
||||
|
@ -28,10 +29,12 @@ public:
|
|||
virtual ~TrackPanelCell () = 0;
|
||||
|
||||
// Indicate a status bar message, cursor, and click-drag-release handler
|
||||
// appropriate to the mouse position and modifier keys.
|
||||
// appropriate to the mouse position, modifier keys, and button-down state.
|
||||
// The button-down state passed to the function is as it will be at click
|
||||
// time -- not necessarily as it is now.
|
||||
// TrackPanel is not responsible for memory management of the handler.
|
||||
virtual HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject) = 0;
|
||||
|
||||
// Return value is a bitwise OR of RefreshCode values
|
||||
|
|
|
@ -12,11 +12,30 @@ Paul Licameli
|
|||
#define __AUDACITY_TRACK_PANEL_MOUSE_EVENT__
|
||||
|
||||
class wxMouseEvent;
|
||||
class wxMouseState;
|
||||
class wxRect;
|
||||
class wxSize;
|
||||
class TrackPanelCell;
|
||||
#include "MemoryX.h"
|
||||
|
||||
// Augment a mouse state with information about which track panel cell and
|
||||
// sub-rectangle was hit.
|
||||
struct TrackPanelMouseState
|
||||
{
|
||||
TrackPanelMouseState
|
||||
( wxMouseState &state_, const wxRect &rect_,
|
||||
const std::shared_ptr<TrackPanelCell> &pCell_ )
|
||||
: state{ state_ }
|
||||
, rect{ rect_ }
|
||||
, pCell{ pCell_ }
|
||||
{
|
||||
}
|
||||
|
||||
wxMouseState &state;
|
||||
const wxRect ▭
|
||||
std::shared_ptr<TrackPanelCell> pCell; // may be NULL
|
||||
};
|
||||
|
||||
// Augment a mouse event with information about which track panel cell and
|
||||
// sub-rectangle was hit.
|
||||
struct TrackPanelMouseEvent
|
||||
|
|
|
@ -317,7 +317,7 @@ UIHandle::Result TrackPanelResizeHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview TrackPanelResizeHandle::Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *)
|
||||
(const TrackPanelMouseState &, const AudacityProject *)
|
||||
{
|
||||
return HitPreview(mMode == IsResizingBetweenLinkedTracks);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -18,7 +18,7 @@ TrackPanelResizerCell::TrackPanelResizerCell( std::shared_ptr<Track> pTrack )
|
|||
{}
|
||||
|
||||
HitTestResult TrackPanelResizerCell::HitTest
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &, const AudacityProject *)
|
||||
{
|
||||
return {
|
||||
TrackPanelResizeHandle::HitPreview( mBetweenTracks ),
|
||||
|
|
|
@ -23,8 +23,7 @@ public:
|
|||
TrackPanelResizerCell( std::shared_ptr<Track> pTrack );
|
||||
|
||||
HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
const AudacityProject *pProject) override;
|
||||
(const TrackPanelMouseState &, const AudacityProject *) override;
|
||||
|
||||
std::shared_ptr<Track> FindTrack() override { return mpTrack.lock(); };
|
||||
private:
|
||||
|
|
|
@ -22,6 +22,7 @@ class AudacityProject;
|
|||
struct HitTestPreview;
|
||||
class TrackPanelCell;
|
||||
struct TrackPanelMouseEvent;
|
||||
struct TrackPanelMouseState;
|
||||
|
||||
// A TrackPanelCell reports a handle object of some subclass, in response to a
|
||||
// hit test at a mouse position; then this handle processes certain events,
|
||||
|
@ -59,7 +60,7 @@ public:
|
|||
|
||||
// Update the cursor and status message.
|
||||
virtual HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject) = 0;
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject) = 0;
|
||||
|
||||
// Assume previously Clicked and not yet Released or Cancelled.
|
||||
// event.pCell may be other than for Click; may be NULL, and rect empty.
|
||||
|
|
|
@ -104,7 +104,7 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
|
|||
virtual ~WaveTrack();
|
||||
|
||||
HitTestResult DetailedHitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject, int currentTool, bool bMultiTool)
|
||||
override;
|
||||
|
||||
|
|
|
@ -49,13 +49,13 @@ HitTestPreview LabelGlyphHandle::HitPreview
|
|||
}
|
||||
|
||||
HitTestResult LabelGlyphHandle::HitTest
|
||||
(const wxMouseEvent &event, const std::shared_ptr<LabelTrack> &pLT)
|
||||
(const wxMouseState &state, const std::shared_ptr<LabelTrack> &pLT)
|
||||
{
|
||||
using namespace RefreshCode;
|
||||
unsigned refreshResult = RefreshNone;
|
||||
|
||||
// Note: this has side effects on pLT!
|
||||
int edge = pLT->OverGlyph(event.m_x, event.m_y);
|
||||
int edge = pLT->OverGlyph(state.m_x, state.m_y);
|
||||
|
||||
//KLUDGE: We refresh the whole Label track when the icon hovered over
|
||||
//changes colouration. Inefficient.
|
||||
|
@ -137,7 +137,7 @@ UIHandle::Result LabelGlyphHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview LabelGlyphHandle::Preview
|
||||
(const TrackPanelMouseEvent &evt, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &, const AudacityProject *)
|
||||
{
|
||||
return HitPreview(mpLT->mbHitCenter, 0);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ Paul Licameli split from TrackPanel.cpp
|
|||
#include <wx/gdicmn.h>
|
||||
#include "../../../MemoryX.h"
|
||||
|
||||
class wxMouseEvent;
|
||||
class wxMouseState;
|
||||
struct HitTestResult;
|
||||
class LabelTrack;
|
||||
|
||||
|
@ -29,7 +29,7 @@ class LabelGlyphHandle final : public LabelDefaultClickHandle
|
|||
|
||||
public:
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const std::shared_ptr<LabelTrack> &pLT);
|
||||
(const wxMouseState &state, const std::shared_ptr<LabelTrack> &pLT);
|
||||
|
||||
virtual ~LabelGlyphHandle();
|
||||
|
||||
|
@ -40,7 +40,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -39,11 +39,11 @@ HitTestPreview LabelTextHandle::HitPreview()
|
|||
}
|
||||
|
||||
HitTestResult LabelTextHandle::HitTest
|
||||
(const wxMouseEvent &event, const std::shared_ptr<LabelTrack> &pLT)
|
||||
(const wxMouseState &state, const std::shared_ptr<LabelTrack> &pLT)
|
||||
{
|
||||
// If Control is down, let the select handle be hit instead
|
||||
if (!event.ControlDown() &&
|
||||
pLT->OverATextBox(event.m_x, event.m_y) >= 0)
|
||||
if (!state.ControlDown() &&
|
||||
pLT->OverATextBox(state.m_x, state.m_y) >= 0)
|
||||
// There was no cursor change or status message for mousing over a label text box
|
||||
return { HitPreview(), &Instance() };
|
||||
|
||||
|
@ -150,7 +150,7 @@ UIHandle::Result LabelTextHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview LabelTextHandle::Preview
|
||||
(const TrackPanelMouseEvent &evt, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &, const AudacityProject *)
|
||||
{
|
||||
return HitPreview();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ Paul Licameli split from TrackPanel.cpp
|
|||
#include "../../../SelectedRegion.h"
|
||||
#include <wx/gdicmn.h>
|
||||
|
||||
class wxMouseEvent;
|
||||
class wxMouseState;
|
||||
struct HitTestResult;
|
||||
class LabelTrack;
|
||||
class SelectionStateChanger;
|
||||
|
@ -32,7 +32,7 @@ class LabelTextHandle final : public LabelDefaultClickHandle
|
|||
|
||||
public:
|
||||
static HitTestResult HitTest(
|
||||
const wxMouseEvent &event, const std::shared_ptr<LabelTrack> &pLT);
|
||||
const wxMouseState &state, const std::shared_ptr<LabelTrack> &pLT);
|
||||
|
||||
virtual ~LabelTextHandle();
|
||||
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -27,10 +27,10 @@ LabelTrackControls::~LabelTrackControls()
|
|||
}
|
||||
|
||||
HitTestResult LabelTrackControls::HitTest
|
||||
(const TrackPanelMouseEvent & event,
|
||||
(const TrackPanelMouseState & state,
|
||||
const AudacityProject *pProject)
|
||||
{
|
||||
return TrackControls::HitTest(event, pProject);
|
||||
return TrackControls::HitTest(state, pProject);
|
||||
}
|
||||
|
||||
class LabelTrackMenuTable : public PopupMenuTable
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
~LabelTrackControls();
|
||||
|
||||
HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject) override;
|
||||
|
||||
PopupMenuTable *GetMenuExtension(Track *pTrack) override;
|
||||
|
|
|
@ -22,19 +22,19 @@ Paul Licameli split from TrackPanel.cpp
|
|||
#include "../../../TrackPanelMouseEvent.h"
|
||||
|
||||
HitTestResult LabelTrack::DetailedHitTest
|
||||
(const TrackPanelMouseEvent &evt,
|
||||
(const TrackPanelMouseState &st,
|
||||
const AudacityProject *pProject, int, bool)
|
||||
{
|
||||
HitTestResult result;
|
||||
const wxMouseEvent &event = evt.event;
|
||||
const wxMouseState &state = st.state;
|
||||
|
||||
// Try label movement handles first
|
||||
result = LabelGlyphHandle::HitTest(event, Pointer<LabelTrack>(this));
|
||||
result = LabelGlyphHandle::HitTest(state, Pointer<LabelTrack>(this));
|
||||
auto refresh = result.preview.refreshCode; // kludge
|
||||
|
||||
if ( !result.handle ) {
|
||||
// Missed glyph, try text box
|
||||
result = LabelTextHandle::HitTest(event, Pointer<LabelTrack>(this));
|
||||
result = LabelTextHandle::HitTest(state, Pointer<LabelTrack>(this));
|
||||
result.preview.refreshCode |= refresh; // kludge
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ UIHandle::Result NoteTrackButtonHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview NoteTrackButtonHandle::Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *)
|
||||
(const TrackPanelMouseState &, const AudacityProject *)
|
||||
{
|
||||
// No special message or cursor
|
||||
return {};
|
||||
|
|
|
@ -42,7 +42,7 @@ protected:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -31,36 +31,36 @@ NoteTrackControls::~NoteTrackControls()
|
|||
}
|
||||
|
||||
HitTestResult NoteTrackControls::HitTest
|
||||
(const TrackPanelMouseEvent & evt,
|
||||
(const TrackPanelMouseState & st,
|
||||
const AudacityProject *pProject)
|
||||
{
|
||||
const wxMouseEvent &event = evt.event;
|
||||
const wxRect &rect = evt.rect;
|
||||
if (event.ButtonDown() || event.ButtonDClick()) {
|
||||
const wxMouseState &state = st.state;
|
||||
const wxRect &rect = st.rect;
|
||||
if (state.ButtonIsDown(wxMOUSE_BTN_ANY)) {
|
||||
auto track = std::static_pointer_cast<NoteTrack>(FindTrack());
|
||||
if (track && track->GetKind() == Track::Note) {
|
||||
HitTestResult result;
|
||||
if (NULL !=
|
||||
(result = MuteButtonHandle::HitTest
|
||||
(event, rect, pProject, track)).handle)
|
||||
(state, rect, pProject, track)).handle)
|
||||
return result;
|
||||
|
||||
if (NULL !=
|
||||
(result = SoloButtonHandle::HitTest
|
||||
(event, rect, pProject, track)).handle)
|
||||
(state, rect, pProject, track)).handle)
|
||||
return result;
|
||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||
if (NULL != (result =
|
||||
VelocitySliderHandle::HitTest(event, rect, pProject, track)).handle)
|
||||
VelocitySliderHandle::HitTest(state, rect, pProject, track)).handle)
|
||||
return result;
|
||||
if (NULL != (result =
|
||||
NoteTrackButtonHandle::HitTest(event, rect, track)).handle)
|
||||
NoteTrackButtonHandle::HitTest(state, rect, track)).handle)
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return TrackControls::HitTest(evt, pProject);
|
||||
return TrackControls::HitTest(st, pProject);
|
||||
}
|
||||
|
||||
class NoteTrackMenuTable : public PopupMenuTable
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
~NoteTrackControls();
|
||||
|
||||
HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject) override;
|
||||
|
||||
PopupMenuTable *GetMenuExtension(Track *pTrack) override;
|
||||
|
|
|
@ -69,17 +69,17 @@ UIHandle::Result VelocitySliderHandle::CommitChanges
|
|||
|
||||
|
||||
HitTestResult VelocitySliderHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack)
|
||||
{
|
||||
if (!event.Button(wxMOUSE_BTN_LEFT))
|
||||
if (!state.ButtonIsDown(wxMOUSE_BTN_LEFT))
|
||||
return {};
|
||||
|
||||
wxRect sliderRect;
|
||||
TrackInfo::GetVelocityRect(rect.GetTopLeft(), sliderRect);
|
||||
if ( TrackInfo::HideTopItem( rect, sliderRect, kTrackInfoSliderAllowance ) )
|
||||
return {};
|
||||
if (sliderRect.Contains(event.m_x, event.m_y)) {
|
||||
if (sliderRect.Contains(state.m_x, state.m_y)) {
|
||||
Instance().mSliderFn =
|
||||
[]( AudacityProject *pProject, const wxRect &sliderRect, Track *pTrack ) {
|
||||
return TrackInfo::VelocitySlider
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "../../../ui/SliderHandle.h"
|
||||
|
||||
class NoteTrack;
|
||||
class wxMouseState;
|
||||
|
||||
struct HitTestResult;
|
||||
|
||||
|
@ -43,7 +44,7 @@ protected:
|
|||
|
||||
public:
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack);
|
||||
};
|
||||
|
||||
|
|
|
@ -23,14 +23,14 @@ Paul Licameli split from TrackPanel.cpp
|
|||
#include "StretchHandle.h"
|
||||
|
||||
HitTestResult NoteTrack::DetailedHitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject, int, bool )
|
||||
{
|
||||
// Eligible for stretch?
|
||||
HitTestResult result;
|
||||
#ifdef USE_MIDI
|
||||
StretchHandle::StretchState state;
|
||||
result = StretchHandle::HitTest( event, pProject, Pointer<NoteTrack>(this), state );
|
||||
StretchHandle::StretchState stretchState;
|
||||
result = StretchHandle::HitTest( state, pProject, Pointer<NoteTrack>(this), stretchState );
|
||||
#endif
|
||||
|
||||
return result;
|
||||
|
|
|
@ -28,10 +28,10 @@ NoteTrackVRulerControls::~NoteTrackVRulerControls()
|
|||
}
|
||||
|
||||
HitTestResult NoteTrackVRulerControls::HitTest
|
||||
(const TrackPanelMouseEvent &evt,
|
||||
(const TrackPanelMouseState &st,
|
||||
const AudacityProject *)
|
||||
{
|
||||
return NoteTrackVZoomHandle::HitTest(evt.event);
|
||||
return NoteTrackVZoomHandle::HitTest(st.state);
|
||||
}
|
||||
|
||||
unsigned NoteTrackVRulerControls::HandleWheelRotation
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
~NoteTrackVRulerControls();
|
||||
|
||||
HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject) override;
|
||||
|
||||
unsigned HandleWheelRotation
|
||||
|
|
|
@ -102,9 +102,9 @@ UIHandle::Result NoteTrackVZoomHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview NoteTrackVZoomHandle::Preview
|
||||
(const TrackPanelMouseEvent &evt, const AudacityProject *)
|
||||
(const TrackPanelMouseState &st, const AudacityProject *)
|
||||
{
|
||||
return HitPreview(evt.event);
|
||||
return HitPreview(st.state);
|
||||
}
|
||||
|
||||
UIHandle::Result NoteTrackVZoomHandle::Release
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -68,10 +68,10 @@ HitTestPreview StretchHandle::HitPreview( StretchEnum stretchMode, bool unsafe )
|
|||
}
|
||||
|
||||
HitTestResult StretchHandle::HitTest
|
||||
( const TrackPanelMouseEvent &evt, const AudacityProject *pProject,
|
||||
( const TrackPanelMouseState &st, const AudacityProject *pProject,
|
||||
const std::shared_ptr<NoteTrack> &pTrack, StretchState &stretchState)
|
||||
{
|
||||
const wxMouseEvent &event = evt.event;
|
||||
const wxMouseState &state = st.state;
|
||||
|
||||
// later, we may want a different policy, but for now, stretch is
|
||||
// selected when the cursor is near the center of the track and
|
||||
|
@ -82,15 +82,15 @@ HitTestResult StretchHandle::HitTest
|
|||
if (!pTrack || !pTrack->GetSelected() || pTrack->GetKind() != Track::Note)
|
||||
return {};
|
||||
|
||||
const wxRect &rect = evt.rect;
|
||||
const wxRect &rect = st.rect;
|
||||
int center = rect.y + rect.height / 2;
|
||||
int distance = abs(event.m_y - center);
|
||||
int distance = abs(state.m_y - center);
|
||||
const int yTolerance = 10;
|
||||
wxInt64 leftSel = viewInfo.TimeToPosition(viewInfo.selectedRegion.t0(), rect.x);
|
||||
wxInt64 rightSel = viewInfo.TimeToPosition(viewInfo.selectedRegion.t1(), rect.x);
|
||||
// Something is wrong if right edge comes before left edge
|
||||
wxASSERT(!(rightSel < leftSel));
|
||||
if (!(leftSel <= event.m_x && event.m_x <= rightSel &&
|
||||
if (!(leftSel <= state.m_x && state.m_x <= rightSel &&
|
||||
distance < yTolerance))
|
||||
return {};
|
||||
|
||||
|
@ -115,7 +115,7 @@ HitTestResult StretchHandle::HitTest
|
|||
< minPeriod )
|
||||
return {};
|
||||
|
||||
auto selStart = viewInfo.PositionToTime( event.m_x, rect.x );
|
||||
auto selStart = viewInfo.PositionToTime( state.m_x, rect.x );
|
||||
stretchState.mBeatCenter = pTrack->NearestBeatTime( selStart );
|
||||
bool startNewSelection = true;
|
||||
if ( within( stretchState.mBeat0.second,
|
||||
|
@ -170,7 +170,8 @@ UIHandle::Result StretchHandle::Click
|
|||
|
||||
// We must have hit if we got here, but repeat some
|
||||
// calculations that set members
|
||||
HitTest( evt, pProject, mpTrack, mStretchState );
|
||||
TrackPanelMouseState tpmState{ evt.event, evt.rect, evt.pCell };
|
||||
HitTest( tpmState, pProject, mpTrack, mStretchState );
|
||||
|
||||
viewInfo.selectedRegion.setTimes
|
||||
( mStretchState.mBeat0.first, mStretchState.mBeat1.first );
|
||||
|
@ -205,7 +206,7 @@ UIHandle::Result StretchHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview StretchHandle::Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &, const AudacityProject *pProject)
|
||||
{
|
||||
const bool unsafe = pProject->IsAudioActive();
|
||||
return HitPreview( mStretchState.mMode, unsafe );
|
||||
|
|
|
@ -63,8 +63,8 @@ private:
|
|||
|
||||
public:
|
||||
static HitTestResult HitTest
|
||||
( const TrackPanelMouseEvent &event, const AudacityProject *pProject,
|
||||
const std::shared_ptr<NoteTrack> &pTrack, StretchState &state );
|
||||
( const TrackPanelMouseState &state, const AudacityProject *pProject,
|
||||
const std::shared_ptr<NoteTrack> &pTrack, StretchState &stretchState );
|
||||
|
||||
virtual ~StretchHandle();
|
||||
|
||||
|
@ -75,7 +75,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject);
|
||||
|
||||
virtual HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject);
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject);
|
||||
|
||||
virtual Result Release
|
||||
(const TrackPanelMouseEvent &event, AudacityProject *pProject,
|
||||
|
|
|
@ -44,7 +44,7 @@ UIHandle::Result MuteButtonHandle::CommitChanges
|
|||
}
|
||||
|
||||
HitTestResult MuteButtonHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
|
@ -54,7 +54,7 @@ HitTestResult MuteButtonHandle::HitTest
|
|||
if ( TrackInfo::HideTopItem( rect, buttonRect ) )
|
||||
return {};
|
||||
|
||||
if ( pTrack && buttonRect.Contains(event.m_x, event.m_y) ) {
|
||||
if ( pTrack && buttonRect.Contains(state.m_x, state.m_y) ) {
|
||||
Instance().mRect = buttonRect;
|
||||
return {
|
||||
HitPreview(),
|
||||
|
@ -93,7 +93,7 @@ UIHandle::Result SoloButtonHandle::CommitChanges
|
|||
}
|
||||
|
||||
HitTestResult SoloButtonHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
|
@ -104,7 +104,7 @@ HitTestResult SoloButtonHandle::HitTest
|
|||
if ( TrackInfo::HideTopItem( rect, buttonRect ) )
|
||||
return {};
|
||||
|
||||
if ( pTrack && buttonRect.Contains(event.m_x, event.m_y) ) {
|
||||
if ( pTrack && buttonRect.Contains(state.m_x, state.m_y) ) {
|
||||
Instance().mRect = buttonRect;
|
||||
return HitTestResult(
|
||||
HitPreview(),
|
||||
|
|
|
@ -14,6 +14,7 @@ Paul Licameli split from TrackPanel.cpp
|
|||
#include "../../ui/ButtonHandle.h"
|
||||
|
||||
struct HitTestResult;
|
||||
class wxMouseState;
|
||||
|
||||
class MuteButtonHandle final : public ButtonHandle
|
||||
{
|
||||
|
@ -33,7 +34,7 @@ protected:
|
|||
|
||||
public:
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack);
|
||||
};
|
||||
|
||||
|
@ -57,7 +58,7 @@ protected:
|
|||
|
||||
public:
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack);
|
||||
};
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace
|
|||
|
||||
bool IsOverCutline
|
||||
(const ViewInfo &viewInfo, WaveTrack * track,
|
||||
const wxRect &rect, const wxMouseEvent &event,
|
||||
const wxRect &rect, const wxMouseState &state,
|
||||
WaveTrackLocation *pCapturedTrackLocation)
|
||||
{
|
||||
for (auto loc: track->GetCachedLocations())
|
||||
|
@ -93,7 +93,7 @@ namespace
|
|||
locRect.y += rect.height/3;
|
||||
locRect.height /= 3;
|
||||
}
|
||||
if (locRect.Contains(event.m_x, event.m_y))
|
||||
if (locRect.Contains(state.m_x, state.m_y))
|
||||
{
|
||||
if (pCapturedTrackLocation)
|
||||
*pCapturedTrackLocation = loc;
|
||||
|
@ -107,7 +107,7 @@ namespace
|
|||
}
|
||||
|
||||
HitTestResult CutlineHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect, const AudacityProject *pProject,
|
||||
(const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject,
|
||||
const std::shared_ptr<WaveTrack> &pTrack)
|
||||
{
|
||||
const ViewInfo &viewInfo = pProject->GetViewInfo();
|
||||
|
@ -118,7 +118,7 @@ HitTestResult CutlineHandle::HitTest
|
|||
|
||||
WaveTrack *wavetrack = pTrack.get();
|
||||
WaveTrackLocation location;
|
||||
if (!IsOverCutline(viewInfo, wavetrack, rect, event, &location))
|
||||
if (!IsOverCutline(viewInfo, wavetrack, rect, state, &location))
|
||||
return {};
|
||||
|
||||
return HitAnywhere(pProject, location.typ == WaveTrackLocation::locationCutLine);
|
||||
|
@ -222,7 +222,7 @@ UIHandle::Result CutlineHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview CutlineHandle::Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *)
|
||||
(const TrackPanelMouseState &, const AudacityProject *)
|
||||
{
|
||||
return HitPreview(mbCutline, false);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ Paul Licameli
|
|||
#include "../../../../MemoryX.h"
|
||||
|
||||
class wxMouseEvent;
|
||||
class wxMouseState;
|
||||
struct HitTestResult;
|
||||
class WaveTrack;
|
||||
|
||||
|
@ -29,7 +30,7 @@ class CutlineHandle final : public UIHandle
|
|||
public:
|
||||
static HitTestResult HitAnywhere(const AudacityProject *pProject, bool cutline);
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<WaveTrack> &pTrack);
|
||||
|
||||
virtual ~CutlineHandle();
|
||||
|
@ -41,7 +42,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -45,7 +45,7 @@ SampleHandle &SampleHandle::Instance()
|
|||
}
|
||||
|
||||
HitTestPreview SampleHandle::HitPreview
|
||||
(const wxMouseEvent &event, const AudacityProject *pProject, bool unsafe)
|
||||
(const wxMouseState &state, const AudacityProject *pProject, bool unsafe)
|
||||
{
|
||||
static auto disabledCursor =
|
||||
::MakeCursor(wxCURSOR_NO_ENTRY, DisabledCursorXpm, 16, 16);
|
||||
|
@ -57,18 +57,18 @@ HitTestPreview SampleHandle::HitPreview
|
|||
ttb->GetMessageForTool(drawTool),
|
||||
(unsafe
|
||||
? &*disabledCursor
|
||||
: (event.AltDown()
|
||||
: (state.AltDown()
|
||||
? &smoothCursor
|
||||
: &*pencilCursor))
|
||||
};
|
||||
}
|
||||
|
||||
HitTestResult SampleHandle::HitAnywhere
|
||||
(const wxMouseEvent &event, const AudacityProject *pProject)
|
||||
(const wxMouseState &state, const AudacityProject *pProject)
|
||||
{
|
||||
const bool unsafe = pProject->IsAudioActive();
|
||||
return {
|
||||
HitPreview(event, pProject, unsafe),
|
||||
HitPreview(state, pProject, unsafe),
|
||||
(unsafe
|
||||
? NULL
|
||||
: &Instance())
|
||||
|
@ -105,7 +105,7 @@ namespace {
|
|||
}
|
||||
|
||||
HitTestResult SampleHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<WaveTrack> &pTrack)
|
||||
{
|
||||
const ViewInfo &viewInfo = pProject->GetViewInfo();
|
||||
|
@ -122,7 +122,7 @@ HitTestResult SampleHandle::HitTest
|
|||
return {}; // Not a wave, so return.
|
||||
|
||||
const double tt =
|
||||
adjustTime(wavetrack, viewInfo.PositionToTime(event.m_x, rect.x));
|
||||
adjustTime(wavetrack, viewInfo.PositionToTime(state.m_x, rect.x));
|
||||
if (!SampleResolutionTest(viewInfo, wavetrack, tt, rect.width))
|
||||
return {};
|
||||
|
||||
|
@ -141,7 +141,7 @@ HitTestResult SampleHandle::HitTest
|
|||
wavetrack->GetDisplayBounds(&zoomMin, &zoomMax);
|
||||
|
||||
double envValue = 1.0;
|
||||
Envelope* env = wavetrack->GetEnvelopeAtX(event.GetX());
|
||||
Envelope* env = wavetrack->GetEnvelopeAtX(state.GetX());
|
||||
if (env)
|
||||
// Calculate sample as it would be rendered, so quantize time
|
||||
envValue = env->GetValue( tt, 1.0 / wavetrack->GetRate() );
|
||||
|
@ -153,14 +153,14 @@ HitTestResult SampleHandle::HitTest
|
|||
wavetrack->GetWaveformSettings().dBRange, false) + rect.y;
|
||||
|
||||
// Get y position of mouse (in pixels)
|
||||
int yMouse = event.m_y;
|
||||
int yMouse = state.m_y;
|
||||
|
||||
// Perhaps yTolerance should be put into preferences?
|
||||
const int yTolerance = 10; // More tolerance on samples than on envelope.
|
||||
if (abs(yValue - yMouse) >= yTolerance)
|
||||
return {};
|
||||
|
||||
return HitAnywhere(event, pProject);
|
||||
return HitAnywhere(state, pProject);
|
||||
}
|
||||
|
||||
SampleHandle::~SampleHandle()
|
||||
|
@ -417,9 +417,9 @@ UIHandle::Result SampleHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview SampleHandle::Preview
|
||||
(const TrackPanelMouseEvent &evt, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &st, const AudacityProject *pProject)
|
||||
{
|
||||
return HitPreview(evt.event, pProject, false);
|
||||
return HitPreview(st.state, pProject, false);
|
||||
}
|
||||
|
||||
UIHandle::Result SampleHandle::Release
|
||||
|
|
|
@ -16,6 +16,7 @@ Paul Licameli
|
|||
#include "../../../../MemoryX.h"
|
||||
|
||||
class wxMouseEvent;
|
||||
class wxMouseState;
|
||||
#include <wx/gdicmn.h>
|
||||
|
||||
struct HitTestResult;
|
||||
|
@ -30,13 +31,13 @@ class SampleHandle final : public UIHandle
|
|||
SampleHandle &operator=(const SampleHandle&) = delete;
|
||||
static SampleHandle& Instance();
|
||||
static HitTestPreview HitPreview
|
||||
(const wxMouseEvent &event, const AudacityProject *pProject, bool unsafe);
|
||||
(const wxMouseState &state, const AudacityProject *pProject, bool unsafe);
|
||||
|
||||
public:
|
||||
static HitTestResult HitAnywhere
|
||||
(const wxMouseEvent &event, const AudacityProject *pProject);
|
||||
(const wxMouseState &state, const AudacityProject *pProject);
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<WaveTrack> &pTrack);
|
||||
|
||||
virtual ~SampleHandle();
|
||||
|
@ -48,7 +49,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -54,36 +54,36 @@ WaveTrackControls::~WaveTrackControls()
|
|||
|
||||
|
||||
HitTestResult WaveTrackControls::HitTest
|
||||
(const TrackPanelMouseEvent & evt,
|
||||
(const TrackPanelMouseState & st,
|
||||
const AudacityProject *pProject)
|
||||
{
|
||||
const wxMouseEvent &event = evt.event;
|
||||
const wxRect &rect = evt.rect;
|
||||
if (event.Button(wxMOUSE_BTN_LEFT)) {
|
||||
const wxMouseState &state = st.state;
|
||||
const wxRect &rect = st.rect;
|
||||
if (state.ButtonIsDown(wxMOUSE_BTN_LEFT)) {
|
||||
auto track = FindTrack();
|
||||
if (track && track->GetKind() == Track::Wave) {
|
||||
HitTestResult result;
|
||||
if (NULL !=
|
||||
(result = MuteButtonHandle::HitTest
|
||||
(event, rect, pProject, track)).handle)
|
||||
(state, rect, pProject, track)).handle)
|
||||
return result;
|
||||
|
||||
if (NULL !=
|
||||
(result = SoloButtonHandle::HitTest
|
||||
(event, rect, pProject, track)).handle)
|
||||
(state, rect, pProject, track)).handle)
|
||||
return result;
|
||||
|
||||
if (NULL != (result =
|
||||
GainSliderHandle::HitTest(event, rect, pProject, track)).handle)
|
||||
GainSliderHandle::HitTest(state, rect, pProject, track)).handle)
|
||||
return result;
|
||||
|
||||
if (NULL != (result =
|
||||
PanSliderHandle::HitTest(event, rect, pProject, track)).handle)
|
||||
PanSliderHandle::HitTest(state, rect, pProject, track)).handle)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return TrackControls::HitTest(evt, pProject);
|
||||
return TrackControls::HitTest(st, pProject);
|
||||
}
|
||||
|
||||
enum {
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
~WaveTrackControls();
|
||||
|
||||
HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject) override;
|
||||
|
||||
PopupMenuTable *GetMenuExtension(Track *pTrack) override;
|
||||
|
|
|
@ -70,17 +70,17 @@ UIHandle::Result GainSliderHandle::CommitChanges
|
|||
}
|
||||
|
||||
HitTestResult GainSliderHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *, const std::shared_ptr<Track> &pTrack)
|
||||
{
|
||||
if (!event.Button(wxMOUSE_BTN_LEFT))
|
||||
if (!state.ButtonIsDown(wxMOUSE_BTN_LEFT))
|
||||
return {};
|
||||
|
||||
wxRect sliderRect;
|
||||
TrackInfo::GetGainRect(rect.GetTopLeft(), sliderRect);
|
||||
if ( TrackInfo::HideTopItem( rect, sliderRect, kTrackInfoSliderAllowance ) )
|
||||
return {};
|
||||
if (sliderRect.Contains(event.m_x, event.m_y)) {
|
||||
if (sliderRect.Contains(state.m_x, state.m_y)) {
|
||||
wxRect sliderRect;
|
||||
TrackInfo::GetGainRect(rect.GetTopLeft(), sliderRect);
|
||||
|
||||
|
@ -167,17 +167,17 @@ UIHandle::Result PanSliderHandle::CommitChanges
|
|||
}
|
||||
|
||||
HitTestResult PanSliderHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack)
|
||||
{
|
||||
if (!event.Button(wxMOUSE_BTN_LEFT))
|
||||
if (!state.ButtonIsDown(wxMOUSE_BTN_LEFT))
|
||||
return {};
|
||||
|
||||
wxRect sliderRect;
|
||||
TrackInfo::GetPanRect(rect.GetTopLeft(), sliderRect);
|
||||
if ( TrackInfo::HideTopItem( rect, sliderRect, kTrackInfoSliderAllowance ) )
|
||||
return {};
|
||||
if (sliderRect.Contains(event.m_x, event.m_y)) {
|
||||
if (sliderRect.Contains(state.m_x, state.m_y)) {
|
||||
Instance().mSliderFn =
|
||||
[]( AudacityProject *pProject, const wxRect &sliderRect, Track *pTrack ) {
|
||||
return TrackInfo::PanSlider
|
||||
|
|
|
@ -13,6 +13,7 @@ Paul Licameli split from TrackPanel.cpp
|
|||
|
||||
#include "../../../ui/SliderHandle.h"
|
||||
|
||||
class wxMouseState;
|
||||
class WaveTrack;
|
||||
|
||||
struct HitTestResult;
|
||||
|
@ -39,7 +40,7 @@ protected:
|
|||
|
||||
public:
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack);
|
||||
};
|
||||
|
||||
|
@ -66,7 +67,7 @@ protected:
|
|||
|
||||
public:
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<Track> &pTrack);
|
||||
};
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ Paul Licameli split from TrackPanel.cpp
|
|||
#include "../../../ui/TimeShiftHandle.h"
|
||||
|
||||
HitTestResult WaveTrack::DetailedHitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &st,
|
||||
const AudacityProject *pProject, int currentTool, bool bMultiTool)
|
||||
{
|
||||
// This is the only override of Track::DetailedHitTest that still
|
||||
|
@ -32,10 +32,10 @@ HitTestResult WaveTrack::DetailedHitTest
|
|||
// If that toolbar were eliminated, this could simplify to a sequence of
|
||||
// hit test routines describable by a table.
|
||||
|
||||
const auto wavetrack = static_cast<WaveTrack*>(event.pCell.get());
|
||||
const auto wavetrack = static_cast<WaveTrack*>(st.pCell.get());
|
||||
bool isWaveform = (wavetrack->GetDisplay() == WaveTrack::Waveform);
|
||||
|
||||
if (bMultiTool && event.event.CmdDown())
|
||||
if (bMultiTool && st.state.CmdDown())
|
||||
// Ctrl modifier key in multi-tool overrides everything else
|
||||
// (But this does not do the time shift constrained to the vertical only,
|
||||
// which is what happens when you hold Ctrl in the Time Shift tool mode)
|
||||
|
@ -47,7 +47,7 @@ HitTestResult WaveTrack::DetailedHitTest
|
|||
HitTestResult result;
|
||||
if (NULL !=
|
||||
(result = CutlineHandle::HitTest
|
||||
(event.event, event.rect, pProject, Pointer<WaveTrack>(this)))
|
||||
(st.state, st.rect, pProject, Pointer<WaveTrack>(this)))
|
||||
.preview.cursor)
|
||||
// This overriding test applies in all tools
|
||||
return result;
|
||||
|
@ -57,16 +57,16 @@ HitTestResult WaveTrack::DetailedHitTest
|
|||
// The priority of these, in case more than one might apply at one
|
||||
// point, seems arbitrary
|
||||
if (NULL != (result = EnvelopeHandle::WaveTrackHitTest
|
||||
(event.event, event.rect, pProject, Pointer<WaveTrack>(this)))
|
||||
(st.state, st.rect, pProject, Pointer<WaveTrack>(this)))
|
||||
.preview.cursor)
|
||||
;
|
||||
else if (NULL != (result = TimeShiftHandle::HitTest
|
||||
(event.event, event.rect, pProject)).preview.cursor)
|
||||
(st.state, st.rect, pProject)).preview.cursor)
|
||||
// This is the hit test on the "grips" drawn left and
|
||||
// right in Multi only
|
||||
;
|
||||
else if (NULL != (result = SampleHandle::HitTest
|
||||
(event.event, event.rect, pProject, Pointer<WaveTrack>(this))).preview.cursor)
|
||||
(st.state, st.rect, pProject, Pointer<WaveTrack>(this))).preview.cursor)
|
||||
;
|
||||
return result;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ HitTestResult WaveTrack::DetailedHitTest
|
|||
case envelopeTool:
|
||||
return EnvelopeHandle::HitAnywhere(pProject);
|
||||
case drawTool:
|
||||
return SampleHandle::HitAnywhere(event.event, pProject);
|
||||
return SampleHandle::HitAnywhere(st.state, pProject);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -30,10 +30,10 @@ WaveTrackVRulerControls::~WaveTrackVRulerControls()
|
|||
}
|
||||
|
||||
HitTestResult WaveTrackVRulerControls::HitTest
|
||||
(const TrackPanelMouseEvent &evt,
|
||||
(const TrackPanelMouseState &st,
|
||||
const AudacityProject *)
|
||||
{
|
||||
return WaveTrackVZoomHandle::HitTest(evt.event);
|
||||
return WaveTrackVZoomHandle::HitTest(st.state);
|
||||
}
|
||||
|
||||
unsigned WaveTrackVRulerControls::HandleWheelRotation
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
~WaveTrackVRulerControls();
|
||||
|
||||
HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *) override;
|
||||
|
||||
unsigned HandleWheelRotation
|
||||
|
|
|
@ -541,9 +541,9 @@ UIHandle::Result WaveTrackVZoomHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview WaveTrackVZoomHandle::Preview
|
||||
(const TrackPanelMouseEvent &evt, const AudacityProject *)
|
||||
(const TrackPanelMouseState &st, const AudacityProject *)
|
||||
{
|
||||
return HitPreview(evt.event);
|
||||
return HitPreview(st.state);
|
||||
}
|
||||
|
||||
UIHandle::Result WaveTrackVZoomHandle::Release
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -22,10 +22,10 @@ TimeTrackControls::~TimeTrackControls()
|
|||
}
|
||||
|
||||
HitTestResult TimeTrackControls::HitTest
|
||||
(const TrackPanelMouseEvent & event,
|
||||
(const TrackPanelMouseState & state,
|
||||
const AudacityProject *pProject)
|
||||
{
|
||||
return TrackControls::HitTest(event, pProject);
|
||||
return TrackControls::HitTest(state, pProject);
|
||||
}
|
||||
|
||||
enum
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
~TimeTrackControls();
|
||||
|
||||
HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject) override;
|
||||
|
||||
PopupMenuTable *GetMenuExtension(Track *pTrack) override;
|
||||
|
|
|
@ -19,11 +19,11 @@ Paul Licameli split from TrackPanel.cpp
|
|||
#include "../../ui/EnvelopeHandle.h"
|
||||
|
||||
HitTestResult TimeTrack::DetailedHitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &st,
|
||||
const AudacityProject *pProject, int, bool)
|
||||
{
|
||||
return EnvelopeHandle::TimeTrackHitTest
|
||||
( event.event, event.rect, pProject, Pointer<TimeTrack>(this) );
|
||||
( st.state, st.rect, pProject, Pointer<TimeTrack>(this) );
|
||||
}
|
||||
|
||||
std::shared_ptr<TrackControls> TimeTrack::GetControls()
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace
|
|||
{ return RefreshCode::RefreshNone; }
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *) override
|
||||
(const TrackPanelMouseState &, const AudacityProject *) override
|
||||
{ return HitPreview(); }
|
||||
|
||||
Result Release
|
||||
|
@ -96,7 +96,7 @@ BackgroundCell::~BackgroundCell()
|
|||
}
|
||||
|
||||
HitTestResult BackgroundCell::HitTest
|
||||
(const TrackPanelMouseEvent &,
|
||||
(const TrackPanelMouseState &,
|
||||
const AudacityProject *)
|
||||
{
|
||||
return BackgroundHandle::HitAnywhere();
|
||||
|
|
|
@ -26,8 +26,8 @@ public:
|
|||
|
||||
protected:
|
||||
HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
const AudacityProject *) override;
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject) override;
|
||||
|
||||
std::shared_ptr<Track> FindTrack() override;
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ UIHandle::Result ButtonHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview ButtonHandle::Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *)
|
||||
(const TrackPanelMouseState &, const AudacityProject *)
|
||||
{
|
||||
// No special message or cursor
|
||||
return {};
|
||||
|
|
|
@ -45,7 +45,7 @@ protected:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace {
|
|||
}
|
||||
|
||||
HitTestResult EnvelopeHandle::TimeTrackHitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<TimeTrack> &tt)
|
||||
{
|
||||
auto envelope = tt->GetEnvelope();
|
||||
|
@ -91,16 +91,16 @@ HitTestResult EnvelopeHandle::TimeTrackHitTest
|
|||
float zoomMin, zoomMax;
|
||||
GetTimeTrackData( *pProject, *tt, dBRange, dB, zoomMin, zoomMax);
|
||||
return EnvelopeHandle::HitEnvelope
|
||||
(event, rect, pProject, envelope, zoomMin, zoomMax, dB, dBRange);
|
||||
(state, rect, pProject, envelope, zoomMin, zoomMax, dB, dBRange);
|
||||
}
|
||||
|
||||
HitTestResult EnvelopeHandle::WaveTrackHitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<WaveTrack> &wt)
|
||||
{
|
||||
/// method that tells us if the mouse event landed on an
|
||||
/// envelope boundary.
|
||||
const Envelope *const envelope = wt->GetEnvelopeAtX(event.GetX());
|
||||
const Envelope *const envelope = wt->GetEnvelopeAtX(state.GetX());
|
||||
|
||||
if (!envelope)
|
||||
return {};
|
||||
|
@ -120,18 +120,18 @@ HitTestResult EnvelopeHandle::WaveTrackHitTest
|
|||
const float dBRange = wt->GetWaveformSettings().dBRange;
|
||||
|
||||
return EnvelopeHandle::HitEnvelope
|
||||
(event, rect, pProject, envelope, zoomMin, zoomMax, dB, dBRange);
|
||||
(state, rect, pProject, envelope, zoomMin, zoomMax, dB, dBRange);
|
||||
}
|
||||
|
||||
HitTestResult EnvelopeHandle::HitEnvelope
|
||||
(const wxMouseEvent &event, const wxRect &rect, const AudacityProject *pProject,
|
||||
(const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject,
|
||||
const Envelope *envelope, float zoomMin, float zoomMax,
|
||||
bool dB, float dBRange)
|
||||
{
|
||||
const ViewInfo &viewInfo = pProject->GetViewInfo();
|
||||
|
||||
const double envValue =
|
||||
envelope->GetValue(viewInfo.PositionToTime(event.m_x, rect.x));
|
||||
envelope->GetValue(viewInfo.PositionToTime(state.m_x, rect.x));
|
||||
|
||||
// Get y position of envelope point.
|
||||
int yValue = GetWaveYPos(envValue,
|
||||
|
@ -144,7 +144,7 @@ HitTestResult EnvelopeHandle::HitEnvelope
|
|||
rect.height, dB, true, dBRange, false) + rect.y;
|
||||
|
||||
// Get y distance of mouse from center line (in pixels).
|
||||
int yMouse = abs(ctr - event.m_y);
|
||||
int yMouse = abs(ctr - state.m_y);
|
||||
// Get y distance of envelope from center line (in pixels)
|
||||
yValue = abs(ctr - yValue);
|
||||
|
||||
|
@ -255,7 +255,7 @@ UIHandle::Result EnvelopeHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview EnvelopeHandle::Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &, const AudacityProject *pProject)
|
||||
{
|
||||
return HitPreview(pProject, false);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ Paul Licameli split from TrackPanel.cpp
|
|||
#include "../../MemoryX.h"
|
||||
|
||||
class wxMouseEvent;
|
||||
class wxMouseState;
|
||||
#include <wx/gdicmn.h>
|
||||
|
||||
class Envelope;
|
||||
|
@ -33,7 +34,7 @@ class EnvelopeHandle final : public UIHandle
|
|||
static HitTestPreview HitPreview(const AudacityProject *pProject, bool unsafe);
|
||||
|
||||
static HitTestResult HitEnvelope
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject,
|
||||
const Envelope *envelope, float zoomMin, float zoomMax,
|
||||
bool dB, float dBRange);
|
||||
|
@ -41,10 +42,10 @@ class EnvelopeHandle final : public UIHandle
|
|||
public:
|
||||
static HitTestResult HitAnywhere(const AudacityProject *pProject);
|
||||
static HitTestResult TimeTrackHitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<TimeTrack> &tt);
|
||||
static HitTestResult WaveTrackHitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const AudacityProject *pProject, const std::shared_ptr<WaveTrack> &wt);
|
||||
|
||||
virtual ~EnvelopeHandle();
|
||||
|
@ -56,7 +57,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -150,7 +150,7 @@ namespace
|
|||
|
||||
bool IsOverSplitline
|
||||
(const ViewInfo &viewInfo, const WaveTrack * track,
|
||||
const wxRect &rect, const wxMouseEvent &event,
|
||||
const wxRect &rect, const wxMouseState &state,
|
||||
WaveTrackLocation *pCapturedTrackLocation)
|
||||
{
|
||||
for (auto loc: track->GetCachedLocations())
|
||||
|
@ -167,7 +167,7 @@ namespace
|
|||
locRect.width = 1;
|
||||
locRect.y = rect.y;
|
||||
locRect.height = rect.height;
|
||||
if (locRect.Contains(event.m_x, event.m_y))
|
||||
if (locRect.Contains(state.m_x, state.m_y))
|
||||
{
|
||||
if (pCapturedTrackLocation)
|
||||
*pCapturedTrackLocation = loc;
|
||||
|
@ -222,7 +222,7 @@ namespace
|
|||
|
||||
SelectionBoundary ChooseBoundary
|
||||
(const ViewInfo &viewInfo,
|
||||
const wxMouseEvent & event, const Track *pTrack, const wxRect &rect,
|
||||
const wxMouseState & state, const Track *pTrack, const wxRect &rect,
|
||||
bool mayDragWidth, bool onlyWithinSnapDistance,
|
||||
double *pPinValue = NULL)
|
||||
{
|
||||
|
@ -231,7 +231,7 @@ namespace
|
|||
// within the time boundaries.
|
||||
// May choose no boundary if onlyWithinSnapDistance is true.
|
||||
// Otherwise choose the eligible boundary nearest the mouse click.
|
||||
const double selend = viewInfo.PositionToTime(event.m_x, rect.x);
|
||||
const double selend = viewInfo.PositionToTime(state.m_x, rect.x);
|
||||
wxInt64 pixelDist = 0;
|
||||
const double t0 = viewInfo.selectedRegion.t0();
|
||||
const double t1 = viewInfo.selectedRegion.t1();
|
||||
|
@ -249,7 +249,7 @@ namespace
|
|||
WaveTrackLocation location;
|
||||
// We have to be EXACTLY (to the pixel) over the split line for the
|
||||
// hand icon to appear.
|
||||
if( IsOverSplitline( viewInfo, wavetrack, rect,event,&location ))
|
||||
if( IsOverSplitline( viewInfo, wavetrack, rect, state ,&location ))
|
||||
{
|
||||
boundary = ChooseTimeBoundary(selend, selend, viewInfo, selend,
|
||||
onlyWithinSnapDistance, &pixelDist, pPinValue);
|
||||
|
@ -280,13 +280,13 @@ namespace
|
|||
const wxInt64 topSel = (f1 >= 0)
|
||||
? FrequencyToPosition(wt, f1, rect.y, rect.height)
|
||||
: rect.y;
|
||||
wxInt64 signedBottomDist = (int)(event.m_y - bottomSel);
|
||||
wxInt64 signedBottomDist = (int)(state.m_y - bottomSel);
|
||||
wxInt64 verticalDist = std::abs(signedBottomDist);
|
||||
if (bottomSel == topSel)
|
||||
// Top and bottom are too close to resolve on screen
|
||||
chooseBottom = (signedBottomDist >= 0);
|
||||
else {
|
||||
const wxInt64 topDist = std::abs((int)(event.m_y - topSel));
|
||||
const wxInt64 topDist = std::abs((int)(state.m_y - topSel));
|
||||
if (topDist < verticalDist)
|
||||
chooseBottom = false, verticalDist = topDist;
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ namespace
|
|||
) {
|
||||
const wxInt64 centerSel =
|
||||
FrequencyToPosition(wt, fc, rect.y, rect.height);
|
||||
const wxInt64 centerDist = abs((int)(event.m_y - centerSel));
|
||||
const wxInt64 centerDist = abs((int)(state.m_y - centerSel));
|
||||
if (centerDist < verticalDist)
|
||||
chooseCenter = true, verticalDist = centerDist,
|
||||
ratio = f1 / fc;
|
||||
|
@ -423,11 +423,11 @@ namespace
|
|||
}
|
||||
|
||||
HitTestResult SelectHandle::HitTest
|
||||
(const TrackPanelMouseEvent &evt, const AudacityProject *pProject,
|
||||
(const TrackPanelMouseState &st, const AudacityProject *pProject,
|
||||
const std::shared_ptr<Track> &pTrack)
|
||||
{
|
||||
const wxMouseEvent &event = evt.event;
|
||||
const wxRect &rect = evt.rect;
|
||||
const wxMouseState &state = st.state;
|
||||
const wxRect &rect = st.rect;
|
||||
|
||||
wxCursor *pCursor = SelectCursor();
|
||||
const bool bMultiToolMode = pProject->GetToolsToolBar()->IsDown(multiTool);
|
||||
|
@ -470,8 +470,8 @@ HitTestResult SelectHandle::HitTest
|
|||
wxASSERT(!(rightSel < leftSel));
|
||||
}
|
||||
|
||||
const bool bShiftDown = event.ShiftDown();
|
||||
const bool bCtrlDown = event.ControlDown();
|
||||
const bool bShiftDown = state.ShiftDown();
|
||||
const bool bCtrlDown = state.ControlDown();
|
||||
const bool bModifierDown = bShiftDown || bCtrlDown;
|
||||
|
||||
#if 0
|
||||
|
@ -493,7 +493,7 @@ HitTestResult SelectHandle::HitTest
|
|||
// choose boundaries only in snapping tolerance,
|
||||
// and may choose center.
|
||||
SelectionBoundary boundary =
|
||||
ChooseBoundary(viewInfo, event, pTrack.get(), rect, !bModifierDown, !bModifierDown);
|
||||
ChooseBoundary(viewInfo, state, pTrack.get(), rect, !bModifierDown, !bModifierDown);
|
||||
|
||||
SetTipAndCursorForBoundary(boundary, !bShiftDown, tip, pCursor);
|
||||
|
||||
|
@ -888,7 +888,7 @@ UIHandle::Result SelectHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview SelectHandle::Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &, const AudacityProject *pProject)
|
||||
{
|
||||
wxString tip;
|
||||
wxCursor *pCursor;
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
// This always hits, but details of the hit vary with mouse position and
|
||||
// key state.
|
||||
static HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject,
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject,
|
||||
const std::shared_ptr<Track> &pTrack);
|
||||
|
||||
virtual ~SelectHandle();
|
||||
|
@ -52,7 +52,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject);
|
||||
|
||||
virtual HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject);
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject);
|
||||
|
||||
virtual Result Release
|
||||
(const TrackPanelMouseEvent &event, AudacityProject *pProject,
|
||||
|
|
|
@ -64,7 +64,7 @@ UIHandle::Result SliderHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview SliderHandle::Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *)
|
||||
(const TrackPanelMouseState &, const AudacityProject *)
|
||||
{
|
||||
// No special message or cursor
|
||||
return {};
|
||||
|
|
|
@ -47,7 +47,7 @@ protected:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -63,7 +63,7 @@ HitTestResult TimeShiftHandle::HitAnywhere(const AudacityProject *pProject)
|
|||
}
|
||||
|
||||
HitTestResult TimeShiftHandle::HitTest
|
||||
(const wxMouseEvent & event, const wxRect &rect, const AudacityProject *pProject)
|
||||
(const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject)
|
||||
{
|
||||
/// method that tells us if the mouse event landed on a
|
||||
/// time-slider that allows us to time shift the sequence.
|
||||
|
@ -78,8 +78,8 @@ HitTestResult TimeShiftHandle::HitTest
|
|||
const int hotspotOffset = 5;
|
||||
|
||||
// We are doing an approximate test here - is the mouse in the right or left border?
|
||||
if (!(event.m_x + hotspotOffset < rect.x + adjustedDragHandleWidth ||
|
||||
event.m_x + hotspotOffset >= rect.x + rect.width - adjustedDragHandleWidth))
|
||||
if (!(state.m_x + hotspotOffset < rect.x + adjustedDragHandleWidth ||
|
||||
state.m_x + hotspotOffset >= rect.x + rect.width - adjustedDragHandleWidth))
|
||||
return {};
|
||||
|
||||
return HitAnywhere(pProject);
|
||||
|
@ -769,7 +769,7 @@ UIHandle::Result TimeShiftHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview TimeShiftHandle::Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &, const AudacityProject *pProject)
|
||||
{
|
||||
return HitPreview(pProject, false);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
|
||||
static HitTestResult HitAnywhere(const AudacityProject *pProject);
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect, const AudacityProject *pProject);
|
||||
(const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject);
|
||||
|
||||
virtual ~TimeShiftHandle();
|
||||
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -55,12 +55,12 @@ UIHandle::Result MinimizeButtonHandle::CommitChanges
|
|||
}
|
||||
|
||||
HitTestResult MinimizeButtonHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect)
|
||||
(const wxMouseState &state, const wxRect &rect)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
TrackInfo::GetMinimizeRect(rect, buttonRect);
|
||||
|
||||
if (buttonRect.Contains(event.m_x, event.m_y)) {
|
||||
if (buttonRect.Contains(state.m_x, state.m_y)) {
|
||||
Instance().mRect = buttonRect;
|
||||
return {
|
||||
HitPreview(),
|
||||
|
@ -112,12 +112,12 @@ UIHandle::Result CloseButtonHandle::CommitChanges
|
|||
}
|
||||
|
||||
HitTestResult CloseButtonHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect)
|
||||
(const wxMouseState &state, const wxRect &rect)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
TrackInfo::GetCloseBoxRect(rect, buttonRect);
|
||||
|
||||
if (buttonRect.Contains(event.m_x, event.m_y)) {
|
||||
if (buttonRect.Contains(state.m_x, state.m_y)) {
|
||||
Instance().mRect = buttonRect;
|
||||
return {
|
||||
HitPreview(),
|
||||
|
@ -155,13 +155,13 @@ UIHandle::Result MenuButtonHandle::CommitChanges
|
|||
}
|
||||
|
||||
HitTestResult MenuButtonHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const std::shared_ptr<TrackPanelCell> &pCell)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
TrackInfo::GetTitleBarRect(rect, buttonRect);
|
||||
|
||||
if (buttonRect.Contains(event.m_x, event.m_y)) {
|
||||
if (buttonRect.Contains(state.m_x, state.m_y)) {
|
||||
Instance().mpCell = pCell;
|
||||
Instance().mRect = buttonRect;
|
||||
return {
|
||||
|
|
|
@ -13,6 +13,7 @@ Paul Licameli split from TrackPanel.cpp
|
|||
|
||||
#include "../ui/ButtonHandle.h"
|
||||
|
||||
class wxMouseState;
|
||||
struct HitTestResult;
|
||||
|
||||
class MinimizeButtonHandle final : public ButtonHandle
|
||||
|
@ -30,7 +31,7 @@ protected:
|
|||
override;
|
||||
|
||||
public:
|
||||
static HitTestResult HitTest(const wxMouseEvent &event, const wxRect &rect);
|
||||
static HitTestResult HitTest(const wxMouseState &state, const wxRect &rect);
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -52,7 +53,7 @@ protected:
|
|||
bool StopsOnKeystroke () override { return true; }
|
||||
|
||||
public:
|
||||
static HitTestResult HitTest(const wxMouseEvent &event, const wxRect &rect);
|
||||
static HitTestResult HitTest(const wxMouseState &state, const wxRect &rect);
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -76,7 +77,7 @@ protected:
|
|||
|
||||
public:
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const std::shared_ptr<TrackPanelCell> &pCell);
|
||||
|
||||
private:
|
||||
|
|
|
@ -38,21 +38,21 @@ std::shared_ptr<Track> TrackControls::FindTrack()
|
|||
}
|
||||
|
||||
HitTestResult TrackControls::HitTest
|
||||
(const TrackPanelMouseEvent &evt,
|
||||
(const TrackPanelMouseState &st,
|
||||
const AudacityProject *project)
|
||||
{
|
||||
const wxMouseEvent &event = evt.event;
|
||||
const wxRect &rect = evt.rect;
|
||||
const wxMouseState &state = st.state;
|
||||
const wxRect &rect = st.rect;
|
||||
HitTestResult result;
|
||||
|
||||
if (NULL != (result = CloseButtonHandle::HitTest(event, rect)).handle)
|
||||
if (NULL != (result = CloseButtonHandle::HitTest(state, rect)).handle)
|
||||
return result;
|
||||
|
||||
if (NULL != (result = MenuButtonHandle::HitTest(event, rect,
|
||||
if (NULL != (result = MenuButtonHandle::HitTest(state, rect,
|
||||
this->FindTrack()->GetTrackControl())).handle)
|
||||
return result;
|
||||
|
||||
if (NULL != (result = MinimizeButtonHandle::HitTest(event, rect)).handle)
|
||||
if (NULL != (result = MinimizeButtonHandle::HitTest(state, rect)).handle)
|
||||
return result;
|
||||
|
||||
return TrackSelectHandle::HitAnywhere
|
||||
|
|
|
@ -44,7 +44,7 @@ protected:
|
|||
// An override is supplied for derived classes to call through but it is
|
||||
// still marked pure virtual
|
||||
virtual HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *) override = 0;
|
||||
|
||||
unsigned DoContextMenu
|
||||
|
|
|
@ -163,7 +163,7 @@ UIHandle::Result TrackSelectHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview TrackSelectHandle::Preview
|
||||
(const TrackPanelMouseEvent &, const AudacityProject *project)
|
||||
(const TrackPanelMouseState &, const AudacityProject *project)
|
||||
{
|
||||
// Note that this differs from HitPreview.
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
|
@ -25,7 +25,7 @@ Paul Licameli split from TrackPanel.cpp
|
|||
#include "../../TrackPanelResizerCell.h"
|
||||
|
||||
HitTestResult Track::HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &st,
|
||||
const AudacityProject *pProject)
|
||||
{
|
||||
const ToolsToolBar * pTtb = pProject->GetToolsToolBar();
|
||||
|
@ -35,11 +35,11 @@ HitTestResult Track::HitTest
|
|||
if ( !isMultiTool && currentTool == zoomTool )
|
||||
// Zoom tool is a non-selecting tool that takes precedence in all tracks
|
||||
// over all other tools, no matter what detail you point at.
|
||||
return ZoomHandle::HitAnywhere(event.event, pProject);
|
||||
return ZoomHandle::HitAnywhere(st.state, pProject);
|
||||
|
||||
// In other tools, let subclasses determine detailed hits.
|
||||
HitTestResult result =
|
||||
DetailedHitTest( event, pProject, currentTool, isMultiTool );
|
||||
DetailedHitTest( st, pProject, currentTool, isMultiTool );
|
||||
|
||||
// If there is no detailed hit for the subclass, there are still some
|
||||
// general cases.
|
||||
|
@ -54,11 +54,11 @@ HitTestResult Track::HitTest
|
|||
// Let the multi-tool right-click handler apply only in default of all
|
||||
// other detailed hits.
|
||||
if ( !result.handle && isMultiTool )
|
||||
result = ZoomHandle::HitTest(event.event, pProject);
|
||||
result = ZoomHandle::HitTest(st.state, pProject);
|
||||
|
||||
// Finally, default of all is adjustment of the selection box.
|
||||
if ( !result.handle && ( isMultiTool || currentTool == selectTool) )
|
||||
result = SelectHandle::HitTest(event, pProject, Pointer(this));
|
||||
result = SelectHandle::HitTest(st, pProject, Pointer(this));
|
||||
|
||||
result.preview.refreshCode |= refresh;
|
||||
return result;
|
||||
|
|
|
@ -33,7 +33,7 @@ std::shared_ptr<Track> TrackVRulerControls::FindTrack()
|
|||
}
|
||||
|
||||
HitTestResult TrackVRulerControls::HitTest
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &, const AudacityProject *)
|
||||
{
|
||||
// Use a space for the tip, otherwise we get the default message.
|
||||
static wxCursor arrowCursor{ wxCURSOR_ARROW };
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
// Define a default hit test method, just for message and cursor
|
||||
HitTestResult HitTest
|
||||
(const TrackPanelMouseEvent &event,
|
||||
(const TrackPanelMouseState &state,
|
||||
const AudacityProject *pProject) override;
|
||||
|
||||
static void DrawZooming
|
||||
|
|
|
@ -48,7 +48,7 @@ ZoomHandle &ZoomHandle::Instance()
|
|||
}
|
||||
|
||||
HitTestPreview ZoomHandle::HitPreview
|
||||
(const wxMouseEvent &event, const AudacityProject *pProject)
|
||||
(const wxMouseState &state, const AudacityProject *pProject)
|
||||
{
|
||||
static auto zoomInCursor =
|
||||
::MakeCursor(wxCURSOR_MAGNIFIER, ZoomInCursorXpm, 19, 15);
|
||||
|
@ -57,21 +57,21 @@ HitTestPreview ZoomHandle::HitPreview
|
|||
const ToolsToolBar *const ttb = pProject->GetToolsToolBar();
|
||||
return {
|
||||
ttb->GetMessageForTool(zoomTool),
|
||||
(event.ShiftDown() ? &*zoomOutCursor : &*zoomInCursor)
|
||||
(state.ShiftDown() ? &*zoomOutCursor : &*zoomInCursor)
|
||||
};
|
||||
}
|
||||
|
||||
HitTestResult ZoomHandle::HitAnywhere
|
||||
(const wxMouseEvent &event, const AudacityProject *pProject)
|
||||
(const wxMouseState &state, const AudacityProject *pProject)
|
||||
{
|
||||
return { HitPreview(event, pProject), &Instance() };
|
||||
return { HitPreview(state, pProject), &Instance() };
|
||||
}
|
||||
|
||||
HitTestResult ZoomHandle::HitTest
|
||||
(const wxMouseEvent &event, const AudacityProject *pProject)
|
||||
(const wxMouseState &state, const AudacityProject *pProject)
|
||||
{
|
||||
if (event.ButtonIsDown(wxMOUSE_BTN_RIGHT) || event.RightUp())
|
||||
return HitAnywhere(event, pProject);
|
||||
if (state.ButtonIsDown(wxMOUSE_BTN_RIGHT))
|
||||
return HitAnywhere(state, pProject);
|
||||
else
|
||||
return {};
|
||||
}
|
||||
|
@ -115,9 +115,9 @@ UIHandle::Result ZoomHandle::Drag
|
|||
}
|
||||
|
||||
HitTestPreview ZoomHandle::Preview
|
||||
(const TrackPanelMouseEvent &evt, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &st, const AudacityProject *pProject)
|
||||
{
|
||||
return HitPreview(evt.event, pProject);
|
||||
return HitPreview(st.state, pProject);
|
||||
}
|
||||
|
||||
UIHandle::Result ZoomHandle::Release
|
||||
|
|
|
@ -13,7 +13,7 @@ Paul Licameli split from TrackPanel.cpp
|
|||
|
||||
#include "../../UIHandle.h"
|
||||
|
||||
class wxMouseEvent;
|
||||
class wxMouseState;
|
||||
#include <wx/gdicmn.h>
|
||||
|
||||
struct HitTestResult;
|
||||
|
@ -25,13 +25,13 @@ class ZoomHandle final : public UIHandle
|
|||
ZoomHandle &operator=(const ZoomHandle&) = delete;
|
||||
static ZoomHandle& Instance();
|
||||
static HitTestPreview HitPreview
|
||||
(const wxMouseEvent &event, const AudacityProject *pProject);
|
||||
(const wxMouseState &state, const AudacityProject *pProject);
|
||||
|
||||
public:
|
||||
static HitTestResult HitAnywhere
|
||||
(const wxMouseEvent &event, const AudacityProject *pProject);
|
||||
(const wxMouseState &state, const AudacityProject *pProject);
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const AudacityProject *pProject);
|
||||
(const wxMouseState &state, const AudacityProject *pProject);
|
||||
|
||||
virtual ~ZoomHandle();
|
||||
|
||||
|
@ -42,7 +42,7 @@ public:
|
|||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
HitTestPreview Preview
|
||||
(const TrackPanelMouseEvent &event, const AudacityProject *pProject)
|
||||
(const TrackPanelMouseState &state, const AudacityProject *pProject)
|
||||
override;
|
||||
|
||||
Result Release
|
||||
|
|
Loading…
Reference in New Issue