void ScrollArea::_announceDeath(Widget *widget) { if (widget == mContent) { mContent = NULL; checkPolicies(); } else { throw GCN_EXCEPTION("Called by not-child."); } }
void ScrollArea::logic() { checkPolicies(); setVerticalScrollAmount(getVerticalScrollAmount()); setHorizontalScrollAmount(getHorizontalScrollAmount()); if (getContent() != NULL) { getContent()->setPosition(-mHScroll + getContent()->getFrameSize(), -mVScroll + getContent()->getFrameSize()); getContent()->logic(); } }
void ScrollArea::setContent(Widget* widget) { if (widget != NULL) { clear(); add(widget); widget->setPosition(0,0); } else { clear(); } checkPolicies(); }
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(); } }
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; }
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(); }
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; }
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; }
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; }
void ScrollArea::setHeight(int height) { Widget::setHeight(height); checkPolicies(); }
void ScrollArea::setScrollPolicy(ScrollPolicy hPolicy, ScrollPolicy vPolicy) { mHPolicy = hPolicy; mVPolicy = vPolicy; checkPolicies(); }
void ScrollArea::setVerticalScrollPolicy(ScrollPolicy vPolicy) { mVPolicy = vPolicy; checkPolicies(); }
void ScrollArea::setHorizontalScrollPolicy(ScrollPolicy hPolicy) { mHPolicy = hPolicy; checkPolicies(); }
void ScrollArea::setVerticalScrollPolicy(unsigned int vPolicy) { mVPolicy = vPolicy; checkPolicies(); }
void ScrollArea::setDimension(const Rectangle& dimension) { Widget::setDimension(dimension); checkPolicies(); }
void ScrollArea::setHorizontalScrollPolicy(unsigned int hPolicy) { mHPolicy = hPolicy; checkPolicies(); }
void ScrollArea::setWidth(int width) { Widget::setWidth(width); checkPolicies(); }
void ScrollArea::setScrollPolicy(unsigned int hPolicy, unsigned int vPolicy) { mHPolicy = hPolicy; mVPolicy = vPolicy; checkPolicies(); }