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 dgui.core.events.mouseeventargs; 10 11 public import dgui.core.events.eventargs; 12 import dgui.core.geometry; 13 import dgui.core.winapi; 14 15 enum MouseWheel: ubyte 16 { 17 up, 18 down, 19 } 20 21 enum MouseKeys: uint 22 { 23 none = 0, // No mouse buttons specified. 24 25 // Standard mouse keys 26 left = MK_LBUTTON, 27 right = MK_RBUTTON, 28 middle = MK_MBUTTON, 29 30 // Windows 2000+ 31 //XBUTTON1 = 0x0800000, 32 //XBUTTON2 = 0x1000000, 33 } 34 35 class MouseEventArgs: EventArgs 36 { 37 private MouseKeys _mKeys; 38 private Point _cursorPos; 39 40 public this(Point cursorPos, MouseKeys mk) 41 { 42 this._cursorPos = cursorPos; 43 this._mKeys = mk; 44 } 45 46 @property public Point location() 47 { 48 return this._cursorPos; 49 } 50 51 @property public MouseKeys keys() 52 { 53 return this._mKeys; 54 } 55 } 56 57 class MouseWheelEventArgs: MouseEventArgs 58 { 59 private MouseWheel _mw; 60 61 public this(Point cursorPos, MouseKeys mk, MouseWheel mw) 62 { 63 this._mw = mw; 64 65 super(cursorPos, mk); 66 } 67 68 @property public MouseWheel wheel() 69 { 70 return this._mw; 71 } 72 }