Example #1
0
void ListBox::mouseWheelEvent(Tempest::MouseEvent &e) {
  if( !rect().contains(e.x+x(), e.y+y()) ){
    e.ignore();
    return;
    }

  dropListEnabled = false;
  std::shared_ptr<ListDelegate> d = listDelegate;
  if( d && d->size() ){
    Layout& l = layout();
    Widget* view = (l.widgets().size()==0 ? nullptr : l.widgets()[0]);
    if( e.delta < 0 ){
      if( selected+1<d->size() )
        d->onItemViewSelected(selected+1,view); else
        e.ignore();
      }
      else
    if( e.delta > 0 ){
      if( selected>0 )
        d->onItemViewSelected(selected-1,view); else
        e.ignore();
      }
    }
  dropListEnabled = true;
  }
Example #2
0
void ScroolWidget::mouseWheelEvent(Tempest::MouseEvent &e) {
  if( !rect().contains(e.x+x(), e.y+y()) || !sb.isVisible() ){
    e.ignore();
    return;
    }

  if( orientation()==Tempest::Vertical )
    sb.setValue(sb.value() - e.delta);
  }
Example #3
0
void LineEdit::mouseDownEvent(Tempest::MouseEvent &e) {
  if(!editable){
    e.ignore();
    return;
    }

  sp = e.pos();
  ep = e.pos();

  updateSel();
  update();

#ifdef __ANDROID__
  if( editable )
    AndroidAPI::toggleSoftInput();
#endif
  }
Example #4
0
void ScroolWidget::mouseMoveEvent(Tempest::MouseEvent &e) {
  e.ignore();
  }