[12762] | 1 | using System;
|
---|
| 2 |
|
---|
| 3 | using SharpVectors.Dom.Views;
|
---|
| 4 |
|
---|
| 5 | namespace SharpVectors.Dom.Events
|
---|
| 6 | {
|
---|
| 7 | /// <summary>
|
---|
| 8 | /// Summary description for MouseEvent.
|
---|
| 9 | /// </summary>
|
---|
| 10 | public class MouseEvent : UiEvent, IMouseEvent
|
---|
| 11 | {
|
---|
| 12 | #region Private Fields
|
---|
| 13 |
|
---|
| 14 | private long screenX;
|
---|
| 15 | private long screeny;
|
---|
| 16 | private long clientX;
|
---|
| 17 | private long clientY;
|
---|
| 18 | private bool crtlKey;
|
---|
| 19 | private bool shiftKey;
|
---|
| 20 | private bool altKey;
|
---|
| 21 | private bool metaKey;
|
---|
| 22 | private ushort button;
|
---|
| 23 | private IEventTarget relatedTarget;
|
---|
| 24 | private bool altGraphKey;
|
---|
| 25 |
|
---|
| 26 | #endregion
|
---|
| 27 |
|
---|
| 28 | #region Constructors
|
---|
| 29 |
|
---|
| 30 | public MouseEvent()
|
---|
| 31 | {
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | public MouseEvent(
|
---|
| 35 | string eventType,
|
---|
| 36 | bool bubbles,
|
---|
| 37 | bool cancelable,
|
---|
| 38 | IAbstractView view,
|
---|
| 39 | long detail,
|
---|
| 40 | long screenX,
|
---|
| 41 | long screenY,
|
---|
| 42 | long clientX,
|
---|
| 43 | long clientY,
|
---|
| 44 | bool ctrlKey,
|
---|
| 45 | bool altKey,
|
---|
| 46 | bool shiftKey,
|
---|
| 47 | bool metaKey,
|
---|
| 48 | ushort button,
|
---|
| 49 | IEventTarget relatedTarget)
|
---|
| 50 | {
|
---|
| 51 | InitMouseEvent(
|
---|
| 52 | eventType, bubbles, cancelable, view, detail,
|
---|
| 53 | screenX, screenY, clientX, clientY,
|
---|
| 54 | ctrlKey, altKey, shiftKey, metaKey, button,
|
---|
| 55 | relatedTarget);
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | public MouseEvent(
|
---|
| 59 | string namespaceUri,
|
---|
| 60 | string eventType,
|
---|
| 61 | bool bubbles,
|
---|
| 62 | bool cancelable,
|
---|
| 63 | IAbstractView view,
|
---|
| 64 | long detail,
|
---|
| 65 | long screenX,
|
---|
| 66 | long screenY,
|
---|
| 67 | long clientX,
|
---|
| 68 | long clientY,
|
---|
| 69 | bool ctrlKey,
|
---|
| 70 | bool altKey,
|
---|
| 71 | bool shiftKey,
|
---|
| 72 | bool metaKey,
|
---|
| 73 | ushort button,
|
---|
| 74 | IEventTarget relatedTarget,
|
---|
| 75 | bool altGraphKey)
|
---|
| 76 | {
|
---|
| 77 | InitMouseEventNs(
|
---|
| 78 | namespaceUri, eventType, bubbles, cancelable, view, detail,
|
---|
| 79 | screenX, screenY, clientX, clientY,
|
---|
| 80 | ctrlKey, altKey, shiftKey, metaKey, button,
|
---|
| 81 | relatedTarget, altGraphKey);
|
---|
| 82 | }
|
---|
| 83 |
|
---|
| 84 | public MouseEvent(
|
---|
| 85 | EventType eventType,
|
---|
| 86 | bool bubbles,
|
---|
| 87 | bool cancelable,
|
---|
| 88 | IAbstractView view,
|
---|
| 89 | long detail,
|
---|
| 90 | long screenX,
|
---|
| 91 | long screenY,
|
---|
| 92 | long clientX,
|
---|
| 93 | long clientY,
|
---|
| 94 | bool ctrlKey,
|
---|
| 95 | bool altKey,
|
---|
| 96 | bool shiftKey,
|
---|
| 97 | bool metaKey,
|
---|
| 98 | ushort button,
|
---|
| 99 | IEventTarget relatedTarget,
|
---|
| 100 | bool altGraphKey)
|
---|
| 101 | {
|
---|
| 102 | InitMouseEventNs(
|
---|
| 103 | eventType.NamespaceUri, eventType.Name,
|
---|
| 104 | bubbles, cancelable, view, detail,
|
---|
| 105 | screenX, screenY, clientX, clientY,
|
---|
| 106 | ctrlKey, altKey, shiftKey, metaKey, button,
|
---|
| 107 | relatedTarget, altGraphKey);
|
---|
| 108 | }
|
---|
| 109 |
|
---|
| 110 | #endregion
|
---|
| 111 |
|
---|
| 112 | #region IMouseEvent interface
|
---|
| 113 |
|
---|
| 114 | #region Public Properties
|
---|
| 115 |
|
---|
| 116 | public long ScreenX
|
---|
| 117 | {
|
---|
| 118 | get
|
---|
| 119 | {
|
---|
| 120 | return screenX;
|
---|
| 121 | }
|
---|
| 122 | }
|
---|
| 123 |
|
---|
| 124 | public long ScreenY
|
---|
| 125 | {
|
---|
| 126 | get
|
---|
| 127 | {
|
---|
| 128 | return screeny;
|
---|
| 129 | }
|
---|
| 130 | }
|
---|
| 131 |
|
---|
| 132 | public long ClientX
|
---|
| 133 | {
|
---|
| 134 | get
|
---|
| 135 | {
|
---|
| 136 | return clientX;
|
---|
| 137 | }
|
---|
| 138 | }
|
---|
| 139 |
|
---|
| 140 | public long ClientY
|
---|
| 141 | {
|
---|
| 142 | get
|
---|
| 143 | {
|
---|
| 144 | return clientY;
|
---|
| 145 | }
|
---|
| 146 | }
|
---|
| 147 |
|
---|
| 148 | public bool CtrlKey
|
---|
| 149 | {
|
---|
| 150 | get
|
---|
| 151 | {
|
---|
| 152 | return crtlKey;
|
---|
| 153 | }
|
---|
| 154 | }
|
---|
| 155 |
|
---|
| 156 | public bool ShiftKey
|
---|
| 157 | {
|
---|
| 158 | get
|
---|
| 159 | {
|
---|
| 160 | return shiftKey;
|
---|
| 161 | }
|
---|
| 162 | }
|
---|
| 163 |
|
---|
| 164 | public bool AltKey
|
---|
| 165 | {
|
---|
| 166 | get
|
---|
| 167 | {
|
---|
| 168 | return altKey;
|
---|
| 169 | }
|
---|
| 170 | }
|
---|
| 171 |
|
---|
| 172 | public bool MetaKey
|
---|
| 173 | {
|
---|
| 174 | get
|
---|
| 175 | {
|
---|
| 176 | return metaKey;
|
---|
| 177 | }
|
---|
| 178 | }
|
---|
| 179 |
|
---|
| 180 | public ushort Button
|
---|
| 181 | {
|
---|
| 182 | get
|
---|
| 183 | {
|
---|
| 184 | return button;
|
---|
| 185 | }
|
---|
| 186 | }
|
---|
| 187 |
|
---|
| 188 | public IEventTarget RelatedTarget
|
---|
| 189 | {
|
---|
| 190 | get
|
---|
| 191 | {
|
---|
| 192 | return relatedTarget;
|
---|
| 193 | }
|
---|
| 194 | }
|
---|
| 195 |
|
---|
| 196 | public bool AltGraphKey
|
---|
| 197 | {
|
---|
| 198 | get
|
---|
| 199 | {
|
---|
| 200 | return altGraphKey;
|
---|
| 201 | }
|
---|
| 202 | }
|
---|
| 203 |
|
---|
| 204 | #endregion
|
---|
| 205 |
|
---|
| 206 | #region Public Methods
|
---|
| 207 |
|
---|
| 208 | public void InitMouseEvent(
|
---|
| 209 | string eventType,
|
---|
| 210 | bool bubbles,
|
---|
| 211 | bool cancelable,
|
---|
| 212 | IAbstractView view,
|
---|
| 213 | long detail,
|
---|
| 214 | long screenX,
|
---|
| 215 | long screenY,
|
---|
| 216 | long clientX,
|
---|
| 217 | long clientY,
|
---|
| 218 | bool ctrlKey,
|
---|
| 219 | bool altKey,
|
---|
| 220 | bool shiftKey,
|
---|
| 221 | bool metaKey,
|
---|
| 222 | ushort button,
|
---|
| 223 | IEventTarget relatedTarget)
|
---|
| 224 | {
|
---|
| 225 | InitUiEvent(eventType, bubbles, cancelable, view, detail);
|
---|
| 226 |
|
---|
| 227 | this.screenX = screenX;
|
---|
| 228 | this.screeny = screenY;
|
---|
| 229 | this.clientX = clientX;
|
---|
| 230 | this.clientY = clientY;
|
---|
| 231 | this.crtlKey = ctrlKey;
|
---|
| 232 | this.shiftKey = shiftKey;
|
---|
| 233 | this.altKey = altKey;
|
---|
| 234 | this.metaKey = metaKey;
|
---|
| 235 | this.button = button;
|
---|
| 236 | this.relatedTarget = relatedTarget;
|
---|
| 237 | //this.altGraphKey = altGraphKey;
|
---|
| 238 | }
|
---|
| 239 |
|
---|
| 240 | public void InitMouseEventNs(
|
---|
| 241 | string namespaceUri,
|
---|
| 242 | string eventType,
|
---|
| 243 | bool bubbles,
|
---|
| 244 | bool cancelable,
|
---|
| 245 | IAbstractView view,
|
---|
| 246 | long detail,
|
---|
| 247 | long screenX,
|
---|
| 248 | long screenY,
|
---|
| 249 | long clientX,
|
---|
| 250 | long clientY,
|
---|
| 251 | bool ctrlKey,
|
---|
| 252 | bool altKey,
|
---|
| 253 | bool shiftKey,
|
---|
| 254 | bool metaKey,
|
---|
| 255 | ushort button,
|
---|
| 256 | IEventTarget relatedTarget,
|
---|
| 257 | bool altGraphKey)
|
---|
| 258 | {
|
---|
| 259 | InitUiEventNs(namespaceUri, eventType, bubbles, cancelable, view, detail);
|
---|
| 260 |
|
---|
| 261 | this.screenX = screenX;
|
---|
| 262 | this.screeny = screenY;
|
---|
| 263 | this.clientX = clientX;
|
---|
| 264 | this.clientY = clientY;
|
---|
| 265 | this.crtlKey = ctrlKey;
|
---|
| 266 | this.shiftKey = shiftKey;
|
---|
| 267 | this.altKey = altKey;
|
---|
| 268 | this.metaKey = metaKey;
|
---|
| 269 | this.button = button;
|
---|
| 270 | this.relatedTarget = relatedTarget;
|
---|
| 271 | this.altGraphKey = altGraphKey;
|
---|
| 272 | }
|
---|
| 273 |
|
---|
| 274 | #endregion
|
---|
| 275 |
|
---|
| 276 | #endregion
|
---|
| 277 | }
|
---|
| 278 | }
|
---|