resolving mouse cursor location

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

resolving mouse cursor location

Bugdog
Hi All,

My situation is like I have a qooxdoo window with some widgets on it. I
would like to ask this window (or application) for a mouse cursor
location. I don't care whether it will be absolute or relative position.

Thanks

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: resolving mouse cursor location

Alexander Back
Hi Dmitry,

do you need to know this mouse position at

a) a specific event like clicking on each of these widgets or
b) do you need the position at every move of the mouse?


-> a)
Add a "click" eventlistener at your widgets

--snip--
myWidget.addEventListener("click", myEventHandlerFunc, [myScope]);

myEventHandlerFunc : function(e)
{
    // e is an MouseEvent object
    // look at [0] for details
    var x = e.getClientX();
}
--snip--


-> b)
You can add a "mousemove" eventlistener to the ClientDocument instance

--snip--
// in your event handler method you will also have access to a
"mouseEvent" instance
qx.ui.core.ClientDocument.getInstance().addEventListener("mousemove",
myEventHandlerFunc, [myScope]);
--snip--

cheers,
   Alex

[0] http://demo.qooxdoo.org/current/apiviewer/#qx.event.type.MouseEvent

Dmitry Pryadkin wrote:
> Hi All,
>
> My situation is like I have a qooxdoo window with some widgets on it. I
> would like to ask this window (or application) for a mouse cursor
> location. I don't care whether it will be absolute or relative position.
>
> Thanks

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: resolving mouse cursor location

Bugdog
Thanks, Alexander

"b" was just for me

Alexander Back wrote:
> a) a specific event like clicking on each of these widgets or
> b) do you need the position at every move of the mouse?
>  


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel