update year in copyright info
[xboard.git] / winboard / winboard.c
index 0958d00..b9d77e4 100644 (file)
@@ -5,7 +5,7 @@
  * Massachusetts. \r
  *\r
  * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,\r
- * 2007, 2008, 2009 Free Software Foundation, Inc.\r
+ * 2007, 2008, 2009, 2010 Free Software Foundation, Inc.\r
  *\r
  * Enhancements Copyright 2005 Alessandro Scotti\r
  *\r
@@ -3127,8 +3127,14 @@ void DrawSeekText(char *buf, int x, int y)
 \r
 void DrawSeekDot(int x, int y, int color)\r
 {\r
+       int square = color & 0x80;\r
+       color &= 0x7F;\r
            HBRUSH oldBrush = SelectObject(hdcSeek, \r
                        color == 0 ? markerBrush : color == 1 ? darkSquareBrush : explodeBrush);\r
+       if(square)\r
+           Rectangle(hdcSeek, boardRect.left+x - squareSize/9, boardRect.top+y - squareSize/9,\r
+                              boardRect.left+x + squareSize/9, boardRect.top+y + squareSize/9);\r
+       else\r
            Ellipse(hdcSeek, boardRect.left+x - squareSize/8, boardRect.top+y - squareSize/8,\r
                             boardRect.left+x + squareSize/8, boardRect.top+y + squareSize/8);\r
            SelectObject(hdcSeek, oldBrush);\r
@@ -3773,7 +3779,7 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     break;\r
 \r
   case WM_MOUSEMOVE:\r
-    if(SeekGraphClick(Press, pt.x - boardRect.left, pt.y - boardRect.top, TRUE)) break;\r
+    if(SeekGraphClick(Press, pt.x - boardRect.left, pt.y - boardRect.top, 1)) 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
@@ -3815,9 +3821,13 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_MBUTTONUP:\r
   case WM_RBUTTONUP:\r
     ReleaseCapture();\r
+    { extern int promotionChoice; extern Board promoBoard;\r
+      if(promotionChoice == 3 && (promoBoard[y][x] == EmptySquare || x == fromX && y == fromY))\r
+         break; // [HGM] promopopup: suppression of up-click selection as long as pseudo-popup is used\r
+    }\r
     RightClick(Release, pt.x - boardRect.left, pt.y - boardRect.top, &fromX, &fromY);\r
     break;\r
\r
+\r
   case WM_MBUTTONDOWN:\r
   case WM_RBUTTONDOWN:\r
     ErrorPopDown();\r
@@ -4030,6 +4040,17 @@ PromotionPopUp()
   PromotionPopup(hwndMain);\r
 }\r
 \r
+void\r
+PromoDialog(int h, int w, Board board, Boolean clearBoard, char *title, int x, int y)\r
+{      // dummy routine to mimic with pseudo-popup what front-end should do:\r
+       // display a popup with h x w mini-board, and divert any mouse clicks\r
+       // on it to the back-end routines RightClick and LeftClick, just\r
+       // like the mouse event hadler of the board widget does now.\r
+       // (Note it would have to off-set x if holdings are displayed!)\r
+       DisplayMessage("Click on your piece of choice", "");\r
+       DrawPosition(TRUE, board);\r
+}\r
+\r
 /* Toggle ShowThinking */\r
 VOID\r
 ToggleShowThinking()\r