Exemplo n.º 1
0
  protected void paint(GraphicsEx g) {
    beforePaint();
    int bottom = getHeight();
    boolean onlySoftBar = (bottom <= g.getClipY());
    if (!onlySoftBar) {
      int captionHeight = bar.getHeight();
      paintContent(g, captionHeight, getWidth(), getHeight() - captionHeight);

      g.setClip(0, captionHeight, getWidth(), getHeight());
      g.drawPopup(this, captionHeight);

      bar.paint(g, this, getWidth());
    }
    if (isSoftBarShown()) {
      softBar.paint(g, this, getHeight());
    }
  }
Exemplo n.º 2
0
 protected final int[] getScroll() {
   // scroll bar
   int[] scroll =
       MyScrollBar.makeVertScroll(
           (getWidth() - scrollerWidth),
           bar.getHeight(),
           scrollerWidth,
           getContentHeight() + 1,
           getContentHeight(),
           getFullSize());
   if (null != scroll) {
     scroll[MyScrollBar.SCROLL_TOP_VALUE] = getTopOffset();
   }
   return scroll;
 }
Exemplo n.º 3
0
 protected final void stylusPressed(TouchState state) {
   if (getHeight() < state.y) {
     state.region = softBar;
     return;
   }
   if (state.y < bar.getHeight()) {
     state.region = bar;
     return;
   }
   touchUsed = true;
   int item = getItemByCoord(state.y);
   if (0 <= item) {
     currItem = -1;
     state.prevTopY = getTopOffset();
     touchItemPressed(item, state.x, state.y);
     state.isSecondTap = true;
   }
 }
Exemplo n.º 4
0
  protected final int getItemByCoord(int y) {
    int size = getSize();
    // is pointing on data area
    int itemY1 = bar.getHeight() - get_TopOffset();
    if (y < itemY1) {
      for (int i = get_Top(); 0 <= i; --i) {
        if (itemY1 <= y) {
          return i;
        }
        itemY1 -= getItemHeight(i);
      }

    } else {
      for (int i = get_Top(); i < size; ++i) {
        itemY1 += getItemHeight(i);
        if (y < itemY1) {
          return i;
        }
      }
    }
    return -1;
  }
Exemplo n.º 5
0
 // returns height of draw area in pixels
 public final int getContentHeight() {
   return getHeight() - bar.getHeight() - 1;
 }
Exemplo n.º 6
0
 protected final int getClientHeight() {
   return getHeight() - bar.getHeight();
 }
Exemplo n.º 7
0
 public final String getCaption() {
   return bar.getCaption();
 }
Exemplo n.º 8
0
 /** Set caption text for list */
 public final void setCaption(String capt) {
   bar.setCaption(capt);
 }