Exemple #1
0
void TwScrollView::onScrollBarPostionChanged(TwObject* sender, float position)
{
    TW_UNUSED(sender);
    m_contentWidget->setY(static_cast<int>(-position));

    updateScrollView();
}
Exemple #2
0
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();
}
Exemple #3
0
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();
}
Exemple #4
0
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();
}
Exemple #5
0
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();
}
Exemple #6
0
void TwScrollView::onScrollVisbleChanged(TwObject* sender)
{
    TW_UNUSED(sender);
    
    updateScrollView();
}