From: H.G. Muller Date: Wed, 20 Jan 2010 08:14:15 +0000 (+0100) Subject: Eliminated Edit-Position menu X-Git-Tag: gtk-20100206~11 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=fd6c0a862ee5d94985882179902b95d8f66a3c1b Eliminated Edit-Position menu EditPosition now also uses the main board to display the set of available pieces to choose from, in stead of the piece menu. There is no clear-board function yet, though. --- diff --git a/backend.c b/backend.c index 34b4c36..1a94cf7 100644 --- a/backend.c +++ b/backend.c @@ -6099,8 +6099,10 @@ UserMoveEvent(fromX, fromY, toX, toY, promoChar) void PromoDialog(int h, int w, Board board, Boolean clearBoard) { // dummy routine to mimic with pseudo-popup what front-end should do: - // display a popup with h x w mini-board - int i, j; + // 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); } @@ -6110,7 +6112,32 @@ int wTab[(int)EmptySquare/2+1] = { 1,1,2,3,4,5,3,7,4,3,5,4,4,5,7,5,4,6,6,5,5,7,6 Board promoBoard; int promotionChoice = 0; -void PromoPopUp(ChessSquare piece) +void +PiecePopUp() +{ + int i, j, h, w, nWhite=0, nBlack=0; + ChessSquare list[EmptySquare]; + for(i=0; iBOARD_RGHT-BOARD_LEFT) { w = BOARD_RGHT - BOARD_LEFT; h = (j+w-1)/w; } + for(i=0; i