Try actually adding a mouse click handler, not overriding onBrowserEvent.
If you are writing your own widget, I believe there's a guide on the wiki
that explains event handling.

On Wed, Apr 15, 2009 at 6:11 PM, raulsan <[email protected]> wrote:

>
> Nope, it is not doing the same as before, I have tryed with:
>    /**
>    * Handling events
>    */
>    public void onBrowserEvent(Event event) {
>        super.onBrowserEvent(event);
>        if (mouseListeners != null) {
>            int x = event.getClientX() - this.getAbsoluteLeft();
>            int y = event.getClientY() - this.getAbsoluteTop();
>            switch (event.getTypeInt()) {
>                case Event.ONCLICK:
>                        if (clickListeners != null) {
>                                clickListeners.fireClick(this);
>                        }
>                        break;
>                case Event.ONMOUSEDOWN:
>                        if (mouseListeners != null) {
>                                mouseListeners.fireMouseDown(this, x, y);
>                                }
>                        break;
>                case Event.ONMOUSEMOVE:
>                        if (mouseListeners != null) {
>                                mouseListeners.fireMouseMove(this, x, y);
>                        }
>                        break;
>                case Event.ONMOUSEUP:
>                        if (mouseListeners != null) {
>                                mouseListeners.fireMouseUp(this, x, y);
>                        }
>                        break;
>                case Event.ONMOUSEOUT:
>                        if (mouseListeners != null) {
>                                mouseListeners.fireMouseLeave(this);
>                        }
>                 break;
>            }
>        }
>    }
>
> and the canvas is still receiving the events, but it does not get the
> correct coordinates.
> Any idea why?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to