Hi,
Is there a way to make scrollbars continuously scroll when holding the left mouse button on them? I want to add this ability to StaticText and ScrollablePane widgets.
continuous scrolling
Moderators: CEGUI MVP, CEGUI Team
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: continuous scrolling
There is a feature to make the mousebuttons autorepeat.
http://www.cegui.org.uk/api_reference/c ... aeadc7a55c
Though getting to the windows you want it for can be a little tricky.
You'll need to know a bit about how the automatically created widgets are named. A component widget (auto) has the name of its parent suffixed with a magic string.
So if your StaticText is called 'MyStatic' you would do something like this to make the buttons of the vertical scrollbar auto scroll when the mouse is held.
Another approach would be to make it the default setup for any scrollbar by doing the same thing via properties in the look'n'feel.
http://www.cegui.org.uk/api_reference/c ... epeat.html
http://www.cegui.org.uk/api_reference/c ... aeadc7a55c
Though getting to the windows you want it for can be a little tricky.
You'll need to know a bit about how the automatically created widgets are named. A component widget (auto) has the name of its parent suffixed with a magic string.
Code: Select all
The scrollbars are suffixed with:
"__auto_vscrollbar__"
"__auto_hscrollbar__"
These scrollbars have auto widgets themselves named:
"__auto_incbtn__"
"__auto_decbtn__"
"__auto_thumb__"
So if your StaticText is called 'MyStatic' you would do something like this to make the buttons of the vertical scrollbar auto scroll when the mouse is held.
Code: Select all
WindowManager* wm = WindowManager::getSingletonPtr();
wm->getWindow("MyStatic__auto_vscrollbar____auto_decbtn__")->
setMouseAutoRepeatEnabled(true);
wm->getWindow("MyStatic__auto_vscrollbar____auto_incbtn__")->
setMouseAutoRepeatEnabled(true);
Another approach would be to make it the default setup for any scrollbar by doing the same thing via properties in the look'n'feel.
http://www.cegui.org.uk/api_reference/c ... epeat.html
Re: continuous scrolling
Thanks for the quick reply.
Seems I'll go with the looknfeel. The code approach looks pretty bad, especially doing it for each widget with scrollbars.
Seems I'll go with the looknfeel. The code approach looks pretty bad, especially doing it for each widget with scrollbars.
Re: continuous scrolling
Hi Reist,
Did you manage to make the mousebutton autorepeat?
Because I tried the both solutions for the Spinner (and for a basic button) and none of them worked for me.
Does anybody manage to make the MouseButton autorepeat?
Gaal
Did you manage to make the mousebutton autorepeat?
Because I tried the both solutions for the Spinner (and for a basic button) and none of them worked for me.
Does anybody manage to make the MouseButton autorepeat?
Gaal
Re: continuous scrolling
After looking inside Spinner code, I noticed that the setMouseAutoRepeatEnabled is allready set to TRUE, for each increase et decrease buttons.
But it does not work in my programme.
Is there anything else I should add somewhere ?
I tried several things but could not cope with.
Merci d'avance
Gaal
But it does not work in my programme.
Is there anything else I should add somewhere ?
I tried several things but could not cope with.
Merci d'avance
Gaal
Re: continuous scrolling
Hi,
got the same problem and found the solution in this thread:
http://www.cegui.org.uk/modules/newbb/v ... umpost5234
You have to tell CEGUI that the time is passing by...
...
To enable this you need to look at the function:
Window::setMouseAutoRepeatEnabled
For this to work, you also need to be correctly injecting time pulses each update via the function:
System::injectTimePulse
...
I've put that function in the draw callback or just take a separate timer thread...
Regards,
Ben
got the same problem and found the solution in this thread:
http://www.cegui.org.uk/modules/newbb/v ... umpost5234
You have to tell CEGUI that the time is passing by...
...
To enable this you need to look at the function:
Window::setMouseAutoRepeatEnabled
For this to work, you also need to be correctly injecting time pulses each update via the function:
System::injectTimePulse
...
I've put that function in the draw callback or just take a separate timer thread...
Regards,
Ben
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 9 guests