On Monday, June 11, 2012 4:21:20 PM UTC+2, Catalin wrote:
Sent: Monday, 11 June 2012, 16:46
Is it normal for a wxscrolledwindow to jump (move the scroll
position)
when you click a button child?
IIRC under MSW the client area of a scrolled window will move so that a child that receives focus will be completely visible. To avoid this you can catch wxChildFocusEvent received by the scrolled window and not Skip() it.
First of all my apologies for not replying sooner, but I had quite busy weeks at my job and wasn't able to try this until today.
I can confirm that the advice by Catalin fixed this problem. While autoscrolling for making a control visible may look like a feature, I believe the current behaviour is a bug, because it's more an "autocenter" than an "autoscroll". I mean, the ScrolledWindow jumps even if the control is visible, trying to move the control as close to the center as possible. IMHO this is a bug because you don't want your ScrolledWindows to "jump" unless a hidden control got the focus.
Given that I prefer to get rid of this "jump" even if there's a (very minor) risk that a hidden control gets the focus, I'm using the advice by Catalin.
Thanks a lot.
ardi