scrolling with StaticText

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

scrolling with StaticText

Postby CrazyEddie » Sun Nov 28, 2004 10:07

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

scrolling with StaticText

Postby CrazyEddie » Mon Nov 29, 2004 09:31

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

scrolling with StaticText

Postby CrazyEddie » Sat Dec 11, 2004 20:55

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 :)

on another note, why do windows have a setVisible() function but not a getVisible() one?

Because I already have another method called 'isVisible()' :lol:

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

scrolling with StaticText

Postby CrazyEddie » Thu Dec 23, 2004 09:52

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:

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