X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=b9d77e4e46c70e1238d3b835f9468dfa5b2ed60a;hb=refs%2Ftags%2Fgtk-20100206;hp=fae7a9d28f213811018a3c99b796f7a81b122458;hpb=536fe50335df801d3889cd55b827bdd8055f0715;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index fae7a9d..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 * @@ -3821,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(); @@ -4036,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()