allow scrolling to top and bottom from lua
This commit is contained in:
parent
3babafb53d
commit
8d0cd713e2
3 changed files with 16 additions and 0 deletions
src
|
@ -162,6 +162,10 @@ namespace gcn
|
|||
*/
|
||||
virtual void setScrollPolicy(unsigned int hPolicy, unsigned int vPolicy);
|
||||
|
||||
virtual void scrollToBottom();
|
||||
|
||||
virtual void scrollToTop();
|
||||
|
||||
/**
|
||||
* Sets the amount to scroll verticaly.
|
||||
*
|
||||
|
|
|
@ -181,6 +181,16 @@ namespace gcn
|
|||
checkPolicies();
|
||||
}
|
||||
|
||||
void ScrollArea::scrollToBottom()
|
||||
{
|
||||
setVerticalScrollAmount(getVerticalMaxScroll());
|
||||
}
|
||||
|
||||
void ScrollArea::scrollToTop()
|
||||
{
|
||||
setVerticalScrollAmount(0);
|
||||
}
|
||||
|
||||
void ScrollArea::setVerticalScrollAmount(int vScroll)
|
||||
{
|
||||
int max = getVerticalMaxScroll();
|
||||
|
|
|
@ -325,6 +325,8 @@ class ScrollArea : public BasicContainer
|
|||
virtual Widget *getContent();
|
||||
virtual void setScrollbarWidth(int width);
|
||||
virtual int getScrollbarWidth();
|
||||
virtual void scrollToBottom();
|
||||
virtual void scrollToTop();
|
||||
};
|
||||
|
||||
class ImageWidget : public Widget
|
||||
|
|
Loading…
Add table
Reference in a new issue