Platform: Using GWT1.5 (release) and linux

When I have a single instance of a popup panel, and it has it's
content & position set in response to rollover of multiple elements,
all works fine until I enable animation.

To run the test case just use
yourWidget.add(PopupFail.buildFailingTestCase()) to see the error.

Is there any way to get around this?

package com.google.gwt.user.client.ui;

import com.google.gwt.user.client.DOM;

public class PopupFail {

        public static Widget buildFailingTestCase() {
                VerticalPanel p = new VerticalPanel();
                p.setSpacing(5);
                p
                                .add(new Label(
                                                "Run your mouse quickly over 
the fail labels to see animation
causing fail."));
                PopupPanel pop = new PopupPanel(true, false);
                pop.setWidget(new Label("FAIL!"));
                pop.setAnimationEnabled(true);
                p.add(new Invoker("Fail 1", pop));
                p.add(new Invoker("Fail 2", pop));
                p.add(new Invoker("Fail 3", pop));
                p.add(new Invoker("Fail 4", pop));
                p
                                .add(new Label(
                                                "Run your mouse quickly over 
the pass labels to see no animation
causing win."));
                pop = new PopupPanel(true, false);
                pop.setWidget(new Label("WIN!"));
                pop.setAnimationEnabled(false);
                p.add(new Invoker("Pass 1", pop));
                p.add(new Invoker("Pass 2", pop));
                p.add(new Invoker("Pass 3", pop));
                p.add(new Invoker("Pass 4", pop));
                return p;
        }

        static class Invoker extends Label implements MouseListener {
                PopupPanel pop;

                public Invoker(final String text, final PopupPanel pop) {
                        super();
                        this.pop = pop;
                        addMouseListener(this);
                        setText(text);
                }

                private int getDisplayLocationX(final Widget sender, final int 
x) {
                        return sender.getAbsoluteLeft() + x + 
getPageScrollLeft();
                }

                private int getDisplayLocationY(final Widget sender, final int 
y) {
                        return sender.getAbsoluteTop() + y + getPageScrollTop();
                }

                private int getPageScrollTop() {
                        return DOM
                                        
.getAbsoluteTop(DOM.getParent(RootPanel.getBodyElement()));
                }

                private int getPageScrollLeft() {
                        return DOM.getAbsoluteLeft(DOM
                                        .getParent(RootPanel.getBodyElement()));
                }

                public void onMouseDown(final Widget sender, final int x, final 
int
y) {

                }

                public void onMouseEnter(final Widget sender) {

                        pop.show();
                }

                public void onMouseLeave(final Widget sender) {
                        pop.hide();
                }

                public void onMouseMove(final Widget sender, final int x, final 
int
y) {
                        pop.setPopupPosition(getDisplayLocationX(this, x),
                                        getDisplayLocationY(this, y));
                }

                public void onMouseUp(final Widget sender, final int x, final 
int y)
{

                }
        }

}

--~--~---------~--~----~------------~-------~--~----~
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