Ejemplo n.º 1
0
  private void moveIntoVisibleArea() {
    if (calendarDlg != null) {
      int w = Window.getClientWidth() + Window.getScrollLeft();
      int xd = calendarDlg.getAbsoluteLeft();
      int wd = calendarGrid.getOffsetWidth() + 40;
      if ((xd + wd) > w) {
        xd = xd - ((xd + wd) - w);
      }

      int h = Window.getClientHeight() + Window.getScrollTop();
      int yd = calendarDlg.getAbsoluteTop();
      int hd = calendarDlg.getOffsetHeight() + 20;
      if ((yd + hd) > h) {
        yd = yd - ((yd + hd) - h);
      }
      calendarDlg.setPopupPosition(xd, yd);
    }
  }