X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwoptions.c;h=71ccea99da3b1fe2450908a4dbdf4f0f46560546;hb=5e0403d88fc0c96cfcc246ddb7f08462b584ae62;hp=d00d4f056e58448a275bf29f75d2c40c5c9fc66a;hpb=c69beebf3decbe67eb92beab56bbc34c41c39831;p=xboard.git diff --git a/winboard/woptions.c b/winboard/woptions.c index d00d4f0..71ccea9 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -1,7 +1,7 @@ /* * woptions.c -- Options dialog box routines for WinBoard * - * Copyright 2000, 2009, 2010, 2011 Free Software Foundation, Inc. + * Copyright 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -516,7 +516,7 @@ BoardOptionsWhichRadio(HWND hDlg) LRESULT CALLBACK BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - static Boolean mono, white, flip, fonts, bitmaps; + static Boolean mono, white, flip, fonts, bitmaps, grid; static BoardSize size; static COLORREF lsc, dsc, wpc, bpc, hsc, phc; static HBITMAP pieces[3]; @@ -599,6 +599,9 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) if (appData.useFont) CheckDlgButton(hDlg, OPT_PieceFont, TRUE); + if (appData.overrideLineGap >= 0) + CheckDlgButton(hDlg, OPT_Grid, TRUE); + pieces[0] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "s"); pieces[1] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "w"); pieces[2] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "o"); @@ -615,6 +618,7 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) size = boardSize; bitmaps = appData.useBitmaps; fonts = appData.useFont; + grid = appData.overrideLineGap >= 0; SetBoardOptionEnables(hDlg); return TRUE; @@ -664,6 +668,7 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) (white != appData.allWhite) || (fonts != appData.useFont) || (bitmaps != appData.useBitmaps) || + (grid != appData.overrideLineGap >= 0) || (phc != premoveHighlightColor)) { lightSquareColor = lsc; @@ -677,6 +682,7 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) appData.upsideDown = flip; appData.useFont = fonts; appData.useBitmaps = bitmaps; + if(grid != appData.overrideLineGap >= 0) appData.overrideLineGap = grid - 1; InitDrawingColors(); InitDrawingSizes(boardSize, 0); @@ -782,6 +788,10 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case OPT_PieceFont: fonts = !fonts; break; + + case OPT_Grid: + grid = !grid; + break; } break; } @@ -2441,7 +2451,9 @@ LoadOptionsWhichRadio(HWND hDlg) return (IsDlgButtonChecked(hDlg, OPT_Exact) ? 1 : (IsDlgButtonChecked(hDlg, OPT_Subset) ? 2 : (IsDlgButtonChecked(hDlg, OPT_Struct) ? 3 : - (IsDlgButtonChecked(hDlg, OPT_Material) ? 4 : -1)))); + (IsDlgButtonChecked(hDlg, OPT_Material) ? 4 : + (IsDlgButtonChecked(hDlg, OPT_Range) ? 5 : + (IsDlgButtonChecked(hDlg, OPT_Difference) ? 6 : -1)))))); } VOID @@ -2478,6 +2490,9 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) SetDlgItemInt(hDlg, OPT_elo1, appData.eloThreshold1, FALSE); SetDlgItemInt(hDlg, OPT_elo2, appData.eloThreshold2, FALSE); SetDlgItemInt(hDlg, OPT_date, appData.dateThreshold, FALSE); + SetDlgItemInt(hDlg, OPT_Stretch, appData.stretch, FALSE); + CheckDlgButton(hDlg, OPT_Reversed, appData.ignoreColors); + CheckDlgButton(hDlg, OPT_Mirror, appData.findMirror); switch (appData.searchMode) { case 1: CheckDlgButton(hDlg, OPT_Exact, TRUE); @@ -2491,6 +2506,12 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case 4: CheckDlgButton(hDlg, OPT_Material, TRUE); break; + case 5: + CheckDlgButton(hDlg, OPT_Range, TRUE); + break; + case 6: + CheckDlgButton(hDlg, OPT_Difference, TRUE); + break; } return TRUE; @@ -2512,7 +2533,10 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) appData.eloThreshold1 = GetDlgItemInt(hDlg, OPT_elo1, &ok, FALSE); appData.eloThreshold2 = GetDlgItemInt(hDlg, OPT_elo2, &ok, FALSE); appData.dateThreshold = GetDlgItemInt(hDlg, OPT_date, &ok, FALSE); + appData.stretch = GetDlgItemInt(hDlg, OPT_Stretch, &ok, FALSE); appData.searchMode = LoadOptionsWhichRadio(hDlg); + appData.ignoreColors = IsDlgButtonChecked(hDlg, OPT_Reversed); + appData.findMirror = IsDlgButtonChecked(hDlg, OPT_Mirror); EndDialog(hDlg, TRUE); return TRUE; @@ -2692,7 +2716,7 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER)); Translate(hDlg, DLG_TimeControl); /* Initialize the dialog items */ - if (appData.clockMode && !appData.icsActive) { + if (/*appData.clockMode &&*/ !appData.icsActive) { // [HGM] even if !clockMode, we could want to set it in tournament dialog if (searchTime) { CheckRadioButton(hDlg, OPT_TCUseMoves, OPT_TCUseFixed, OPT_TCUseFixed);