1 /** DGui project file.
2 
3 Copyright: Trogu Antonio Davide 2011-2013
4 
5 License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
6 
7 Authors: Trogu Antonio Davide
8 */
9 module dguihub.core.events.mouseeventargs;
10 
11 public import dguihub.core.events.eventargs;
12 import dguihub.core.geometry;
13 import dguihub.core.winapi;
14 
15 enum MouseWheel : ubyte {
16    up,
17    down,
18 }
19 
20 enum MouseKeys : uint {
21    none = 0, // No mouse buttons specified.
22 
23    // Standard mouse keys
24    left = MK_LBUTTON,
25    right = MK_RBUTTON,
26    middle = MK_MBUTTON,// Windows 2000+
27    //XBUTTON1 = 0x0800000,
28    //XBUTTON2 = 0x1000000,
29 }
30 
31 class MouseEventArgs : EventArgs {
32    private MouseKeys _mKeys;
33    private Point _cursorPos;
34 
35    public this(Point cursorPos, MouseKeys mk) {
36       this._cursorPos = cursorPos;
37       this._mKeys = mk;
38    }
39 
40    @property public Point location() {
41       return this._cursorPos;
42    }
43 
44    @property public MouseKeys keys() {
45       return this._mKeys;
46    }
47 }
48 
49 class MouseWheelEventArgs : MouseEventArgs {
50    private MouseWheel _mw;
51 
52    public this(Point cursorPos, MouseKeys mk, MouseWheel mw) {
53       this._mw = mw;
54 
55       super(cursorPos, mk);
56    }
57 
58    @property public MouseWheel wheel() {
59       return this._mw;
60    }
61 }