+ // Scroll the window if the mouse is at the end of it:
+ if(m_Selecting && eventId == WXLOWIN_MENU_MOUSEMOVE)
+ {
+ //WXLO_DEBUG(("selecting at : %d/%d", (int) event.GetX(), (int)event.GetY()));
+ int left, top;
+ ViewStart(&left, &top);
+ wxSize size = GetClientSize();
+ int xdelta, ydelta;
+
+ if(event.GetX() < WXLO_SCROLLMARGIN_X)
+ xdelta = -(WXLO_SCROLLMARGIN_X-event.GetX());
+ else if(event.GetX() > size.x-WXLO_SCROLLMARGIN_X)
+ xdelta = event.GetX()-size.x+WXLO_SCROLLMARGIN_X;
+ else
+ xdelta = 0;
+ if(event.GetY() < WXLO_SCROLLMARGIN_Y)
+ ydelta = -(WXLO_SCROLLMARGIN_Y-event.GetY());
+ else if(event.GetY() > size.y-WXLO_SCROLLMARGIN_Y)
+ ydelta = event.GetY()-size.y+WXLO_SCROLLMARGIN_Y;
+ else
+ ydelta = 0;
+
+ //WXLO_DEBUG(("xdelta: %d", (int) xdelta));
+ if(xdelta != 0 || ydelta != 0)
+ {
+ top += ydelta; if(top < 0) top = 0;
+ left += xdelta; if(left < 0) left = 0;
+ Scroll(left, top);
+ }
+ }
+