Hi Eric,

The values that you put into the args array of fireEvent, will be used 
to call the event's init() method.
So you should put the arguments to qx.event.type.Mouse.init() in it.

I can't test this right now, but I think the following should work:

   this.fireEvent("doubleclick", qx.event.type.Mouse, 
[event.getNativeEvent()]);

With that, you would create a new event based on the same native event 
object.


Note that it would be even nicer if you could re-dispatch the same event 
object instance. But I'm not sure if that's possible, due to the pooling 
of event objects. That's something the qooxdoo team should be able to 
answer. :)

Hope this helps.

Regards,
Marc



On 10/04/2011 04:42 PM, Eric wrote:
> I've added a double click event to svg elements.  It works, but I 
> don't understand how to set up event data.  All I really want to do is 
> pass along the event parameter from the click event that triggers the 
> double click.  The ["div", "Mouse"] array in the fireEvent invocation 
> is there only because that's what worked without errors.
>
> What would a correction version of the fireEvent call look like?
>
>
> qx.Mixin.define("myapp.view.svg.MDblClick",
>     {
>
>         construct: function() {
>
>             this.addListener("mousedown", this.__onMDblClick, this);
>             this.addListener("doubleclick", this.__onMDblClickDbl, this);
>         },
>
>
>         events :
>         {
>             /**  Fired when the widget is clicked. */
>             "doubleclick": "qx.event.type.Mouse"
>         },
>
>
>         statics:{
>
>
>             timeExpired: {
>                 init: true
>             },
>
>
>             expired: function() {
>                 myapp.view.svg.MDblClick.timeExpired = true;
>                 clearTimeout(myapp.view.svg.MDblClick.timer);
>             },
>
>
>             timer: null
>         },
>
>
>         members:
>         {
>             __lastClickPosition: null,
>
>
>             __moe: .015,
>
>
>             __isWithinMOE: function(point) {
>                 var withinX = (this.__lastClickPosition.getX() > (1 - 
> this.__moe) * point.getX() &&
>                     this.__lastClickPosition.getX() < (1 + this.__moe) 
> * point.getX());
>                 var withinY = (this.__lastClickPosition.getY() > (1 - 
> this.__moe) * point.getY() &&
>                     this.__lastClickPosition.getY() < (1 + this.__moe) 
> * point.getY());
>     return withinX && withinY;
>             },
>
>
>             __onMDblClickDbl: function(event) {
>                 this.debug('double click');
>             },
>
>
>             __onMDblClick: function(event) {
>                 if (myapp.view.svg.MDblClick.timeExpired) {
>                     this.__lastClickPosition = new 
> myapp.view.Point(event.getDocumentLeft(), event.getDocumentTop());
>                     myapp.view.svg.MDblClick.timeExpired = false;
>                     myapp.view.svg.MDblClick.timer = 
> setTimeout("myapp.view.svg.MDblClick.expired()", 200);
>                 }
>                 else {
>                     if (this.__isWithinMOE(new 
> myapp.view.Point(event.getDocumentLeft(), event.getDocumentTop())))
>                         this.fireEvent("doubleclick", 
> qx.event.type.Mouse, ["div", "Mouse"]);
>                 }
>             }
>         }
>     });

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to