Page 1 of 1
continuous scrolling
Posted: Tue Nov 29, 2005 13:54
by reist
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.
Re: continuous scrolling
Posted: Tue Nov 29, 2005 15:26
by lindquist
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.
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
Posted: Tue Nov 29, 2005 16:50
by reist
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.
Re: continuous scrolling
Posted: Mon Dec 19, 2005 22:30
by Gaal
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
Re: continuous scrolling
Posted: Wed Dec 21, 2005 06:48
by Gaal
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
Re: continuous scrolling
Posted: Fri Jan 06, 2006 13:52
by Ben811
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