List of usage examples for com.google.gwt.user.client WindowScrollListener WindowScrollListener
WindowScrollListener
From source file:com.google.appinventor.client.RpcStatusPopup.java
License:Open Source License
/** * Initializes the LoadingPopup.//from w ww.j a v a 2 s .c o m */ public RpcStatusPopup() { super(/* autoHide = */ false); setStyleName("ode-RpcStatusMessage"); setWidget(label); // Re-center the loading message when the window is resized. // TODO(halabelson): Replace the deprecated methods Window.addWindowResizeListener(new WindowResizeListener() { @Override public void onWindowResized(int width, int height) { positionPopup(getOffsetWidth()); } }); // Reposition the message to the top of the screen when the // window is scrolled // TODO(halabelson): get rid of the flashing on vertical scrolling Window.addWindowScrollListener(new WindowScrollListener() { @Override public void onWindowScrolled(int scrollLeft, int scrollTop) { positionPopup(getOffsetWidth()); } }); // Position the popup before showing it to prevent flashing. setPopupPositionAndShow(new PopupPanel.PositionCallback() { @Override public void setPosition(int offsetWidth, int offsetHeight) { positionPopup(offsetWidth); } }); }