Audacity 3.2.0
TrackPanelMouseEvent.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5TrackPanelMouseEvent.h
6
7Paul Licameli
8
9**********************************************************************/
10
11#ifndef __AUDACITY_TRACK_PANEL_MOUSE_EVENT__
12#define __AUDACITY_TRACK_PANEL_MOUSE_EVENT__
13
14class wxMouseEvent;
15class wxMouseState;
16class wxRect;
17class wxSize;
18class TrackPanelCell;
19#include <memory>
20
21// This is a hack so that the code that fakes a MOUSE_LEFT_BTN_UP on
22// capture lost doesn't get in the way of handling MOUSE_RIGHT_BTN_UP.
23const int kCaptureLostEventId = 19019;
24
25// Augment a mouse state with information about which track panel cell and
26// sub-rectangle was hit.
28{
30 ( wxMouseState &state_, const wxRect &rect_,
31 const std::shared_ptr<TrackPanelCell> &pCell_ )
32 : state{ state_ }
33 , rect{ rect_ }
34 , pCell{ pCell_ }
35 {
36 }
37
38 wxMouseState &state;
39 const wxRect &rect;
40 std::shared_ptr<TrackPanelCell> pCell; // may be NULL
41};
42
43// Augment a mouse event with information about which track panel cell and
44// sub-rectangle was hit.
46{
48 ( wxMouseEvent &event_, const wxRect &rect_, const wxSize &whole_,
49 const std::shared_ptr<TrackPanelCell> &pCell_ )
50 : event{ event_ }
51 , rect{ rect_ }
52 , whole{ whole_ }
53 , pCell{ pCell_ }
54 , steps{ 0 }
55 {
56 }
57
58 wxMouseEvent &event;
59 const wxRect &rect;
60 const wxSize &whole;
61 std::shared_ptr<TrackPanelCell> pCell; // may be NULL
62 double steps; // for mouse wheel rotation
63};
64
65#endif
const int kCaptureLostEventId
TrackPanelMouseEvent(wxMouseEvent &event_, const wxRect &rect_, const wxSize &whole_, const std::shared_ptr< TrackPanelCell > &pCell_)
std::shared_ptr< TrackPanelCell > pCell
std::shared_ptr< TrackPanelCell > pCell
TrackPanelMouseState(wxMouseState &state_, const wxRect &rect_, const std::shared_ptr< TrackPanelCell > &pCell_)