Page 1 of 1

Unwanted scrolling operations in wxScrolledWindow

Posted: Fri Jun 26, 2009 11:50 am
by Elmi
The following question is just for collecting some ideas, so every hint would be welcome.

I have a - meanwhile - big application that has a wxBookCtrl with a wxScrolledWindow and a wxPanel inside it. The Panel can become very big and supports different drawing operations. Because of that I catch different mouse events in order to implement the drawing operations and to have an automated scrolling: whenever I reach the border of the Window with mouse button pressed the wxScrolledWindow scrolls in this direction.

All that works fine. What I found out now is something strange: There is an operation where I open a poup-menu, select an item and resulting from the selection-event open a modal wxDialog-derived class. And exactly in this moment when the dialogue is opened the wxScrolledWindow jumps to its maximum positions, means the lower right corner of the wxPanel is displayed.

So what could be imaginable reasons for such a behaviour? A strange message flow where a message to the wxPanel/wxScrolledWindow should be blocked or forwarded in order to avoid that?

I know I can't get a detailled solution here but every hint is welcome :-)

Posted: Fri Jun 26, 2009 12:00 pm
by Frank
I have the same problem.

Don't know if it helps you in any way, but in my application the scrolling happens when the scrolled windows get's/loses the focus.

Please let me know when you find something.

Posted: Fri Jun 26, 2009 12:05 pm
by Elmi
Sometimes it helps to post something here to find the solution: The parent for the wxDialog was set wrong, here I used the scrolled wxPanel. That caused a strange center-operation on the scroller. With the parent of the dialogue set to the main window the problem is solved :-)