There are currently no methods that allow you do access the scroll position directly, though what you wish to do is still possible (if not recommended). You need to ask for the internal scrollbar widget by name (which is the name of the static text with "__auto_vscrollbar__" appended), and manipulate the scrollbar directly. Be aware though, this is not an ideal thing to do and may break at some point down the road.
CE.
scrolling with StaticText
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
scrolling with StaticText
Not really
Though a Listbox does allow you some manipulation of the scroll position.
You have obviously identified a weak area in the scrollable widgets, so I'll address this shortly. In the mean time the "dangerous" solution may be the best or only option. I will say though, I'd never break code that uses the approach described above without providing some alternative first...
CE.

You have obviously identified a weak area in the scrollable widgets, so I'll address this shortly. In the mean time the "dangerous" solution may be the best or only option. I will say though, I'd never break code that uses the approach described above without providing some alternative first...
CE.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
scrolling with StaticText
Well, like I said, it's a hack. I'm sure there are ways to get it to work (what you want to be doing is mimicking the user), but whatever you do in this area would have to be classes as dangerous
Because I already have another method called 'isVisible()'
CE.

on another note, why do windows have a setVisible() function but not a getVisible() one?
Because I already have another method called 'isVisible()'

CE.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
scrolling with StaticText
The way this wroks it that whenever the static text draws itself, it queries the scrollbar for its position.
What I would do is this:
* Get a pointer to the internal Scrollbar object (as discussed).
* Attach handlers to your own buttons.
* Code handlers like this:
This should give you what you need
CE.
What I would do is this:
* Get a pointer to the internal Scrollbar object (as discussed).
* Attach handlers to your own buttons.
* Code handlers like this:
Code: Select all
// 'scrollbar' is the internal StaticText's scrollbar
// 'direction' will be either 1 or -1 depending upon the direction you want to go.
// you could replace getStepSize() with getPageSize() or some other value if you need.
float change = scrollbar->getStepSize() * direction;
// this changes the scroll position and causes the StaticText to update.
scrollbar->setScrollPosition(scrollbar->getScrollPosition() + change);
This should give you what you need

CE.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 21 guests