void ScrollablePane::configureScrollbars(void)
    {
        // controls should all be valid by this stage
        assert(d_container != 0);
        assert(d_vertScrollbar != 0);
        assert(d_horzScrollbar != 0);

        // enable required scrollbars
        d_vertScrollbar->setVisible(isVertScrollbarNeeded());
        d_horzScrollbar->setVisible(isHorzScrollbarNeeded());

        // Check if the addition of the horizontal scrollbar means we
        // now also need the vertical bar.
        if (d_horzScrollbar->isVisible())
        {
            d_vertScrollbar->setVisible(isVertScrollbarNeeded());
        }

        performChildWindowLayout();

        // get viewable area
        Rect viewableArea(getViewableArea());
		if( d_vertScrollbar )
		{
			// set up vertical scroll bar values
			d_vertScrollbar->setDocumentSize(fabsf(d_contentRect.getHeight()));
			d_vertScrollbar->setPageSize(viewableArea.getHeight());
			d_vertScrollbar->setStepSize(ceguimax(1.0f, viewableArea.getHeight() * d_vertStep));
			d_vertScrollbar->setOverlapSize(ceguimax(1.0f, viewableArea.getHeight() * d_vertOverlap));
			d_vertScrollbar->setScrollPosition(d_vertScrollbar->getScrollPosition());
		}

		if( d_horzScrollbar )
		{
				// set up horizontal scroll bar values
			d_horzScrollbar->setDocumentSize(fabsf(d_contentRect.getWidth()));
			d_horzScrollbar->setPageSize(viewableArea.getWidth());
			d_horzScrollbar->setStepSize(ceguimax(1.0f, viewableArea.getWidth() * d_horzStep));
			d_horzScrollbar->setOverlapSize(ceguimax(1.0f, viewableArea.getWidth() * d_horzOverlap));
			d_horzScrollbar->setScrollPosition(d_horzScrollbar->getScrollPosition());	
		}
    }
    bool ScrollablePane::isVertScrollbarNeeded(void) const
    {
        assert(d_container != 0);

        return ((fabs(d_contentRect.getHeight()) > getViewableArea().getHeight()) || d_forceVertScroll);
    }
    bool ScrollablePane::isHorzScrollbarNeeded(void) const
    {
        assert(d_container != 0);

        return ((fabs(d_contentRect.getWidth()) > getViewableArea().getWidth()) || d_forceHorzScroll);
    }