forked from Sneeds-Feed-and-Seed/sneedacity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrackPanelMouseEvent.h
65 lines (53 loc) · 1.61 KB
/
TrackPanelMouseEvent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**********************************************************************
Sneedacity: A Digital Audio Editor
TrackPanelMouseEvent.h
Paul Licameli
**********************************************************************/
#ifndef __SNEEDACITY_TRACK_PANEL_MOUSE_EVENT__
#define __SNEEDACITY_TRACK_PANEL_MOUSE_EVENT__
class wxMouseEvent;
class wxMouseState;
class wxRect;
class wxSize;
class TrackPanelCell;
#include <memory>
// This is a hack so that the code that fakes a MOUSE_LEFT_BTN_UP on
// capture lost doesn't get in the way of handling MOUSE_RIGHT_BTN_UP.
const int kCaptureLostEventId = 19019;
// 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