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
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