Make sweep-select promotions work in WinBoard
authorH.G. Muller <h.g.muller@hccnet.nl>
Thu, 7 Apr 2011 21:21:02 +0000 (23:21 +0200)
committerArun Persaud <apersaud@lbl.gov>
Fri, 8 Apr 2011 03:39:40 +0000 (20:39 -0700)
The mouse-move handler had to be connected to the PromoScroll back-end
routine.

winboard/winboard.c

index 34832f0..318f33e 100644 (file)
@@ -4084,6 +4084,7 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
   static int recursive = 0;\r
   HMENU hmenu;\r
   BOOLEAN forceFullRepaint = IsFullRepaintPreferrable(); /* [AS] */\r
+  extern ChessSquare promoSweep;\r
 \r
   if (recursive) {\r
     if (message == WM_MBUTTONUP) {\r
@@ -4135,6 +4136,7 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 \r
   case WM_MOUSEMOVE:\r
     if(SeekGraphClick(Press, pt.x - boardRect.left, pt.y - boardRect.top, 1)) break;\r
+    if(promoSweep != EmptySquare && appData.sweepSelect) { PromoScroll(pt.x - boardRect.left, pt.y - boardRect.top); break; }\r
     MovePV(pt.x - boardRect.left, pt.y - boardRect.top, boardRect.bottom - boardRect.top);\r
     if ((appData.animateDragging || appData.highlightDragging)\r
        && (wParam & MK_LBUTTON)\r