mirror of
https://github.com/cookiengineer/audacity
synced 2026-04-12 09:10:38 +02:00
... 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.
62 lines
1.4 KiB
C++
62 lines
1.4 KiB
C++
/**********************************************************************
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
TrackPanelMouseEvent.h
|
|
|
|
Paul Licameli
|
|
|
|
**********************************************************************/
|
|
|
|
#ifndef __AUDACITY_TRACK_PANEL_MOUSE_EVENT__
|
|
#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
|
|
{
|
|
TrackPanelMouseEvent
|
|
( wxMouseEvent &event_, const wxRect &rect_, const wxSize &whole_,
|
|
const std::shared_ptr<TrackPanelCell> &pCell_ )
|
|
: event{ event_ }
|
|
, rect{ rect_ }
|
|
, whole{ whole_ }
|
|
, pCell{ pCell_ }
|
|
, steps{ 0 }
|
|
{
|
|
}
|
|
|
|
wxMouseEvent &event;
|
|
const wxRect ▭
|
|
const wxSize &whole;
|
|
std::shared_ptr<TrackPanelCell> pCell; // may be NULL
|
|
double steps; // for mouse wheel rotation
|
|
};
|
|
|
|
#endif
|