Merge branch 'master' into v4.6.x; updated to correct version number for v4.6.0 branch
[xboard.git] / winboard / woptions.c
index 40c2090..71ccea9 100644 (file)
@@ -1,7 +1,7 @@
 /*\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
@@ -516,7 +516,7 @@ BoardOptionsWhichRadio(HWND hDlg)
 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
@@ -599,6 +599,9 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     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
@@ -615,6 +618,7 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     size = boardSize;\r
     bitmaps = appData.useBitmaps;\r
     fonts = appData.useFont;\r
+    grid = appData.overrideLineGap >= 0;\r
 \r
     SetBoardOptionEnables(hDlg);\r
     return TRUE;\r
@@ -664,6 +668,7 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
           (white != appData.allWhite) ||\r
           (fonts != appData.useFont) ||\r
           (bitmaps != appData.useBitmaps) ||\r
+          (grid != appData.overrideLineGap >= 0) ||\r
          (phc  != premoveHighlightColor)) {\r
 \r
          lightSquareColor = lsc;\r
@@ -677,6 +682,7 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
           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
@@ -782,6 +788,10 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     case OPT_PieceFont:\r
       fonts = !fonts;\r
       break;\r
+\r
+    case OPT_Grid:\r
+      grid = !grid;\r
+      break;\r
     }\r
     break;\r
   }\r
@@ -2706,7 +2716,7 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     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