Re: PushButton hover not always removed on mouse out
can you please post your fix? On 28 יוני, 09:49, ChrisK cknow...@gmail.com wrote: I've had to make my own image button and replace all instances ofPushButtonwith it. It mimics thePushButtonbehaviour but doesn't have this issue on the exact same page so I'm pretty sure this is an issue withPushButton. On May 17, 9:28 pm, ChrisK cknow...@gmail.com wrote: I'm using GWT 2.0.3 and using UiBinder am adding a composite to the RootPanel. The composite contains some PushButtons which I am defining fully using UiBinder with g:upFace, g:upHoveringFace and g:downFace. The issue is that it's very easy to fool all of these buttons just by moving themousequickly across them - they stay in the hover state and even have the gwt-PushButton-up-hovering CSS class attached. If I replace a button with an Image and add my own code formouse over,mouseout andmouseup it works absolutely fine and I'm not able to fool the fake button. Obviously though I'd like to use the built in widgets as they provide at lot of added extras such as accessibility (amongst other things). Looking at the source code for CustomButton whichPushButtonextends, I can't understand line 623-631 (in current trunk but has been there for a while). I think there are more situations where setHovering should be set to false but I may be misunderstanding the isOrHasChild/ eventGetTarget methods. case Event.ONMOUSEOUT: Element to = DOM.eventGetToElement(event); if (DOM.isOrHasChild(getElement(), DOM.eventGetTarget(event)) (to == null || !DOM.isOrHasChild(getElement(), to))) { if (isCapturing) { onClickCancel(); } setHovering(false); } break; -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group athttp://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 google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: PushButton hover not always removed on mouse out
Yep, here you go. Not sure how this will come out in google groups. The below doesn't support everything PushButton supports but it was never suppose to. It was only supposed to fix the show stopper bug in our application which seems to be caused by GWT PushButtons using images to miss mouse out events. I'm sure you can expand it to your needs. /** * This is a replacement for the GWT PushButton which as of 2.0.3 seems to * miss a mouse out event sometimes meaning buttons stay highlighted * * @author chrisk */ public class ImageButton extends Composite implements HasClickHandlers, HasAllMouseHandlers { private Image image; private ImageResource currentResource; private ImageResource normalImage; private ImageResource mouseOverImage; private ImageResource mouseDownImage; @UiConstructor public ImageButton(final ImageResource normalImage, final ImageResource mouseOverImage, final ImageResource mouseDownImage) { this.normalImage = normalImage; this.mouseOverImage = mouseOverImage; this.mouseDownImage = mouseDownImage; this.currentResource = normalImage; image = new Image(normalImage); image.addStyleName(UiResources.INSTANCE.css().hasLink()); initWidget(image); image.addMouseOverHandler(new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { setCurrentImage(ImageButton.this.mouseOverImage); } }); image.addMouseOutHandler(new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { setCurrentImage(ImageButton.this.normalImage); } }); image.addMouseDownHandler(new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { setCurrentImage(ImageButton.this.mouseDownImage); } }); image.addMouseUpHandler(new MouseUpHandler() { public void onMouseUp(MouseUpEvent event) { setCurrentImage(ImageButton.this.mouseOverImage); } }); } public HandlerRegistration addClickHandler(ClickHandler handler) { return image.addClickHandler(handler); } private void setCurrentImage(ImageResource resource) { image.setResource(resource); currentResource = resource; } public void setNormalImage(final ImageResource normalImage) { if (currentResource == this.normalImage) { setCurrentImage(normalImage); } this.normalImage = normalImage; } public void setMouseOverImage(final ImageResource mouseOverImage) { if (currentResource == this.mouseOverImage) { setCurrentImage(mouseOverImage); } this.mouseOverImage = mouseOverImage; } public void setMouseDownImage(final ImageResource mouseDownImage) { if (currentResource == this.mouseDownImage) { setCurrentImage(mouseDownImage); } this.mouseDownImage = mouseDownImage; } public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) { return image.addMouseDownHandler(handler); } public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return image.addMouseUpHandler(handler); } public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) { return image.addMouseOutHandler(handler); } public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) { return image.addMouseOverHandler(handler); } public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) { return image.addMouseMoveHandler(handler); } public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) { return image.addMouseWheelHandler(handler); } } On Jul 5, 4:53 pm, ben fenster fenster@gmail.com wrote: can you please post your fix? On 28 יוני, 09:49, ChrisK cknow...@gmail.com wrote: I've had to make my own image button and replace all instances ofPushButtonwith it. It mimics thePushButtonbehaviour but doesn't have this issue on the exact same page so I'm pretty sure this is an issue withPushButton. On May 17, 9:28 pm, ChrisK cknow...@gmail.com wrote: I'm using GWT 2.0.3 and using UiBinder am adding a composite to the RootPanel. The composite contains some PushButtons which I am defining fully using UiBinder with g:upFace, g:upHoveringFace and g:downFace. The issue is that it's very easy to fool all of these buttons just by moving themousequickly across them - they stay in the hover state and even have the gwt-PushButton-up-hovering CSS class attached. If I replace a button with an Image and add my own code formouse over,mouseout andmouseup it works absolutely fine and I'm not able to fool the fake button. Obviously though I'd like to use the built in widgets as they
Re: PushButton hover not always removed on mouse out
I've had to make my own image button and replace all instances of PushButton with it. It mimics the PushButton behaviour but doesn't have this issue on the exact same page so I'm pretty sure this is an issue with PushButton. On May 17, 9:28 pm, ChrisK cknow...@gmail.com wrote: I'm using GWT 2.0.3 and using UiBinder am adding a composite to the RootPanel. The composite contains some PushButtons which I am defining fully using UiBinder with g:upFace, g:upHoveringFace and g:downFace. The issue is that it's very easy to fool all of these buttons just by moving themousequickly across them - they stay in the hover state and even have the gwt-PushButton-up-hovering CSS class attached. If I replace a button with an Image and add my own code formouse over,mouseout andmouseup it works absolutely fine and I'm not able to fool the fake button. Obviously though I'd like to use the built in widgets as they provide at lot of added extras such as accessibility (amongst other things). Looking at the source code for CustomButton whichPushButtonextends, I can't understand line 623-631 (in current trunk but has been there for a while). I think there are more situations where setHovering should be set to false but I may be misunderstanding the isOrHasChild/ eventGetTarget methods. case Event.ONMOUSEOUT: Element to = DOM.eventGetToElement(event); if (DOM.isOrHasChild(getElement(), DOM.eventGetTarget(event)) (to == null || !DOM.isOrHasChild(getElement(), to))) { if (isCapturing) { onClickCancel(); } setHovering(false); } break; -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group athttp://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 google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
PushButton hover not always removed on mouse out
I'm using GWT 2.0.3 and using UiBinder am adding a composite to the RootPanel. The composite contains some PushButtons which I am defining fully using UiBinder with g:upFace, g:upHoveringFace and g:downFace. The issue is that it's very easy to fool all of these buttons just by moving the mouse quickly across them - they stay in the hover state and even have the gwt-PushButton-up-hovering CSS class attached. If I replace a button with an Image and add my own code for mouse over, mouse out and mouse up it works absolutely fine and I'm not able to fool the fake button. Obviously though I'd like to use the built in widgets as they provide at lot of added extras such as accessibility (amongst other things). Looking at the source code for CustomButton which PushButton extends, I can't understand line 623-631 (in current trunk but has been there for a while). I think there are more situations where setHovering should be set to false but I may be misunderstanding the isOrHasChild/ eventGetTarget methods. case Event.ONMOUSEOUT: Element to = DOM.eventGetToElement(event); if (DOM.isOrHasChild(getElement(), DOM.eventGetTarget(event)) (to == null || !DOM.isOrHasChild(getElement(), to))) { if (isCapturing) { onClickCancel(); } setHovering(false); } break; -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.