}
void
+Wheel (int dir, int x, int y)
+{
+ if(gameMode == EditPosition) {
+ int xSqr = EventToSquare(x, BOARD_WIDTH);
+ int ySqr = EventToSquare(y, BOARD_HEIGHT);
+ if(ySqr < 0 || xSqr < BOARD_LEFT || xSqr >= BOARD_RGHT) return;
+ if(flipView) xSqr = BOARD_WIDTH - 1 - xSqr; else ySqr = BOARD_HEIGHT - 1 - ySqr;
+ do {
+ boards[currentMove][ySqr][xSqr] += dir;
+ if((int) boards[currentMove][ySqr][xSqr] < WhitePawn) boards[currentMove][ySqr][xSqr] = BlackKing;
+ if((int) boards[currentMove][ySqr][xSqr] > BlackKing) boards[currentMove][ySqr][xSqr] = WhitePawn;
+ } while(PieceToChar(boards[currentMove][ySqr][xSqr]) == '.');
+ DrawPosition(FALSE, boards[currentMove]);
+ } else if(dir > 0) ForwardEvent(); else BackwardEvent();
+}
+
+void
SendProgramStatsToFrontend (ChessProgramState * cps, ChessProgramStats * cpstats)
{
// char * hint = lastHint;
static Option *
Exp (int n, int x, int y)
{
- static int but1, but3, oldW, oldH;
+ static int but1, but3, oldW, oldH, oldX, oldY;
int menuNr = -3, sizing, f, r;
TimeMark now;
extern Boolean right;
}
if(n == 0) { // motion
+ oldX = x; oldY = y;
if(SeekGraphClick(Press, x, y, 1)) return NULL;
if((but1 || dragging == 2) && !PromoScroll(x, y)) DragPieceMove(x, y);
if(but3) MovePV(x, y, lineGap + BOARD_HEIGHT * (squareSize + lineGap));
case 3: menuNr = RightClick(Press, x, y, &pmFromX, &pmFromY), but3 = 1; break;
case -2: shiftKey = !shiftKey;
case -3: menuNr = RightClick(Release, x, y, &pmFromX, &pmFromY), but3 = 0; break;
- case 4: BackwardEvent(); break;
- case 5: ForwardEvent(); break;
+ case 4: Wheel(-1, oldX, oldY); break;
+ case 5: Wheel(1, oldX, oldY); break;
case 10:
sizing = (oldW != x || oldH != y);
oldW = x; oldH = y;
void DragPieceMove P((int x, int y));
void LeftClick P((ClickType c, int x, int y));
int RightClick P((ClickType c, int x, int y, int *col, int *row));
+void Wheel P((int dir, int x, int y));
int StartChildProcess P((char *cmdLine, char *dir, ProcRef *pr));
void DestroyChildProcess P((ProcRef pr, int/*boolean*/ signal));