Esempio n. 1
0
 public ListBox showScrollbar() {
   isScrollbarVisible = true;
   if ((items.size()) * _myItemHeight > _myBackgroundHeight && isScrollbarVisible) {
     _myScrollbar.show();
   }
   return this;
 }
Esempio n. 2
0
 protected void updateScroll() {
   _myScrollValue = _myScrollbar.getValue();
   _myScrollbar.setValue(_myScrollValue);
   if (buttons.size() < items.size() && isScrollbarVisible) {
     _myScrollbar.show();
   }
   updateBackground();
   scroll();
 }
 private void cancelGrab() {
   mTracking = false;
   mTriggered = false;
   mOtherSlider.show(true);
   mCurrentSlider.reset(false);
   mCurrentSlider.hideTarget();
   mCurrentSlider = null;
   mOtherSlider = null;
   setGrabbedState(OnTriggerListener.NO_HANDLE);
 }
Esempio n. 4
0
 protected void updateBackground() {
   if (items.size() * (_myItemHeight + spacing) < _myOriginalBackgroundHeight) {
     _myBackgroundHeight = items.size() * (_myItemHeight + spacing);
   }
   if (buttons.size() < items.size()) {
     _myScrollbar.setHeight(_myBackgroundHeight - spacing);
     _myScrollbar.show();
   } else {
     _myScrollbar.hide();
   }
   updateButtonWidth();
 }
Esempio n. 5
0
 protected void scroll() {
   itemOffset = 0;
   if (buttons.size() < items.size() && isScrollbarVisible) {
     _myScrollbar.show();
     itemOffset = (int) Math.abs(_myScrollValue * (items.size() - buttons.size()));
   } else {
     _myScrollbar.hide();
   }
   if (!bulkadding) {
     for (int i = 0; i < buttons.size(); i++) {
       ListBoxItem item = items.get(itemOffset + i);
       Button b = buttons.get(i);
       b.getCaptionLabel().toUpperCase(isToUpperCase);
       b.setColor(item.getColor());
       b.getCaptionLabel().set(item.getText());
       b._myValue = item.getValue();
     }
   }
 }