* 1992-2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software\r
* Foundation, Inc.\r
*\r
+ * XBoard borrows its colors and the bitmaps.xchess bitmap set from XChess,\r
+ * which was written and is copyrighted by Wayne Christopher.\r
+ *\r
* The following terms apply to Digital Equipment Corporation's copyright\r
* interest in XBoard:\r
* ------------------------------------------------------------------------\r
void\r
EnsureOnScreen(int *x, int *y)\r
{\r
- int gap = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYCAPTION);\r
+// int gap = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYCAPTION);\r
/* Be sure window at (x,y) is not off screen (or even mostly off screen) */\r
if (*x > screenWidth - 32) *x = 0;\r
if (*y > screenHeight - 32) *y = 0;\r
- if (*x < 10) *x = 10;\r
- if (*y < gap) *y = gap;\r
+ if (*x < 0) *x = 0;\r
+ if (*y < 0) *y = 0;\r
+// if (*x < 10) *x = 10;\r
+// if (*y < gap) *y = gap;\r
}\r
\r
BOOL\r
if (recurse > 0) return;\r
recurse++;\r
while (newSize > 0) {\r
- InitDrawingSizes(newSize, 0);\r
- if(newSizeX >= sizeInfo[newSize].cliWidth ||\r
+ InitDrawingSizes(newSize+1000, 0); // [HGM] kludge to update sizeInfo without visible effects\r
+ if(newSizeX >= sizeInfo[newSize].cliWidth &&\r
newSizeY >= sizeInfo[newSize].cliHeight) break;\r
newSize--;\r
} \r
int offby;\r
LOGBRUSH logbrush;\r
\r
- /* [HGM] call with -1 uses old size (for if nr of files, ranks changes) */\r
+ int suppressVisibleEffects = 0; // [HGM] kludge to request updating sizeInfo only\r
+ if((int)boardSize >= 1000 ) { boardSize -= 1000; suppressVisibleEffects = 1; }\r
+\r
+ /* [HGM] call with -2 uses old size (for if nr of files, ranks changes) */\r
if(boardSize == (BoardSize)(-2) ) boardSize = oldBoardSize;\r
\r
tinyLayout = sizeInfo[boardSize].tinyLayout;\r
\r
sizeInfo[boardSize].cliWidth = boardRect.right + OUTER_MARGIN;\r
sizeInfo[boardSize].cliHeight = boardRect.bottom + OUTER_MARGIN;\r
+ if(suppressVisibleEffects) return; // [HGM] when called for filling sizeInfo only\r
winWidth = 2 * GetSystemMetrics(SM_CXFRAME) + boardRect.right + OUTER_MARGIN;\r
winHeight = 2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYMENU) +\r
GetSystemMetrics(SM_CYCAPTION) + boardRect.bottom + OUTER_MARGIN;\r
break;\r
\r
case WM_MOUSEWHEEL: // [DM]\r
+ { static int lastDir = 0; // [HGM] build in some hysteresis to avoid spurious events\r
/* Mouse Wheel is being rolled forward\r
* Play moves forward\r
*/\r
- if((short)HIWORD(wParam) > 0 && currentMove < forwardMostMove) ForwardEvent();\r
+ if((short)HIWORD(wParam) > 0 && currentMove < forwardMostMove) \r
+ if(lastDir == 1) ForwardEvent(); else lastDir = 1; // [HGM] suppress first event in each direction\r
/* Mouse Wheel is being rolled backward\r
* Play moves backward\r
*/\r
- if((short)HIWORD(wParam) < 0 && currentMove > backwardMostMove) BackwardEvent();\r
- break;\r
+ if((short)HIWORD(wParam) < 0 && currentMove > backwardMostMove) \r
+ if(lastDir == -1) BackwardEvent(); else lastDir = -1;\r
+ }\r
+ break;\r
\r
case WM_MBUTTONDOWN:\r
case WM_RBUTTONDOWN:\r