summaryrefslogtreecommitdiff
path: root/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type
diff options
context:
space:
mode:
Diffstat (limited to 'webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type')
-rw-r--r--webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DataEvent.js48
-rw-r--r--webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DomEvent.js227
-rw-r--r--webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DragEvent.js155
-rw-r--r--webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/Event.js88
-rw-r--r--webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/FocusEvent.js46
-rw-r--r--webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/KeyEvent.js152
-rw-r--r--webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/MouseEvent.js309
7 files changed, 1025 insertions, 0 deletions
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DataEvent.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DataEvent.js
new file mode 100644
index 0000000000..a8b0a84d08
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DataEvent.js
@@ -0,0 +1,48 @@
+/* ************************************************************************
+
+ qooxdoo - the new era of web development
+
+ http://qooxdoo.org
+
+ Copyright:
+ 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org
+
+ License:
+ LGPL 2.1: http://www.gnu.org/licenses/lgpl.html
+
+ Authors:
+ * Sebastian Werner (wpbasti)
+ * Andreas Ecker (ecker)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#module(core)
+
+************************************************************************ */
+
+/*!
+ Event object for property changes.
+*/
+qx.OO.defineClass("qx.event.type.DataEvent", qx.event.type.Event,
+function(vType, vData)
+{
+ qx.event.type.Event.call(this, vType);
+
+ this.setData(vData);
+});
+
+qx.OO.addFastProperty({ name : "propagationStopped", defaultValue : false });
+qx.OO.addFastProperty({ name : "data" });
+
+qx.Proto.dispose = function()
+{
+ if(this.getDisposed()) {
+ return;
+ }
+
+ this._valueData = null;
+
+ return qx.event.type.Event.prototype.dispose.call(this);
+}
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DomEvent.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DomEvent.js
new file mode 100644
index 0000000000..5e62b5333e
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DomEvent.js
@@ -0,0 +1,227 @@
+/* ************************************************************************
+
+ qooxdoo - the new era of web development
+
+ http://qooxdoo.org
+
+ Copyright:
+ 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org
+
+ License:
+ LGPL 2.1: http://www.gnu.org/licenses/lgpl.html
+
+ Authors:
+ * Sebastian Werner (wpbasti)
+ * Andreas Ecker (ecker)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#module(ui_core)
+
+************************************************************************ */
+
+qx.OO.defineClass("qx.event.type.DomEvent", qx.event.type.Event,
+function(vType, vDomEvent, vDomTarget, vTarget, vOriginalTarget)
+{
+ qx.event.type.Event.call(this, vType);
+
+ this.setDomEvent(vDomEvent);
+ this.setDomTarget(vDomTarget);
+
+ this.setTarget(vTarget);
+ this.setOriginalTarget(vOriginalTarget);
+});
+
+qx.OO.addFastProperty({ name : "bubbles", defaultValue : true, noCompute : true });
+qx.OO.addFastProperty({ name : "propagationStopped", defaultValue : false, noCompute : true });
+
+qx.OO.addFastProperty({ name : "domEvent", setOnlyOnce : true, noCompute : true });
+qx.OO.addFastProperty({ name : "domTarget", setOnlyOnce : true, noCompute : true });
+
+/**
+ * The modifiers. A mask of the pressed modifier keys. This is an OR-combination of
+ * {@link #SHIFT_MASK}, {@link #CTRL_MASK}, {@link #ALT_MASK} and {@link #META_MASK}.
+ */
+qx.OO.addCachedProperty({ name : "modifiers", defaultValue : null });
+
+
+// property computer
+qx.Proto._computeModifiers = function() {
+ var mask = 0;
+ var evt = this.getDomEvent();
+ if (evt.shiftKey) mask |= qx.event.type.DomEvent.SHIFT_MASK;
+ if (evt.ctrlKey) mask |= qx.event.type.DomEvent.CTRL_MASK;
+ if (evt.altKey) mask |= qx.event.type.DomEvent.ALT_MASK;
+ if (evt.metaKey) mask |= qx.event.type.DomEvent.META_MASK;
+ return mask;
+}
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ SPECIAL KEY SUPPORT
+---------------------------------------------------------------------------
+*/
+
+/**
+ * Returns whether the the ctrl key is pressed.
+ *
+ * @return {boolean} whether the the ctrl key is pressed.
+ */
+qx.Proto.isCtrlPressed = function() {
+ return this.getDomEvent().ctrlKey;
+}
+
+/**
+ * Returns whether the the ctrl key is pressed.
+ *
+ * @return {boolean} whether the the ctrl key is pressed.
+ * @deprecated Use {@link #isCtrlPressed} instead.
+ */
+qx.Proto.getCtrlKey = qx.Proto.isCtrlPressed;
+
+
+/**
+ * Returns whether the the shift key is pressed.
+ *
+ * @return {boolean} whether the the shift key is pressed.
+ */
+qx.Proto.isShiftPressed = function() {
+ return this.getDomEvent().shiftKey;
+}
+
+/**
+ * Returns whether the the shift key is pressed.
+ *
+ * @return {boolean} whether the the shift key is pressed.
+ * @deprecated Use {@link #isShiftPressed} instead.
+ */
+qx.Proto.getShiftKey = qx.Proto.isShiftPressed;
+
+
+/**
+ * Returns whether the the alt key is pressed.
+ *
+ * @return {boolean} whether the the alt key is pressed.
+ */
+qx.Proto.isAltPressed = function() {
+ return this.getDomEvent().altKey;
+}
+
+/**
+ * Returns whether the the alt key is pressed.
+ *
+ * @return {boolean} whether the the alt key is pressed.
+ * @deprecated Use {@link #isAltPressed} instead.
+ */
+qx.Proto.getAltKey = qx.Proto.isAltPressed;
+
+
+/**
+ * Returns whether the the meta key is pressed.
+ *
+ * @return {boolean} whether the the meta key is pressed.
+ */
+qx.Proto.isMetaPressed = function() {
+ return this.getDomEvent().metaKey;
+}
+
+
+/**
+ * Returns whether the ctrl key or (on the Mac) the command key is pressed.
+ *
+ * @return {boolean} <code>true</code> if the command key is pressed on the Mac
+ * or the ctrl key is pressed on another system.
+ */
+qx.Proto.isCtrlOrCommandPressed = function() {
+ if (qx.sys.Client.getInstance().runsOnMacintosh()) {
+ return this.getDomEvent().metaKey;
+ } else {
+ return this.getDomEvent().ctrlKey;
+ }
+}
+
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ PREVENT DEFAULT
+---------------------------------------------------------------------------
+*/
+
+if(qx.sys.Client.getInstance().isMshtml())
+{
+ qx.Proto.setDefaultPrevented = function(vValue)
+ {
+ if (!vValue) {
+ return this.error("It is not possible to set preventDefault to false if it was true before!", "setDefaultPrevented");
+ }
+
+ this.getDomEvent().returnValue = false;
+
+ qx.event.type.Event.prototype.setDefaultPrevented.call(this, vValue);
+ }
+}
+else
+{
+ qx.Proto.setDefaultPrevented = function(vValue)
+ {
+ if (!vValue) {
+ return this.error("It is not possible to set preventDefault to false if it was true before!", "setDefaultPrevented");
+ }
+
+ this.getDomEvent().preventDefault();
+ this.getDomEvent().returnValue = false;
+
+ qx.event.type.Event.prototype.setDefaultPrevented.call(this, vValue);
+ }
+}
+
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ DISPOSER
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.dispose = function()
+{
+ if (this.getDisposed()) {
+ return;
+ }
+
+ this._valueDomEvent = null;
+ this._valueDomTarget = null;
+
+ return qx.event.type.Event.prototype.dispose.call(this);
+}
+
+
+
+
+/** {int} The modifier mask for the shift key. */
+qx.Class.SHIFT_MASK = 1;
+
+/** {int} The modifier mask for the control key. */
+qx.Class.CTRL_MASK = 2;
+
+/** {int} The modifier mask for the alt key. */
+qx.Class.ALT_MASK = 4;
+
+/** {int} The modifier mask for the meta key (e.g. apple key on Macs). */
+qx.Class.META_MASK = 8;
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DragEvent.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DragEvent.js
new file mode 100644
index 0000000000..96c1db951b
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/DragEvent.js
@@ -0,0 +1,155 @@
+/* ************************************************************************
+
+ qooxdoo - the new era of web development
+
+ http://qooxdoo.org
+
+ Copyright:
+ 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org
+
+ License:
+ LGPL 2.1: http://www.gnu.org/licenses/lgpl.html
+
+ Authors:
+ * Sebastian Werner (wpbasti)
+ * Andreas Ecker (ecker)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#module(ui_dragdrop)
+
+************************************************************************ */
+
+/*!
+ The event object for drag and drop sessions
+*/
+qx.OO.defineClass("qx.event.type.DragEvent", qx.event.type.MouseEvent,
+function(vType, vMouseEvent, vTarget, vRelatedTarget)
+{
+ this._mouseEvent = vMouseEvent;
+
+ var vOriginalTarget = null;
+
+ switch(vType)
+ {
+ case "dragstart":
+ case "dragover":
+ vOriginalTarget = vMouseEvent.getOriginalTarget();
+ }
+
+ qx.event.type.MouseEvent.call(this, vType, vMouseEvent.getDomEvent(), vTarget.getElement(), vTarget, vOriginalTarget, vRelatedTarget);
+});
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ UTILITIY
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.getMouseEvent = function() {
+ return this._mouseEvent;
+}
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ APPLICATION CONNECTION
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.startDrag = function()
+{
+ if (this.getType() != "dragstart") {
+ throw new Error("qx.event.type.DragEvent startDrag can only be called during the dragstart event: " + this.getType());
+ }
+
+ this.stopPropagation();
+ qx.event.handler.DragAndDropHandler.getInstance().startDrag();
+}
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ DATA SUPPORT
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.addData = function(sType, oData) {
+ qx.event.handler.DragAndDropHandler.getInstance().addData(sType, oData);
+}
+
+qx.Proto.getData = function(sType) {
+ return qx.event.handler.DragAndDropHandler.getInstance().getData(sType);
+}
+
+qx.Proto.clearData = function() {
+ qx.event.handler.DragAndDropHandler.getInstance().clearData();
+}
+
+qx.Proto.getDropDataTypes = function() {
+ return qx.event.handler.DragAndDropHandler.getInstance().getDropDataTypes();
+}
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ ACTION SUPPORT
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.addAction = function(sAction) {
+ qx.event.handler.DragAndDropHandler.getInstance().addAction(sAction);
+}
+
+qx.Proto.removeAction = function(sAction) {
+ qx.event.handler.DragAndDropHandler.getInstance().removeAction(sAction);
+}
+
+qx.Proto.getAction = function() {
+ return qx.event.handler.DragAndDropHandler.getInstance().getCurrentAction();
+}
+
+qx.Proto.clearActions = function() {
+ qx.event.handler.DragAndDropHandler.getInstance().clearActions();
+}
+
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ DISPOSER
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.dispose = function()
+{
+ if (this.getDisposed()) {
+ return;
+ }
+
+ this._mouseEvent = null;
+
+ return qx.event.type.MouseEvent.prototype.dispose.call(this);
+}
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/Event.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/Event.js
new file mode 100644
index 0000000000..8d52339b40
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/Event.js
@@ -0,0 +1,88 @@
+/* ************************************************************************
+
+ qooxdoo - the new era of web development
+
+ http://qooxdoo.org
+
+ Copyright:
+ 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org
+
+ License:
+ LGPL 2.1: http://www.gnu.org/licenses/lgpl.html
+
+ Authors:
+ * Sebastian Werner (wpbasti)
+ * Andreas Ecker (ecker)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#module(core)
+
+************************************************************************ */
+
+/*!
+ The qooxdoo core event object. Each event object for qx.core.Targets should extend this class.
+*/
+qx.OO.defineClass("qx.event.type.Event", qx.core.Object,
+function(vType)
+{
+ qx.core.Object.call(this, false);
+
+ this.setType(vType);
+});
+
+qx.OO.addFastProperty({ name : "type", setOnlyOnce : true });
+
+qx.OO.addFastProperty({ name : "originalTarget", setOnlyOnce : true });
+qx.OO.addFastProperty({ name : "target", setOnlyOnce : true });
+qx.OO.addFastProperty({ name : "relatedTarget", setOnlyOnce : true });
+qx.OO.addFastProperty({ name : "currentTarget" });
+
+qx.OO.addFastProperty({ name : "bubbles", defaultValue : false, noCompute : true });
+qx.OO.addFastProperty({ name : "propagationStopped", defaultValue : true, noCompute : true });
+qx.OO.addFastProperty({ name : "defaultPrevented", defaultValue : false, noCompute : true });
+
+/** If the event object should automatically be disposed by the dispatcher */
+qx.OO.addFastProperty({ name : "autoDispose", defaultValue : false });
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ SHORTCUTS
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.preventDefault = function() {
+ this.setDefaultPrevented(true);
+}
+
+qx.Proto.stopPropagation = function() {
+ this.setPropagationStopped(true);
+}
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ DISPOSER
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.dispose = function()
+{
+ if(this.getDisposed()) {
+ return;
+ }
+
+ this._valueOriginalTarget = null;
+ this._valueTarget = null;
+ this._valueRelatedTarget = null;
+ this._valueCurrentTarget = null;
+
+ return qx.core.Object.prototype.dispose.call(this);
+}
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/FocusEvent.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/FocusEvent.js
new file mode 100644
index 0000000000..835ab05f7f
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/FocusEvent.js
@@ -0,0 +1,46 @@
+/* ************************************************************************
+
+ qooxdoo - the new era of web development
+
+ http://qooxdoo.org
+
+ Copyright:
+ 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org
+
+ License:
+ LGPL 2.1: http://www.gnu.org/licenses/lgpl.html
+
+ Authors:
+ * Sebastian Werner (wpbasti)
+ * Andreas Ecker (ecker)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#module(ui_core)
+
+************************************************************************ */
+
+/*!
+ This event handles all focus events.
+
+ The four supported types are:
+ 1+2: focus and blur also propagate the target object
+ 3+4: focusout and focusin are bubbling to the parent objects
+*/
+qx.OO.defineClass("qx.event.type.FocusEvent", qx.event.type.Event,
+function(vType, vTarget)
+{
+ qx.event.type.Event.call(this, vType);
+
+ this.setTarget(vTarget);
+
+ switch(vType)
+ {
+ case "focusin":
+ case "focusout":
+ this.setBubbles(true);
+ this.setPropagationStopped(false);
+ }
+});
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/KeyEvent.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/KeyEvent.js
new file mode 100644
index 0000000000..32552a1172
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/KeyEvent.js
@@ -0,0 +1,152 @@
+/* ************************************************************************
+
+ qooxdoo - the new era of web development
+
+ http://qooxdoo.org
+
+ Copyright:
+ 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org
+
+ License:
+ LGPL 2.1: http://www.gnu.org/licenses/lgpl.html
+
+ Authors:
+ * Sebastian Werner (wpbasti)
+ * Andreas Ecker (ecker)
+ * Fabian Jakobs (fjakobs)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#module(ui_core)
+
+************************************************************************ */
+
+/**
+ * A key event instance contains all data for each occured key event
+ *
+ * @param vType (string) event type (keydown, keypress, keyinput, keyup)
+ * @param vDomEvent (Element) DOM event object
+ * @param vDomTarget (Element) target element of the DOM event
+ * @param vTarget
+ * @param vOriginalTarget
+ * @param vKeyCode (int)
+ * @param vCharCode (int)
+ * @param vKeyIdentifier (string)
+ */
+qx.OO.defineClass("qx.event.type.KeyEvent", qx.event.type.DomEvent,
+function(vType, vDomEvent, vDomTarget, vTarget, vOriginalTarget, vKeyCode, vCharCode, vKeyIdentifier)
+{
+ qx.event.type.DomEvent.call(this, vType, vDomEvent, vDomTarget, vTarget, vOriginalTarget);
+
+ this.setKeyCode(vKeyCode);
+ this.setCharCode(vCharCode);
+ this.setKeyIdentifier(vKeyIdentifier);
+});
+
+/**
+ * Legacy keycode
+ * @deprecated Will be removed with qooxdoo 0.7
+ */
+qx.OO.addFastProperty({ name : "keyCode", setOnlyOnce : true, noCompute : true });
+
+/**
+ * Unicode number of the pressed character.
+ * Only valid in "keyinput" events
+ */
+qx.OO.addFastProperty({ name : "charCode", setOnlyOnce : true, noCompute : true });
+
+/**
+ * Identifier of the pressed key.
+ * Not Valid in "keyinput" events"
+ */
+qx.OO.addFastProperty({ name : "keyIdentifier", setOnlyOnce : true, noCompute : true });
+
+
+
+
+
+
+
+
+/* ************************************************************************
+ Class data, properties and methods
+************************************************************************ */
+
+/*
+---------------------------------------------------------------------------
+ CLASS PROPERTIES AND METHODS
+---------------------------------------------------------------------------
+*/
+
+/**
+ * Mapping of the old key identifiers to the key codes
+ * @deprecated
+ */
+qx.event.type.KeyEvent.keys =
+{
+ esc : 27,
+ enter : 13,
+ tab : 9,
+ space : 32,
+
+ up : 38,
+ down : 40,
+ left : 37,
+ right : 39,
+
+ shift : 16,
+ ctrl : 17,
+ alt : 18,
+
+ f1 : 112,
+ f2 : 113,
+ f3 : 114,
+ f4 : 115,
+ f5 : 116,
+ f6 : 117,
+ f7 : 118,
+ f8 : 119,
+ f9 : 120,
+ f10 : 121,
+ f11 : 122,
+ f12 : 123,
+
+ print : 124,
+
+ del : 46,
+ backspace : 8,
+ insert : 45,
+ home : 36,
+ end : 35,
+
+ pageup : 33,
+ pagedown : 34,
+
+ numlock : 144,
+
+ numpad_0 : 96,
+ numpad_1 : 97,
+ numpad_2 : 98,
+ numpad_3 : 99,
+ numpad_4 : 100,
+ numpad_5 : 101,
+ numpad_6 : 102,
+ numpad_7 : 103,
+ numpad_8 : 104,
+ numpad_9 : 105,
+
+ numpad_divide : 111,
+ numpad_multiply : 106,
+ numpad_minus : 109,
+ numpad_plus : 107
+};
+
+// create dynamic codes copy
+(function() {
+ qx.event.type.KeyEvent.codes = {};
+ for (var i in qx.event.type.KeyEvent.keys) {
+ qx.event.type.KeyEvent.codes[qx.event.type.KeyEvent.keys[i]] = i;
+ }
+})();
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/MouseEvent.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/MouseEvent.js
new file mode 100644
index 0000000000..55e32e98f8
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/event/type/MouseEvent.js
@@ -0,0 +1,309 @@
+/* ************************************************************************
+
+ qooxdoo - the new era of web development
+
+ http://qooxdoo.org
+
+ Copyright:
+ 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org
+
+ License:
+ LGPL 2.1: http://www.gnu.org/licenses/lgpl.html
+
+ Authors:
+ * Sebastian Werner (wpbasti)
+ * Andreas Ecker (ecker)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#module(ui_core)
+
+************************************************************************ */
+
+/*!
+ A mouse event instance contains all data for each occured mouse event
+*/
+qx.OO.defineClass("qx.event.type.MouseEvent", qx.event.type.DomEvent,
+function(vType, vDomEvent, vDomTarget, vTarget, vOriginalTarget, vRelatedTarget)
+{
+ qx.event.type.DomEvent.call(this, vType, vDomEvent, vDomTarget, vTarget, vOriginalTarget);
+
+ if (vRelatedTarget) {
+ this.setRelatedTarget(vRelatedTarget);
+ }
+});
+
+qx.Class.C_BUTTON_LEFT = "left";
+qx.Class.C_BUTTON_MIDDLE = "middle";
+qx.Class.C_BUTTON_RIGHT = "right";
+qx.Class.C_BUTTON_NONE = "none";
+
+
+
+/* ************************************************************************
+ Class data, properties and methods
+************************************************************************ */
+
+/*
+---------------------------------------------------------------------------
+ CLASS PROPERTIES AND METHODS
+---------------------------------------------------------------------------
+*/
+
+qx.event.type.MouseEvent._screenX = qx.event.type.MouseEvent._screenY = qx.event.type.MouseEvent._clientX = qx.event.type.MouseEvent._clientY = qx.event.type.MouseEvent._pageX = qx.event.type.MouseEvent._pageY = 0;
+qx.event.type.MouseEvent._button = null;
+
+qx.event.type.MouseEvent._storeEventState = function(e)
+{
+ qx.event.type.MouseEvent._screenX = e.getScreenX();
+ qx.event.type.MouseEvent._screenY = e.getScreenY();
+ qx.event.type.MouseEvent._clientX = e.getClientX();
+ qx.event.type.MouseEvent._clientY = e.getClientY();
+ qx.event.type.MouseEvent._pageX = e.getPageX();
+ qx.event.type.MouseEvent._pageY = e.getPageY();
+ qx.event.type.MouseEvent._button = e.getButton();
+}
+
+qx.event.type.MouseEvent.getScreenX = function() { return qx.event.type.MouseEvent._screenX; }
+qx.event.type.MouseEvent.getScreenY = function() { return qx.event.type.MouseEvent._screenY; }
+qx.event.type.MouseEvent.getClientX = function() { return qx.event.type.MouseEvent._clientX; }
+qx.event.type.MouseEvent.getClientY = function() { return qx.event.type.MouseEvent._clientY; }
+qx.event.type.MouseEvent.getPageX = function() { return qx.event.type.MouseEvent._pageX; }
+qx.event.type.MouseEvent.getPageY = function() { return qx.event.type.MouseEvent._pageY; }
+qx.event.type.MouseEvent.getButton = function() { return qx.event.type.MouseEvent._button; }
+
+if (qx.sys.Client.getInstance().isMshtml())
+{
+ qx.event.type.MouseEvent.buttons = { left : 1, right : 2, middle : 4 }
+}
+else
+{
+ qx.event.type.MouseEvent.buttons = { left : 0, right : 2, middle : 1 }
+}
+
+
+
+
+
+
+/* ************************************************************************
+ Instance data, properties and methods
+************************************************************************ */
+
+/*
+---------------------------------------------------------------------------
+ SCREEN COORDINATES SUPPORT
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.getScreenX = function() {
+ return this.getDomEvent().screenX;
+}
+
+qx.Proto.getScreenY = function() {
+ return this.getDomEvent().screenY;
+}
+
+
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ PAGE COORDINATES SUPPORT
+---------------------------------------------------------------------------
+*/
+
+if (qx.sys.Client.getInstance().isMshtml())
+{
+qx.OO.addFastProperty({ name : "pageX", readOnly : true });
+qx.OO.addFastProperty({ name : "pageY", readOnly : true });
+
+ if (qx.sys.Client.getInstance().isInQuirksMode())
+ {
+ qx.Proto._computePageX = function() {
+ return this.getDomEvent().clientX + document.documentElement.scrollLeft;
+ }
+
+ qx.Proto._computePageY = function() {
+ return this.getDomEvent().clientY + document.documentElement.scrollTop;
+ }
+ }
+ else
+ {
+ qx.Proto._computePageX = function() {
+ return this.getDomEvent().clientX + document.body.scrollLeft;
+ }
+
+ qx.Proto._computePageY = function() {
+ return this.getDomEvent().clientY + document.body.scrollTop;
+ }
+ }
+}
+else if (qx.sys.Client.getInstance().isGecko())
+{
+ qx.Proto.getPageX = function() {
+ return this.getDomEvent().pageX;
+ }
+
+ qx.Proto.getPageY = function() {
+ return this.getDomEvent().pageY;
+ }
+}
+else
+{
+ qx.Proto.getPageX = function() {
+ return this.getDomEvent().clientX;
+ }
+
+ qx.Proto.getPageY = function() {
+ return this.getDomEvent().clientY;
+ }
+}
+
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ CLIENT COORDINATES SUPPORT
+---------------------------------------------------------------------------
+*/
+
+if (qx.sys.Client.getInstance().isMshtml() || qx.sys.Client.getInstance().isGecko())
+{
+ qx.Proto.getClientX = function() {
+ return this.getDomEvent().clientX;
+ }
+
+ qx.Proto.getClientY = function() {
+ return this.getDomEvent().clientY;
+ }
+}
+else
+{
+qx.OO.addFastProperty({ name : "clientX", readOnly : true });
+qx.OO.addFastProperty({ name : "clientY", readOnly : true });
+
+ qx.Proto._computeClientX = function() {
+ return this.getDomEvent().clientX + (document.body && document.body.scrollLeft != null ? document.body.scrollLeft : 0);
+ }
+
+ qx.Proto._computeClientY = function() {
+ return this.getDomEvent().clientY + (document.body && document.body.scrollTop != null ? document.body.scrollTop : 0);
+ }
+}
+
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ BUTTON SUPPORT
+---------------------------------------------------------------------------
+*/
+
+qx.OO.addFastProperty({ name : "button", readOnly : true });
+
+// IE does not set e.button in click events
+if (qx.sys.Client.getInstance().isMshtml())
+{
+ qx.Proto.isLeftButtonPressed = function() {
+ if (this.getType() == "click") {
+ return true;
+ } else {
+ return this.getButton() === qx.event.type.MouseEvent.C_BUTTON_LEFT;
+ }
+ }
+}
+else
+{
+ qx.Proto.isLeftButtonPressed = function() {
+ return this.getButton() === qx.event.type.MouseEvent.C_BUTTON_LEFT;
+ }
+}
+
+qx.Proto.isMiddleButtonPressed = function() {
+ return this.getButton() === qx.event.type.MouseEvent.C_BUTTON_MIDDLE;
+}
+
+qx.Proto.isRightButtonPressed = function() {
+ return this.getButton() === qx.event.type.MouseEvent.C_BUTTON_RIGHT;
+}
+
+qx.Proto._computeButton = function() {
+ var e = this.getDomEvent();
+ if (e.which) {
+ switch (e.which) {
+ case 1:
+ return qx.event.type.MouseEvent.C_BUTTON_LEFT;
+
+ case 3:
+ return qx.event.type.MouseEvent.C_BUTTON_RIGHT;
+
+ case 2:
+ return qx.event.type.MouseEvent.C_BUTTON_MIDDLE;
+
+ default:
+ return qx.event.type.MouseEvent.C_BUTTON_NONE;
+
+ }
+ } else {
+ switch(e.button) {
+ case 1:
+ return qx.event.type.MouseEvent.C_BUTTON_LEFT;
+
+ case 2:
+ return qx.event.type.MouseEvent.C_BUTTON_RIGHT;
+
+ case 4:
+ return qx.event.type.MouseEvent.C_BUTTON_MIDDLE;
+
+ default:
+ return qx.event.type.MouseEvent.C_BUTTON_NONE;
+ }
+ }
+}
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ WHEEL SUPPORT
+---------------------------------------------------------------------------
+*/
+
+// Implementation differences: http://ajaxian.com/archives/javascript-and-mouse-wheels
+
+qx.OO.addFastProperty({ name : "wheelDelta", readOnly : true });
+
+if(qx.sys.Client.getInstance().isMshtml())
+{
+ qx.Proto._computeWheelDelta = function() {
+ return this.getDomEvent().wheelDelta / 120;
+ }
+}
+else if(qx.sys.Client.getInstance().isOpera())
+{
+ qx.Proto._computeWheelDelta = function() {
+ return -this.getDomEvent().wheelDelta / 120;
+ }
+}
+else
+{
+ qx.Proto._computeWheelDelta = function() {
+ return -this.getDomEvent().detail / 3;
+ }
+}