Problem with CaptureMouse and windows that scrolls Topic is solved
Problem with CaptureMouse and windows that scrolls
When I capture the mouse in a window, and the window has scroll bars and a bigger content than the one I can see on the window, when I move the mouse outside the window, the content starts moving, as well as the scroll bars. This is exactly what I want to happen, but the movement is to slow, I need the content to move faster. If there is a way to tell wxWidgets to do that it would be great, but I think I'll have to do it my self. I've tryed to do it by calling SetScrollPos and by moving the content by the same amount I move the scrolls, but seems that wxWidgets is still trying to move the scrolls pixel by pixel so my window looks like an earthquake, where everybody is trying to move it on a diferent way. Is there any way to tell wxWidgets to stop moving my scrolls?
Yes, the windows scrolls when I move the mouse outside it, and the left button is pressed. The window is derived from wxScrolledWindow, and I catch the events EVT_LEFT_DOWN, EVT_LEFT_UP and EVT_MOTION. By the way, I've written the code that tries to scroll the window in the EVT_MOTION event handler.
-
- Filthy Rich wx Solver
- Posts: 203
- Joined: Tue Aug 31, 2004 7:06 pm
- Location: Behind a can of Mountain Dew
- Contact:
wxScrolledWindow is scrolling single lines which is exactly what it should do. If you want it to move more than a pixel set your scroll increment to something bigger than a pixel (using SetScrollRate).
Changing this behavior is somewhat complicated but the meat of it is in scrlwing.cpp (wxAutoScrollTimer and wxScrollHelper::HandleMouseLeave). Personally, I'd recommend just increasing your scroll rate though. 1 pixel scroll rates are annoying for users.
Changing this behavior is somewhat complicated but the meat of it is in scrlwing.cpp (wxAutoScrollTimer and wxScrollHelper::HandleMouseLeave). Personally, I'd recommend just increasing your scroll rate though. 1 pixel scroll rates are annoying for users.
Now I have a new problem: Where do I'm supposed to implement the code that scrolls the window when the mouse is outside it? If I do it in the EVT_MOTION handler, the windows only scrolls when I move the mouse outside the window, while it should do it every time the mouse *is* outside the window. Is there any EVT_MOUSE_IS_STILL_OUTSIDE event or something like that, or anything else I can do?