Well the following worked fine for me, but i did a different implementation
though
@Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
if(DOM.eventGetType(event)==Event.ONMOUSEDOWN){
if (DOM.eventGetButton(event) == Event.BUTTON_RIGHT){
TreeHandler.onRightClick(this);
}else if (DOM.eventGetButton(event) == Event.BUTTON_LEFT){
TreeHandler.onLeftClick(this);
}
}else if(DOM.eventGetType(event)==Event.ONMOUSEOVER){
TreeHandler.onMouseOver(this);
}else if(DOM.eventGetType(event)==Event.ONMOUSEOUT){
TreeHandler.onMouseOut(this);
}
}
but then i am not taking advantage of the default listeners that i have over
this widget. i had to sink the mouse events and implement EventListener for
my Widget.
Hope that they will find a better solution in next GWT releases for Event
with Widgets and not Elements.
regards,
Rudolf Michael
2010/6/17 Jaroslav Záruba <[email protected]>
> Sorry if that is the case, my response was affected by the fact that I have
> ran into that 0-bug yesterday.
>
>
> On Thu, Jun 17, 2010 at 11:36 AM, Thomas Broyer <[email protected]>wrote:
>
>>
>>
>> On 17 juin, 10:06, ruds <[email protected]> wrote:
>> > Hello there,
>> > I have a focus panel where i added a MouseDownHandler to it. now in my
>> > MouseHandler i am doing the following:
>> > public void onMouseDown(MouseDownEvent arg0) {
>> > if(arg0.getNativeEvent().getKeyCode()==Event.BUTTON_LEFT){
>> >
>> > }else if(arg0.getNativeEvent().getKeyCode()==Event.BUTTON_RIGHT){
>> > }
>> >
>> > The strange thing is IE, the keyCode returned if i do debug it is
>> > always 0, it is working fine over FF and chrome and i need this in
>> > order to differentiate right from left clicks.
>> >
>> > is this a browser compatibility issue or a gwt bug?
>>
>> Or a bug in your code? You're comparing mouse button codes with
>> keyboard codes!
>> You should use arg0.getNativeButton(), or eventually
>> arg0.getNativeEvent().getButton().
>> Also note that more than one button can be depressed at the same time,
>> the value returned is a bit-field, so if you want to know if the left
>> button is depressed, you should use
>> arg0.getNativeButton&NativeEvent.BUTTON_LEFT!=0, you'd use
>> arg0.getNativeButton()==NativeEvent.BUTTON_LEFT only you want to check
>> that the left button, and only the left button, is depressed.
>>
>> --
>> 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]<google-web-toolkit%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>>
> --
> 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]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
--
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.