Subscribing events to the scrollbar of a StaticText widget

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
Obliviere
Just popping in
Just popping in
Posts: 5
Joined: Tue Sep 27, 2005 16:29

Subscribing events to the scrollbar of a StaticText widget

Postby Obliviere » Thu Jan 05, 2006 20:14

I'm having trouble subscribing ... well... what the title says. I'm trying to create a given behaviour when clicking in the StaticText area, but this behaviour doesn't seem to spread to the scrollbar when it's enabled. Therefore, I want to directly or indirectly include the scrollbars in this behaviour. A couple of apparent problems have presented themselves to me though.

a) I have no way of accessing the scrollbar globally, since the WindowManager singleton can only get windows. Even if I cast it as a Scrollbar, I can't use the Scrollbar specific functions or anything (since it's being obtained as simply a Window and the compiler complains that a Window type doesn't have those specific functions).

b) My other approach would be to access the scrollbar through the StaticText widget. This becomes the same problem as above, but also the Scrollbar members are protected in the StaticText widget, so I would not be able to access them.

I haven't been able to find anything useful on the topic in the forums so far; am I even going about this the right way? Is there an easier way I can deal with the situation? Any tips or thoughts would be appreciated, thanks!

User avatar
Obliviere
Just popping in
Just popping in
Posts: 5
Joined: Tue Sep 27, 2005 16:29

Re: Subscribing events to the scrollbar of a StaticText widg

Postby Obliviere » Thu Jan 05, 2006 20:55

To clarify the exact problems I'm running into:

If I take approach a:
CEGUI::Scrollbar* sb = (CEGUI::Scrollbar*)wmgr.getWindow(guiObjectName.c_str())->d_vertScrollbar;

The error is:
error C2039: 'd_vertScrollbar' : is not a member of 'CEGUI::Window'


Approach b:
CEGUI::StaticText* st = (CEGUI::StaticText*)wmgr.getWindow(guiObjectName.c_str());
st->d_vertScrollbar->activate();

The error is:
error C2248: 'CEGUI::StaticText::d_vertScrollbar' : cannot access protected member declared in class 'CEGUI::StaticText'


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 4 guests