Jump to content

WidgetScrollBox::setVScrollValue() usage


photo

Recommended Posts

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

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
×
×
  • Create New...