ScrollBar Issue

Started by MoLAoS, 08 February 2015, 00:00:47

MoLAoS

How can I set all scrollbars to be at the top? Current when I click on an object to change the content of a textbox the scrollbar is set all the way to the bottom, I'd prefer the opposite where it goes to the top.

texus

There is no way to control the scrollbar directly.

But it can be done indirectly in this case. After you set the text in the textbox, call the following:
Code (cpp) Select
textbox->setSelectionPointPosition(0);

MoLAoS

Is that in the documentation? I looked before I asked here.

In any case it works perfectly, thank you.

texus

The function itself is documented, but what you wanted to do is not. There is no relation with the scrollbar being moved, so it couldn't really be found.

I will add the following to the documentation of the function. That way someone might be able to find it in the future if they look for the word "scrollbar" in the documentation of the text box.
QuoteIf the selection point is outside the visible area, the text box will scroll to show the part where the selection point is located. So calling setSelectionPointPosition(0) will always make the scrollbar go completely to the top.

MoLAoS

Oh I saw that function but didn't know that determined the location of the scrollbar, too.