/*\r
* woptions.c -- Options dialog box routines for WinBoard\r
*\r
- * Copyright 2000, 2009, 2010, 2011 Free Software Foundation, Inc.\r
+ * Copyright 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.\r
*\r
* Enhancements Copyright 2005 Alessandro Scotti\r
*\r
LRESULT CALLBACK\r
BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
{\r
- static Boolean mono, white, flip, fonts, bitmaps;\r
+ static Boolean mono, white, flip, fonts, bitmaps, grid;\r
static BoardSize size;\r
static COLORREF lsc, dsc, wpc, bpc, hsc, phc;\r
static HBITMAP pieces[3];\r
if (appData.useFont)\r
CheckDlgButton(hDlg, OPT_PieceFont, TRUE);\r
\r
+ if (appData.overrideLineGap >= 0)\r
+ CheckDlgButton(hDlg, OPT_Grid, TRUE);\r
+\r
pieces[0] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "s");\r
pieces[1] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "w");\r
pieces[2] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "o");\r
size = boardSize;\r
bitmaps = appData.useBitmaps;\r
fonts = appData.useFont;\r
+ grid = appData.overrideLineGap >= 0;\r
\r
SetBoardOptionEnables(hDlg);\r
return TRUE;\r
(white != appData.allWhite) ||\r
(fonts != appData.useFont) ||\r
(bitmaps != appData.useBitmaps) ||\r
+ (grid != appData.overrideLineGap >= 0) ||\r
(phc != premoveHighlightColor)) {\r
\r
lightSquareColor = lsc;\r
appData.upsideDown = flip;\r
appData.useFont = fonts;\r
appData.useBitmaps = bitmaps;\r
+ if(grid != appData.overrideLineGap >= 0) appData.overrideLineGap = grid - 1;\r
\r
InitDrawingColors();\r
InitDrawingSizes(boardSize, 0);\r
case OPT_PieceFont:\r
fonts = !fonts;\r
break;\r
+\r
+ case OPT_Grid:\r
+ grid = !grid;\r
+ break;\r
}\r
break;\r
}\r
SetDlgItemInt(hDlg, OPT_date, appData.dateThreshold, FALSE);\r
SetDlgItemInt(hDlg, OPT_Stretch, appData.stretch, FALSE);\r
CheckDlgButton(hDlg, OPT_Reversed, appData.ignoreColors);\r
+ CheckDlgButton(hDlg, OPT_Mirror, appData.findMirror);\r
switch (appData.searchMode) {\r
case 1:\r
CheckDlgButton(hDlg, OPT_Exact, TRUE);\r
appData.stretch = GetDlgItemInt(hDlg, OPT_Stretch, &ok, FALSE);\r
appData.searchMode = LoadOptionsWhichRadio(hDlg);\r
appData.ignoreColors = IsDlgButtonChecked(hDlg, OPT_Reversed);\r
+ appData.findMirror = IsDlgButtonChecked(hDlg, OPT_Mirror);\r
EndDialog(hDlg, TRUE);\r
return TRUE;\r
\r
TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
{\r
char buf[MSG_SIZ], *tc;\r
- int mps, increment, odds1, odds2, st;\r
+ int mps, odds1, odds2, st;\r
+ float increment;\r
BOOL ok, ok2;\r
\r
switch (message) {\r
CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
Translate(hDlg, DLG_TimeControl);\r
/* Initialize the dialog items */\r
- if (appData.clockMode && !appData.icsActive) {\r
+ if (/*appData.clockMode &&*/ !appData.icsActive) { // [HGM] even if !clockMode, we could want to set it in tournament dialog\r
if (searchTime) {\r
CheckRadioButton(hDlg, OPT_TCUseMoves, OPT_TCUseFixed,\r
OPT_TCUseFixed);\r
SetDlgItemText(hDlg, OPT_TCTime2, "");\r
SetDlgItemText(hDlg, OPT_TCInc, "");\r
} else {\r
+ int i = appData.timeIncrement;\r
+ if(i == appData.timeIncrement) snprintf(buf, MSG_SIZ, "%d", i);\r
+ else snprintf(buf, MSG_SIZ, "%4.2f", appData.timeIncrement);\r
CheckRadioButton(hDlg, OPT_TCUseMoves, OPT_TCUseFixed,\r
OPT_TCUseInc);\r
SetDlgItemText(hDlg, OPT_TCTime, "");\r
SetDlgItemText(hDlg, OPT_TCMoves, "");\r
SetDlgItemText(hDlg, OPT_TCTime2, appData.timeControl);\r
- SetDlgItemInt(hDlg, OPT_TCInc, appData.timeIncrement, FALSE);\r
+ SetDlgItemText(hDlg, OPT_TCInc, buf);\r
}\r
SetDlgItemInt(hDlg, OPT_TCOdds1, 1, FALSE);\r
SetDlgItemInt(hDlg, OPT_TCOdds2, 1, FALSE);\r
}\r
tc = buf;\r
} else {\r
- increment = GetDlgItemInt(hDlg, OPT_TCInc, &ok, FALSE);\r
+ GetDlgItemText(hDlg, OPT_TCInc, buf, MSG_SIZ);\r
+ ok = (sscanf(buf, "%f%c", &increment, buf) == 1);\r
if (!ok || increment < 0) {\r
MessageBox(hDlg, _("Invalid increment"),\r
_("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r