From 7570c887958cb7523dc6801bdeafff15acde5163 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 9 Jan 2012 21:23:52 +0100 Subject: [PATCH] Add control for overrideLineGap in WB Board dialog Make it a checkbox to choose between 0 and -1. --- winboard/language.txt | 3 +++ winboard/resource.h | 1 + winboard/winboard.c | 2 +- winboard/winboard.rc | 8 +++++--- winboard/woptions.c | 12 +++++++++++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/winboard/language.txt b/winboard/language.txt index fe60508..4e73334 100644 --- a/winboard/language.txt +++ b/winboard/language.txt @@ -460,6 +460,9 @@ BOARD OPTIONS "Monochrome" === "" "All White" === "" "Flip Black" === "" +"Use Board Textures" === "" +"Use Piece Font" === "" +"Suppress Grid" === "" "Size" === "" BOARD SIZES (translate as number?) diff --git a/winboard/resource.h b/winboard/resource.h index d59e60a..2b89b40 100644 --- a/winboard/resource.h +++ b/winboard/resource.h @@ -625,6 +625,7 @@ #define OPT_SamplePieceFont 1979 #define OPT_ChoosePieceFont 1980 #define OPT_GameListFind 1981 +#define OPT_Grid 1983 // Next default values for new objects diff --git a/winboard/winboard.c b/winboard/winboard.c index e3cd83b..b73f861 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -302,7 +302,7 @@ int dialogItems[][41 ] = { OPT_ChooseLightSquareColor, OPT_ChooseDarkSquareColor, OPT_ChooseWhitePieceColor, OPT_ChooseBlackPieceColor, OPT_ChooseHighlightSquareColor, OPT_ChoosePremoveHighlightColor, OPT_Monochrome, OPT_AllWhite, OPT_UpsideDown, OPT_DefaultBoardColors, GPB_Colors, - IDC_Light, IDC_Dark, IDC_White, IDC_Black, IDC_High, IDC_PreHigh, GPB_Size, OPT_Bitmaps, OPT_PieceFont }, + IDC_Light, IDC_Dark, IDC_White, IDC_Black, IDC_High, IDC_PreHigh, GPB_Size, OPT_Bitmaps, OPT_PieceFont, OPT_Grid }, { DLG_NewVariant, IDOK, IDCANCEL, OPT_VariantNormal, OPT_VariantFRC, OPT_VariantWildcastle, OPT_VariantNocastle, OPT_VariantLosers, OPT_VariantGiveaway, OPT_VariantSuicide, OPT_Variant3Check, OPT_VariantTwoKings, OPT_VariantAtomic, OPT_VariantCrazyhouse, diff --git a/winboard/winboard.rc b/winboard/winboard.rc index ebc8f94..7af13b3 100644 --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@ -649,6 +649,8 @@ BEGIN WS_TABSTOP,140,203,73,10 CONTROL "Use Piece Font",OPT_PieceFont,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,215,73,10 + CONTROL "Suppress Grid",OPT_Grid,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,140,227,73,10 PUSHBUTTON "Defaults",OPT_DefaultBoardColors,80,206,50,15 EDITTEXT OPT_DarkSquareColor,80,112,25,15,ES_READONLY | WS_DISABLED | NOT WS_BORDER | NOT WS_TABSTOP @@ -660,7 +662,7 @@ BEGIN WS_DISABLED | NOT WS_BORDER | NOT WS_TABSTOP EDITTEXT OPT_HighlightSquareColor,80,166,25,15,ES_READONLY | WS_DISABLED | NOT WS_BORDER | NOT WS_TABSTOP - GROUPBOX "Colors",GPB_Colors,4,84,215,142 + GROUPBOX "Colors",GPB_Colors,4,84,215,154 EDITTEXT OPT_PremoveHighlightColor,80,184,25,15,ES_READONLY | WS_DISABLED | NOT WS_BORDER | NOT WS_TABSTOP LTEXT "Light Squares",IDC_Light,10,98,60,10 @@ -674,8 +676,8 @@ BEGIN WS_DISABLED | NOT WS_BORDER | NOT WS_TABSTOP EDITTEXT OPT_SampleDarkSquare,144,138,39,36,ES_READONLY | WS_DISABLED | NOT WS_BORDER | NOT WS_TABSTOP - DEFPUSHBUTTON "OK",IDOK,84,232,50,14 - PUSHBUTTON "Cancel",IDCANCEL,140,232,50,14 + DEFPUSHBUTTON "OK",IDOK,84,244,50,14 + PUSHBUTTON "Cancel",IDCANCEL,140,244,50,14 END DLG_NewVariant DIALOG DISCARDABLE 0, 0, 224, 250 diff --git a/winboard/woptions.c b/winboard/woptions.c index 0b46be0..a11fe55 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -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; } -- 1.7.0.4