Page 1 of 1

wider child control makes wxScrolledWindow auto scroll

Posted: Thu Sep 05, 2019 4:15 pm
by Ronald
1. wxGrid in wxScrolledWindow
2. wxGrid is wider than wxScrolledWindow
3. when clicking on a cell of wxGrid, wxScrolledWindow auto scrolled, to show the ending part of wxGrid

How to make wxScrolledWindow not auto scroll in the case?

Re: wider child control makes wxScrolledWindow auto scroll

Posted: Thu Sep 05, 2019 5:39 pm
by doublemax

Re: wider child control makes wxScrolledWindow auto scroll

Posted: Fri Sep 06, 2019 3:19 am
by Ronald
That's it, thanks.

Re: wider child control makes wxScrolledWindow auto scroll

Posted: Fri Sep 06, 2019 3:25 am
by Ronald
The doc says it is supported since 3.1.3
The lib directory contains some files like "wxbase313u_net_vc_x64.dll", but no ShouldScrollToChildOnFocus for override.
I've checked the git repo, the newest version v3.1.2 in the result of git tag .
Which commit is better to check out for ShouldScrollToChildOnFocus?
Found some tags, like LAST_GOOD, RELEASE, tried both, cmake not work for both commits.

Re: wider child control makes wxScrolledWindow auto scroll

Posted: Fri Sep 06, 2019 7:17 am
by doublemax
I would just get the latest master branch.

Otherwise you could also try to override
void HandleOnChildFocus(wxChildFocusEvent& event);

Re: wider child control makes wxScrolledWindow auto scroll

Posted: Fri Sep 06, 2019 7:45 am
by Ronald
doublemax wrote: Fri Sep 06, 2019 7:17 am I would just get the latest master branch.

Otherwise you could also try to override
void HandleOnChildFocus(wxChildFocusEvent& event);
If HEAD commit works without unacceptable bug, I prefer it.

Thanks

Re: wider child control makes wxScrolledWindow auto scroll

Posted: Fri Sep 06, 2019 8:37 am
by doublemax
If HEAD commit works without unacceptable bug, I prefer it.
It's always possible that a recent commit breaks something, but it's rare and if it happens, it's usually fixed quickly.

Re: wider child control makes wxScrolledWindow auto scroll

Posted: Sat Sep 07, 2019 7:22 am
by Ronald
doublemax wrote: Fri Sep 06, 2019 8:37 am It's always possible that a recent commit breaks something, but it's rare and if it happens, it's usually fixed quickly.
If HEAD commit is easy to use, it'll be easy to contribute to.
The only problem in my case (Visual Studio 2019) is that when file(s) added/removed
the solution needs to be regenerated by cmake and be rebuilt.