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; }
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); }
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 }
void ScroolWidget::mouseMoveEvent(Tempest::MouseEvent &e) { e.ignore(); }