Newbie question about autoscrolling

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
yah1003
In need of some credit
In need of some credit
Posts: 1
Joined: Thu Feb 14, 2019 3:23 am

Newbie question about autoscrolling

Post by yah1003 » Thu Feb 14, 2019 3:44 am

Hi group,

I am very new to wxWidgets, I have been a heavy MFC user for the past 20 years. I have tried wxWidgets for the whole day and studied the sample codes provided by wxWidgets installation. I found wxWidgets very powerful and easy to use. Very nice job.


Now I have questions about autoscrolling using wxScrolled<wxWindow>, I am not able to find answer doing web searches

1. How to enable/disable autoscrolling?

2. If autoscrolling is enabled, from the sample code it seems autoscrolling is automatically done if the mouse cursor pass the window boundary when left mouse button is pressed. So the autoscrolling is managed automatically without adding any code for it?

3. How to adjust the autoscrolling speed?

Thanks.

User avatar
doublemax
Moderator
Moderator
Posts: 13003
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Newbie question about autoscrolling

Post by doublemax » Thu Feb 14, 2019 7:17 am

Hello and welcome to the forum.

Unfortunately, after you've praised wxWidgets, you won't like the answers to your questions :)
1. How to enable/disable autoscrolling?
Subclass wxScrolled<> and override SendAutoScrollEvents.
https://docs.wxwidgets.org/trunk/classw ... ab4ab5ce99
2. So the autoscrolling is managed automatically without adding any code for it?
Yes.
3. How to adjust the autoscrolling speed?
You can't. At least not with a reasonable amount of effort.

One limitation, you may not have noticed yet: If you start scrolling in one direction (e.g. horizontal), you won't be able to scroll in the other direction until you release the mouse and initiate another auto scroll.
Use the source, Luke!

Post Reply