Exemple #1
0
 void ScrollArea::_announceDeath(Widget *widget)
 {
     if (widget == mContent)
     {
         mContent = NULL;
         checkPolicies();
     }
     else
     {
         throw GCN_EXCEPTION("Called by not-child.");
     }
 }
Exemple #2
0
    void ScrollArea::logic()
    {
        checkPolicies();

        setVerticalScrollAmount(getVerticalScrollAmount());
        setHorizontalScrollAmount(getHorizontalScrollAmount());

        if (getContent() != NULL)
        {
            getContent()->setPosition(-mHScroll + getContent()->getFrameSize(),
                                      -mVScroll + getContent()->getFrameSize());
            getContent()->logic();
        }
    }
Exemple #3
0
    void ScrollArea::setContent(Widget* widget)
    {
        if (widget != NULL)
        {
            clear();
            add(widget);
            widget->setPosition(0,0);
        }
        else
        {
            clear();
        }

        checkPolicies();
    }
Exemple #4
0
    void ScrollArea::logic()
    {
        checkPolicies();

        setVerticalScrollAmount(getVerticalScrollAmount());
        setHorizontalScrollAmount(getHorizontalScrollAmount());
        
        if (mContent != NULL)
        {
            mContent->setPosition(-mHScroll + getContentDimension().x + mContent->getBorderSize(),
                                  -mVScroll + getContentDimension().y + mContent->getBorderSize());

            mContent->logic();
        }    
    }
Exemple #5
0
    int ScrollArea::getHorizontalMaxScroll()
    {
        checkPolicies();

        if (mContent == NULL)
        {
            return 0;
        }
        
        int value = mContent->getWidth() - getContentDimension().width + 2 * mContent->getBorderSize();

        if (value < 0)
        {
            return 0;
        }

        return value;
    } 
Exemple #6
0
    void ScrollArea::setContent(Widget* widget)
    {
        if (mContent != NULL)
        {
            mContent->_setFocusHandler(NULL);
            mContent->_setParent(NULL);
        }
    
        mContent = widget;

        if (mContent != NULL)
        {
            mContent->_setFocusHandler(_getFocusHandler());
            mContent->_setParent(this);
        }

        checkPolicies();
    }
Exemple #7
0
    int ScrollArea::getHorizontalMaxScroll()
    {
        checkPolicies();

        if (getContent() == NULL)
        {
            return 0;
        }

        int value = getContent()->getWidth() - getChildrenArea().width +
            2 * getContent()->getFrameSize();

        if (value < 0)
        {
            return 0;
        }

        return value;
    }
Exemple #8
0
    int ScrollArea::getVerticalMaxScroll()
    {
        checkPolicies();

        if (mContent == NULL)
        {
            return 0;
        }

        int value;
    
        value = mContent->getHeight() - getContentDimension().height + 2 * mContent->getBorderSize();
    
        if (value < 0)
        {
            return 0;
        }

        return value;
    } 
Exemple #9
0
    int ScrollArea::getVerticalMaxScroll()
    {
        checkPolicies();

        if (getContent() == NULL)
        {
            return 0;
        }

        int value;

        value = getContent()->getHeight() - getChildrenArea().height +
            2 * getContent()->getFrameSize();

        if (value < 0)
        {
            return 0;
        }

        return value;
    }
Exemple #10
0
 void ScrollArea::setHeight(int height)
 {
     Widget::setHeight(height);
     checkPolicies();
 }
Exemple #11
0
 void ScrollArea::setScrollPolicy(ScrollPolicy hPolicy, ScrollPolicy vPolicy)
 {
     mHPolicy = hPolicy;
     mVPolicy = vPolicy;
     checkPolicies();
 }
Exemple #12
0
 void ScrollArea::setVerticalScrollPolicy(ScrollPolicy vPolicy)
 {
     mVPolicy = vPolicy;
     checkPolicies();
 }
Exemple #13
0
 void ScrollArea::setHorizontalScrollPolicy(ScrollPolicy hPolicy)
 {
     mHPolicy = hPolicy;
     checkPolicies();
 }
Exemple #14
0
 void ScrollArea::setVerticalScrollPolicy(unsigned int vPolicy)
 {
     mVPolicy = vPolicy;
     checkPolicies();
 }
Exemple #15
0
 void ScrollArea::setDimension(const Rectangle& dimension)
 {
     Widget::setDimension(dimension);
     checkPolicies();
 }
Exemple #16
0
 void ScrollArea::setHorizontalScrollPolicy(unsigned int hPolicy)
 {
     mHPolicy = hPolicy;
     checkPolicies();
 }
Exemple #17
0
 void ScrollArea::setWidth(int width)
 {
     Widget::setWidth(width);
     checkPolicies();
 }
Exemple #18
0
 void ScrollArea::setScrollPolicy(unsigned int hPolicy, unsigned int vPolicy)
 {
     mHPolicy = hPolicy;
     mVPolicy = vPolicy;
     checkPolicies();
 }