continuous scrolling

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
reist
Just popping in
Just popping in
Posts: 2
Joined: Sun Nov 27, 2005 18:28

continuous scrolling

Postby reist » Tue Nov 29, 2005 13:54

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.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: continuous scrolling

Postby lindquist » Tue Nov 29, 2005 15:26

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

User avatar
reist
Just popping in
Just popping in
Posts: 2
Joined: Sun Nov 27, 2005 18:28

Re: continuous scrolling

Postby reist » Tue Nov 29, 2005 16:50

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.

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Re: continuous scrolling

Postby Gaal » Mon Dec 19, 2005 22:30

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

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Re: continuous scrolling

Postby Gaal » Wed Dec 21, 2005 06:48

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

User avatar
Ben811
Just popping in
Just popping in
Posts: 14
Joined: Wed Nov 23, 2005 09:33

Re: continuous scrolling

Postby Ben811 » Fri Jan 06, 2006 13:52

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


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 2 guests