X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=06cf715a6785851fd828bce995b280b7a03c7941;hb=e7419db9b1c542d1ca0b825cdfc0032a4ba39188;hp=5c2078f9135da7ab52e68e9bc98c130d6f73e6b2;hpb=8c6546e4aad5d8e926437a4ace9973123b35cc85;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index 5c2078f..06cf715 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -1222,7 +1222,14 @@ PrintCommPortSettings(FILE *f, char *name) int MySearchPath(char *installDir, char *name, char *fullname) { - char *dummy; + char *dummy, buf[MSG_SIZ]; + if(name[0] == '%' && strchr(name+1, '%')) { // [HGM] recognize %*% as environment variable + strcpy(buf, name+1); + *strchr(buf, '%') = 0; + installDir = getenv(buf); + sprintf(fullname, "%s\\%s", installDir, strchr(name+1, '%')+1); + return strlen(fullname); + } return (int) SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy); } @@ -3797,20 +3804,20 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (PtInRect((LPRECT) &whiteRect, pt)) { if (gameMode == EditPosition) { SetWhiteToPlayEvent(); + } else if (gameMode == EditGame || GetKeyState(VK_SHIFT) < 0) { + AdjustClock(flipClock, -1); } else if (gameMode == IcsPlayingBlack || gameMode == MachinePlaysWhite) { CallFlagEvent(); - } else if (gameMode == EditGame) { - AdjustClock(flipClock, -1); } } else if (PtInRect((LPRECT) &blackRect, pt)) { if (gameMode == EditPosition) { SetBlackToPlayEvent(); + } else if (gameMode == EditGame || GetKeyState(VK_SHIFT) < 0) { + AdjustClock(!flipClock, -1); } else if (gameMode == IcsPlayingWhite || gameMode == MachinePlaysBlack) { CallFlagEvent(); - } else if (gameMode == EditGame) { - AdjustClock(!flipClock, -1); } } dragInfo.start.x = dragInfo.start.y = -1; @@ -3859,12 +3866,12 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* Mouse Wheel is being rolled forward * Play moves forward */ - if((short)HIWORD(wParam) > 0 && currentMove < forwardMostMove) + if((short)HIWORD(wParam) < 0 && currentMove < forwardMostMove) { if(lastDir == 1) ForwardEvent(); else lastDir = 1; } // [HGM] suppress first event in direction /* Mouse Wheel is being rolled backward * Play moves backward */ - if((short)HIWORD(wParam) < 0 && currentMove > backwardMostMove) + if((short)HIWORD(wParam) > 0 && currentMove > backwardMostMove) { if(lastDir == -1) BackwardEvent(); else lastDir = -1; } } break; @@ -3890,10 +3897,11 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if(y == -2) { /* [HGM] right mouse button in clock area edit-game mode ups clock */ if (PtInRect((LPRECT) &whiteRect, pt)) { - if (gameMode == EditGame) AdjustClock(flipClock, 1); + if (gameMode == EditGame || GetKeyState(VK_SHIFT) < 0) AdjustClock(flipClock, 1); } else if (PtInRect((LPRECT) &blackRect, pt)) { - if (gameMode == EditGame) AdjustClock(!flipClock, 1); + if (gameMode == EditGame || GetKeyState(VK_SHIFT) < 0) AdjustClock(!flipClock, 1); } + break; } DrawPosition(TRUE, NULL); @@ -4540,7 +4548,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) TagsPopUp(tags, CmailMsg()); free(tags); } - SAY("programs start playing each other"); + SAY("computer starts playing both sides"); break; case IDM_AnalysisMode: @@ -4603,7 +4611,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case IDM_EditPosition: EditPositionEvent(); - SAY("to set up a position type a FEN"); + SAY("enter a FEN string or setup a position on the board using the control R pop up menu"); break; case IDM_Training: @@ -8161,6 +8169,7 @@ ResetFrontEnd() ReleaseCapture(); DrawPosition(TRUE, NULL); } + TagsPopDown(); }