X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=458aaf6443f72e488882e18d3246d1a38363bedd;hb=91d449673b904139f4bbce9e9206c161a6a9b488;hp=fae7a9d28f213811018a3c99b796f7a81b122458;hpb=dd5cb5a354036d69172eeec2dd5c0cbb49b5c2c8;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index fae7a9d..458aaf6 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -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()