wxscrolledwindow jump on msw

39 views
Skip to first unread message

ardi

unread,
Jun 11, 2012, 9:46:09 AM6/11/12
to wx-users
Is it normal for a wxscrolledwindow to jump (move the scroll position)
when you click a button child?

This happens me on msw, but not on osx

TIA

ardi

Catalin

unread,
Jun 11, 2012, 10:21:20 AM6/11/12
to wx-u...@googlegroups.com


From: ardi <ardillas...@gmail.com>
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.

Regards,
C

ardi

unread,
Jun 23, 2012, 12:41:41 PM6/23/12
to wx-u...@googlegroups.com, Catalin


On Monday, June 11, 2012 4:21:20 PM UTC+2, Catalin wrote:


From: ardi

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.

Regards,
C

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


 
Reply all
Reply to author
Forward
0 new messages