//==============================================================================
void Viewport::setViewedComponent (Component* const newViewedComponent)
{
    if (contentComp != newViewedComponent)
    {
        if (contentComp->isValidComponent())
        {
            Component* const oldComp = contentComp;
            contentComp = 0;
            delete oldComp;
        }

        contentComp = newViewedComponent;

        if (contentComp != 0)
        {
            contentComp->setTopLeftPosition (0, 0);
            contentHolder->addAndMakeVisible (contentComp);
            contentComp->addComponentListener (this);
        }
        
        for (int i = viewportListeners.size(); --i >= 0;)
        {
            ((ViewportListener*) viewportListeners.getUnchecked (i))
                ->viewedComponentChanged (this, contentComp);
        }

        updateVisibleRegion();
    }
}
Esempio n. 2
0
void ThumbnailStrip::loadVisibleThumbnails() {
    loadTimer.stop();
    updateVisibleRegion();
    for(int i = 0; i < thumbnailLabels.count(); i++) {
        requestThumbnail(i);
    }
}
void Viewport::setScrollBarsShown (const bool showVerticalScrollbarIfNeeded,
                                   const bool showHorizontalScrollbarIfNeeded)
{
    showVScrollbar = showVerticalScrollbarIfNeeded;
    showHScrollbar = showHorizontalScrollbarIfNeeded;
    updateVisibleRegion();
}
//==============================================================================
void Viewport::setSingleStepSizes (const int stepX,
                                   const int stepY)
{
    singleStepX = stepX;
    singleStepY = stepY;
    updateVisibleRegion();
}
void Viewport::setScrollBarThickness (const int thickness)
{
    scrollBarThickness = thickness;
    updateVisibleRegion();
}
void Viewport::resized()
{
    updateVisibleRegion();
}
void Viewport::componentMovedOrResized (Component&, bool, bool)
{
    updateVisibleRegion();
}