示例#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());
    }
  }
示例#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;
 }
示例#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;
   }
 }
示例#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;
  }
示例#5
0
 // returns height of draw area in pixels
 public final int getContentHeight() {
   return getHeight() - bar.getHeight() - 1;
 }
示例#6
0
 protected final int getClientHeight() {
   return getHeight() - bar.getHeight();
 }
示例#7
0
 public final String getCaption() {
   return bar.getCaption();
 }
示例#8
0
 /** Set caption text for list */
 public final void setCaption(String capt) {
   bar.setCaption(capt);
 }