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