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!
Subscribing events to the scrollbar of a StaticText widget
Moderators: CEGUI MVP, CEGUI Team
Re: Subscribing events to the scrollbar of a StaticText widg
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'
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 1 guest