void TwScrollView::onScrollBarPostionChanged(TwObject* sender, float position) { TW_UNUSED(sender); m_contentWidget->setY(static_cast<int>(-position)); updateScrollView(); }
void TwScrollView::onResizeEvent(TwResizeEvent* ev) { m_scrollBar->setBoundRect(width() - k_ScrollBarWidth, 0, k_ScrollBarWidth, height()); m_scrollBar->setPageStep(static_cast<float>(ev->newSize().height())); updateScrollView(); }
void ScrollPanel::onResize(int width, int height){ Panel::onResize(width, height); scrollBar.setSize(10, rect.height, 0); scrollBar.rect.left = rect.width - 10; scrollBar.parent = this; scrollBar.visible = false; yScroll = 0; scrollArea.x = rect.width; scrollArea.y = 0; updateScrollView(); }
void TwScrollView::onContentWidgetBoundChanged(TwObject* sender) { TW_UNUSED(sender); float max = static_cast<float>(m_contentWidget->height() - height()); if (max < 0) { max = 0; } m_scrollBar->setRange(0.f, max); m_scrollBar->setPageStep(static_cast<float>(height())); updateScrollView(); }
void TwScrollView::onContentWidgetChanged() { float max = static_cast<float>(m_contentWidget->height() - height()); if (max < 0) { max = 0; } m_scrollBar->setRange(0.f, max); m_scrollBar->setPageStep(static_cast<float>(height())); m_scrollBar->scrollToPostion(0.f); updateScrollView(); }
void TwScrollView::onScrollVisbleChanged(TwObject* sender) { TW_UNUSED(sender); updateScrollView(); }