eugene.litvinov Posted May 19, 2011 Share Posted May 19, 2011 In help written: WidgetScrollBox::setVScrollValue void setVScrollValue(int position) Description Sets a position of the vertical scroller. Arguments int position - Position of the scroller. The minimum value is 0, the maximum value is the difference between the frame height and the object height. So for scroll to maximum I need subtract scroll area height from label height, and it will be position? I have WidgetLabel in WidgetScrollBox, and I need to scroll text automatically when added new portion of text, so I do next: captionLabel.setText(value); LOG("textScroller.getHeight(): " + textScroller.getHeight()); LOG("captionLabel.getHeight(): " + captionLabel.getHeight()); textScroller.arrange(); if (captionLabel.getHeight() - textScroller.getHeight() > 0) textScroller.setVScrollValue(captionLabel.getHeight() - textScroller.getHeight()); And it have no effect. Link to comment
manguste Posted May 24, 2011 Share Posted May 24, 2011 There's a bug with scrolling to the maximum. We will fix it in the nearest future. We will also add a sample with scrollers. For now, you can take a look at network chat sample that scrolls down messages (network/chat/scripts/gui/chat_window.h) Link to comment
frustum Posted May 24, 2011 Share Posted May 24, 2011 Copy this files into the data/samples/widgets directory and run the sample. scroll_00.cpp scroll_00.world Link to comment
Recommended Posts