From 67ed2259fa455038b777db96482363a9dff7af84 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 23 Aug 2010 13:07:40 +0200 Subject: [PATCH] Make the ID of all WB dialog items unique Mnany static dialog texts did share the ID -1 (IDC_STATIC). But to replace tet at run-time for translation purposes, they need to be addressed individually. So they were given new IDs, with symbols defined for those. --- winboard/resource.h | 57 ++++++++++++++++++++++++ winboard/winboard.rc | 116 +++++++++++++++++++++++++------------------------- 2 files changed, 115 insertions(+), 58 deletions(-) diff --git a/winboard/resource.h b/winboard/resource.h index d536ee6..9dc8528 100644 --- a/winboard/resource.h +++ b/winboard/resource.h @@ -530,6 +530,63 @@ #define IDM_Engine1Options 1890 #define IDM_Engine2Options 1891 #define IDC_STATIC -1 +// static strings that were made dynamic to allow run-time translation +#define IDC_Babble 1900 +#define GPB_Factors 1901 +#define IDC_Factor1 1902 +#define IDC_Factor2 1903 +#define IDC_Directories 1904 +#define IDC_IndexNr 1905 +#define IDC_Port 1906 +#define IDC_Rate 1907 +#define IDC_Bits 1908 +#define IDC_Parity 1909 +#define IDC_Stop 1910 +#define IDC_Flow 1911 +#define IDC_ChessBoard 1912 +#define IDC_Welcome 1913 +#define IDC_Index 1914 +#define IDC_Event 1915 +#define IDC_Sec 1916 +#define IDC_Boxes 1917 +#define GPB_Premove 1918 +#define GPB_General 1919 +#define GPB_Colors 1920 +#define GPB_Alarm 1921 +#define IDC_Light 1922 +#define IDC_Dark 1923 +#define IDC_White 1924 +#define IDC_Black 1925 +#define IDC_High 1926 +#define IDC_PreHigh 1927 +#define GPB_Size 1928 +#define IDC_Height 1929 +#define IDC_Width 1930 +#define IDC_Hand 1931 +#define IDC_Pieces 1932 +#define IDC_Def 1933 +#define GPB_Board 1934 +#define GPB_Current 1935 +#define GPB_All 1936 +#define IDC_Partner 1937 +#define IDC_Draw 1938 +#define IDC_Threshold 1939 +#define IDC_Moves 1940 +#define IDC_Centi 1941 +#define IDC_Rule 1942 +#define IDC_Repeats 1943 +#define GPB_Adjudications 1944 +#define GPB_Apply 1945 +#define IDC_PolyDir 1946 +#define IDC_Hash 1947 +#define IDC_Path 1948 +#define IDC_Cache 1949 +#define IDC_CPU 1950 +#define IDC_Depth 1951 +#define IDC_Variation 1952 +#define IDC_DefGames 1953 +#define GPB_Variant 1954 + // Next default values for new objects // diff --git a/winboard/winboard.rc b/winboard/winboard.rc index dadb7b8..497f674 100644 --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@ -60,7 +60,7 @@ CAPTION "Time Control" FONT 8, "MS Sans Serif" BEGIN LTEXT "Use arrow keys to specify which clock setting type, then press tab to alter values.", - IDC_STATIC,9,9,231,20 + IDC_Babble,9,9,231,20 CONTROL "Conventional chess clock",OPT_TCUseMoves,"Button", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,36,113,10 CONTROL "Incremental clock",OPT_TCUseInc,"Button", @@ -72,21 +72,21 @@ BEGIN LTEXT "Within number of minutes:",OPT_TCtext2,113,54,81,8,NOT WS_GROUP EDITTEXT OPT_TCTime,197,52,32,12,ES_AUTOHSCROLL - LTEXT "Initial number of minutes:",405,15,89,106,8,NOT + LTEXT "Initial number of minutes:",OPT_TCitext1,15,89,106,8,NOT WS_GROUP EDITTEXT OPT_TCTime2,127,87,32,12,ES_AUTOHSCROLL | WS_GROUP - LTEXT "Plus number of seconds per move:",406,15,105,109,8,NOT + LTEXT "Plus number of seconds per move:",OPT_TCitext2,15,105,109,8,NOT WS_GROUP EDITTEXT OPT_TCInc,127,103,32,12,ES_AUTOHSCROLL LTEXT "Maximum seconds per move:",OPT_TCftext,15,142,109,8,NOT WS_GROUP EDITTEXT OPT_TCFixed,127,140,32,12,ES_AUTOHSCROLL - LTEXT "",408,185,148,67,8,NOT WS_GROUP - LTEXT "Time-Odds Factors:",IDC_STATIC,6,158,150,8,NOT WS_GROUP + LTEXT "",OPT_TCitext3,185,148,67,8,NOT WS_GROUP + LTEXT "Time-Odds Factors:",GPB_Factors,6,158,150,8,NOT WS_GROUP EDITTEXT OPT_TCOdds1,47,171,32,12,ES_AUTOHSCROLL | WS_GROUP - LTEXT "Engine #1:",IDC_STATIC,6,173,40,8,NOT WS_GROUP + LTEXT "Engine #1:",IDC_Factor1,6,173,40,8,NOT WS_GROUP EDITTEXT OPT_TCOdds2,127,171,32,12,ES_AUTOHSCROLL - LTEXT "Engine #2:",IDC_STATIC,86,173,40,8,NOT WS_GROUP + LTEXT "Engine #2:",IDC_Factor2,86,173,40,8,NOT WS_GROUP PUSHBUTTON "OK",IDOK,29,190,40,14,WS_GROUP PUSHBUTTON "Cancel",IDCANCEL,85,190,40,14 END @@ -137,7 +137,7 @@ BEGIN LISTBOX 1120,6,32,90,68,LBS_SORT | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP - LTEXT "&Directories:",-1,110,6,92,9 + LTEXT "&Directories:",IDC_Directories,110,6,92,9 LTEXT "",1088,110,18,92,9,SS_NOPREFIX | NOT WS_GROUP LISTBOX 1121,110,32,92,68,LBS_SORT | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL | @@ -152,7 +152,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,208,6,50,14,WS_GROUP PUSHBUTTON "Cancel",IDCANCEL,208,24,50,14,WS_GROUP PUSHBUTTON "&Help",1038,208,46,50,14,NOT WS_VISIBLE | WS_GROUP - LTEXT "&Index number:",-1,208,74,48,8 + LTEXT "&Index number:",IDC_IndexNr,208,74,48,8 EDITTEXT OPT_IndexNumberOld,208,84,50,12,ES_AUTOHSCROLL PUSHBUTTON "Net&work...",1037,208,113,50,14,WS_GROUP END @@ -164,22 +164,22 @@ FONT 8, "Helv" BEGIN PUSHBUTTON "OK",IDOK,106,60,50,14 PUSHBUTTON "Cancel",IDCANCEL,164,60,50,14 - RTEXT "&Port:",-1,4,6,40,10 + RTEXT "&Port:",IDC_Port,4,6,40,10 COMBOBOX OPT_Port,49,4,55,60,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - RTEXT "Data &Rate:",-1,114,6,40,10,NOT WS_GROUP + RTEXT "Data &Rate:",IDC_Rate,114,6,40,10,NOT WS_GROUP COMBOBOX OPT_DataRate,159,4,55,100,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - RTEXT "Data &Bits:",-1,4,25,40,10,NOT WS_GROUP + RTEXT "Data &Bits:",IDC_Bits,4,25,40,10,NOT WS_GROUP COMBOBOX OPT_Bits,49,22,55,60,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - RTEXT "P&arity:",-1,114,24,40,10,NOT WS_GROUP + RTEXT "P&arity:",IDC_Parity,114,24,40,10,NOT WS_GROUP COMBOBOX OPT_Parity,159,22,55,60,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - RTEXT "&Stop Bits:",-1,4,42,40,10,NOT WS_GROUP + RTEXT "&Stop Bits:",IDC_Stop,4,42,40,10,NOT WS_GROUP COMBOBOX OPT_StopBits,49,40,55,60,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - RTEXT "F&low:",-1,114,42,40,10,NOT WS_GROUP + RTEXT "F&low:",IDC_Flow,114,42,40,10,NOT WS_GROUP COMBOBOX OPT_Flow,159,40,55,60,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Help",OPT_SerialHelp,4,60,50,14,NOT WS_VISIBLE @@ -222,7 +222,7 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About WinBoard" FONT 8, "MS Sans Serif" BEGIN - RTEXT "Chessboard for Windows",DLG_TimeControl,196,154,80,8 + RTEXT "Chessboard for Windows",IDC_ChessBoard,196,154,80,8 LTEXT "Copyright 1991 Digital Equipment Corporation",201,4,168, 151,8 LTEXT "Enhancements Copyright 1992-2003 Free Software Foundation", @@ -339,7 +339,7 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "WinBoard Startup" FONT 8, "MS Sans Serif" BEGIN - GROUPBOX "What would you like to do?",IDC_STATIC,4,4,211,56 + GROUPBOX "What would you like to do?",IDC_Welcome,4,4,211,56 CONTROL "&Play against a chess engine or match two engines", OPT_ChessEngine,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,8,17,193,10 @@ -369,7 +369,7 @@ DLG_IndexNumber DIALOG DISCARDABLE 0, 0, 236, 18 STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS FONT 8, "MS Sans Serif" BEGIN - LTEXT "Inde&x number:",IDC_STATIC,5,2,46,8 + LTEXT "Inde&x number:",IDC_Index,5,2,46,8 EDITTEXT OPT_IndexNumber,54,0,155,13,ES_AUTOHSCROLL END @@ -398,7 +398,7 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Sounds" FONT 8, "MS Sans Serif" BEGIN - LTEXT "&Event:",IDC_STATIC,4,7,26,9 + LTEXT "&Event:",IDC_Event,4,7,26,9 COMBOBOX CBO_Sounds,30,4,208,110,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP // GROUPBOX "sound type",IDC_STATIC,8,18,66,62 @@ -515,7 +515,7 @@ BEGIN CONTROL "&Sound alarm at",OPT_IcsAlarm,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,160,85,63,10 EDITTEXT OPT_IcsAlarmTime,236,81,26,14,ES_AUTOHSCROLL - LTEXT "seconds",IDC_STATIC,264,85,28,8 + LTEXT "seconds",IDC_Sec,264,85,28,8 PUSHBUTTON "Choose...",OPT_ChooseShoutColor,97,114,45,15 PUSHBUTTON "Choose...",OPT_ChooseSShoutColor,97,134,45,15 PUSHBUTTON "Choose...",OPT_ChooseChannel1Color,97,154,45,15 @@ -559,12 +559,12 @@ BEGIN CONTROL "",OPT_SampleNormal,"RICHEDIT",ES_CENTER | ES_MULTILINE | ES_READONLY | WS_DISABLED | WS_GROUP,159,194,75,15, WS_EX_CLIENTEDGE - LTEXT "Startup &Chat Boxes:",IDC_STATIC,4,251,65,8 + LTEXT "Startup &Chat Boxes:",IDC_Boxes,4,251,65,8 EDITTEXT OPT_StartupChatBoxes,72,249,90,14,ES_AUTOHSCROLL - GROUPBOX "Interaction Colors",IDC_STATIC,4,103,294,140 - GROUPBOX "Premove",IDC_STATIC,154,0,144,69 - GROUPBOX "General",IDC_STATIC,4,0,146,101 - GROUPBOX "Alarm",IDC_STATIC,154,71,144,30 + GROUPBOX "Interaction Colors",GPB_Colors,4,103,294,140 + GROUPBOX "Premove",GPB_Premove,154,0,144,69 + GROUPBOX "General",GPB_General,4,0,146,101 + GROUPBOX "Alarm",GPB_Alarm,154,71,144,30 END DLG_BoardOptions DIALOG DISCARDABLE 0, 0, 194, 250 @@ -636,13 +636,13 @@ BEGIN GROUPBOX "Colors",IDC_STATIC,4,84,185,142 EDITTEXT OPT_PremoveHighlightColor,80,184,25,15,ES_READONLY | WS_DISABLED | NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "Light Squares",IDC_STATIC,10,98,60,10 - LTEXT "Dark Squares",IDC_STATIC,10,116,60,10 - LTEXT "White Pieces",IDC_STATIC,10,134,60,10 - LTEXT "Black Pieces",IDC_STATIC,10,152,60,10 - LTEXT "Square Highlights",IDC_STATIC,10,170,60,10 - LTEXT "Premove Highlights",IDC_STATIC,10,188,70,10 - GROUPBOX "Size",IDC_STATIC,4,4,185,75 + LTEXT "Light Squares",IDC_Light,10,98,60,10 + LTEXT "Dark Squares",IDC_Dark,10,116,60,10 + LTEXT "White Pieces",IDC_White,10,134,60,10 + LTEXT "Black Pieces",IDC_Black,10,152,60,10 + LTEXT "Square Highlights",IDC_High,10,170,60,10 + LTEXT "Premove Highlights",IDC_PreHigh,10,188,70,10 + GROUPBOX "Size",GPB_Size,4,4,185,75 EDITTEXT OPT_SampleLightSquare,144,96,39,36,ES_READONLY | WS_DISABLED | NOT WS_BORDER | NOT WS_TABSTOP EDITTEXT OPT_SampleDarkSquare,144,138,39,36,ES_READONLY | @@ -714,16 +714,16 @@ BEGIN 84,50,10 CONTROL "&xiangqi",OPT_VariantXiangqi,"Button",BS_AUTORADIOBUTTON,134,94,50, 10 - GROUPBOX "Variant",IDC_STATIC,4,4,185,115 - LTEXT "Board size:",IDC_STATIC,10,135,40,8 + GROUPBOX "Variant",GPB_Variant,4,4,185,115 + LTEXT "Board size:",GPB_Board,10,135,40,8 EDITTEXT IDC_Ranks,60,131,14,14,ES_AUTOHSCROLL - LTEXT "ranks",IDC_STATIC,77,135,22,8 + LTEXT "ranks",IDC_Height,77,135,22,8 EDITTEXT IDC_Files,116,131,14,14,ES_AUTOHSCROLL - LTEXT "files",IDC_STATIC,133,135,37,8 - LTEXT "Holdings with room for:",IDC_STATIC,10,153,90,8 + LTEXT "files",IDC_Width,133,135,37,8 + LTEXT "Holdings with room for:",IDC_Hand,10,153,90,8 EDITTEXT IDC_Holdings,93,149,14,14,ES_AUTOHSCROLL - LTEXT "pieces",IDC_STATIC,110,153,22,8 - LTEXT "('-1' means defaults for selected variant)",IDC_STATIC,10,171,150,8 + LTEXT "pieces",IDC_Pieces,110,153,22,8 + LTEXT "('-1' means defaults for selected variant)",IDC_Def,10,171,150,8 END DLG_Fonts DIALOG DISCARDABLE 0, 0, 266, 226 @@ -760,8 +760,8 @@ BEGIN WS_DISABLED | WS_BORDER,67,11,140,20 CONTROL "",OPT_SampleMessageFont,"RICHEDIT",ES_READONLY | WS_DISABLED | WS_BORDER,67,35,140,20 - GROUPBOX "Current Board Size",IDC_STATIC,3,1,259,83 - GROUPBOX "All Board Sizes",IDC_STATIC,3,87,259,109 + GROUPBOX "Current Board Size",GPB_Current,3,1,259,83 + GROUPBOX "All Board Sizes",GPB_All,3,87,259,109 CONTROL "",OPT_SampleMoveHistoryFont,"RICHEDIT",ES_READONLY | WS_DISABLED | WS_BORDER,67,170,140,20 LTEXT "Move History, Engine Output",OPT_MessageFont6,13,171,50,20,NOT @@ -845,7 +845,7 @@ EXSTYLE WS_EX_TOOLWINDOW CAPTION "Chat Window" FONT 8, "MS Sans Serif" BEGIN - LTEXT "Chat partner:",IDC_STATIC,5,5,45,10 + LTEXT "Chat partner:",IDC_Partner,5,5,45,10 EDITTEXT IDC_ChatPartner,50,3,45,13,ES_AUTOHSCROLL PUSHBUTTON "",IDC_Focus1,100,3,30,13 PUSHBUTTON "",IDC_Focus2,133,3,30,13 @@ -876,14 +876,14 @@ BEGIN CONTROL "Periodic Updates (for Analysis Mode)", IDC_EpPeriodicUpdates,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,40,131,10 - GROUPBOX "Adjudications in non-ICS games",IDC_STATIC,4,56,200,98 - LTEXT "Adjudicate draw after:",IDC_STATIC,10,72,70,8 + GROUPBOX "Adjudications in non-ICS games",GPB_Adjudications,4,56,200,98 + LTEXT "Adjudicate draw after:",IDC_Draw,10,72,70,8 EDITTEXT IDC_EpDrawMoveCount,116,68,40,14,ES_AUTOHSCROLL - LTEXT "moves",IDC_STATIC,158,72,22,8 - LTEXT "Win/loss adjudication threshold:",IDC_STATIC,10,90,102, + LTEXT "moves",IDC_Moves,158,72,22,8 + LTEXT "Win/loss adjudication threshold:",IDC_Threshold,10,90,102, 8 EDITTEXT IDC_EpAdjudicationThreshold,116,86,40,14,ES_AUTOHSCROLL - LTEXT "centipawns",IDC_STATIC,158,90,37,8 + LTEXT "centipawns",IDC_Centi,158,90,37,8 CONTROL "&Verify Engine Claims",IDC_TestClaims,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,108,100,10 CONTROL "Detect &Mates", @@ -895,11 +895,11 @@ BEGIN CONTROL "Adjudicate &Trivial Draws", IDC_TrivialDraws,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,138,100,10 - GROUPBOX "Apply",IDC_STATIC,115,102,81,47 + GROUPBOX "Apply",GPB_Apply,115,102,81,47 EDITTEXT IDC_RuleMoves,120,113,20,14,ES_AUTOHSCROLL - LTEXT "-move rule",IDC_STATIC,142,117,35,8 + LTEXT "-move rule",IDC_Rule,142,117,35,8 EDITTEXT IDC_DrawRepeats,120,130,20,14,ES_AUTOHSCROLL - LTEXT "-fold repeats",IDC_STATIC,142,134,50,8 + LTEXT "-fold repeats",IDC_Repeats,142,134,50,8 CONTROL "Engine #1 Score is Absolute", IDC_ScoreAbs1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,156,120,10 @@ -915,31 +915,31 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Common Engine Settings" FONT 8, "MS Sans Serif" BEGIN - LTEXT "Polyglot Directory:",IDC_STATIC,2,8,58,8 + LTEXT "Polyglot Directory:",IDC_PolyDir,2,8,58,8 EDITTEXT IDC_PolyglotDir,62,4,140,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BrowseForPolyglotDir,206,4,17,14 - LTEXT "Hash Size (MB):",IDC_STATIC,2,26,52,8 + LTEXT "Hash Size (MB):",IDC_Hash,2,26,52,8 EDITTEXT IDC_HashSize,62,22,40,14,ES_AUTOHSCROLL - LTEXT "EGTB Path:",IDC_STATIC,2,44,39,8 + LTEXT "EGTB Path:",IDC_Path,2,44,39,8 EDITTEXT IDC_PathToEGTB,62,40,140,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BrowseForEGTB,206,40,17,14 - LTEXT "EGTB Size (MB):",IDC_STATIC,2,62,54,8 + LTEXT "EGTB Size (MB):",IDC_Cache,2,62,54,8 EDITTEXT IDC_SizeOfEGTB,62,58,40,14,ES_AUTOHSCROLL CONTROL "Use Book:",IDC_UseBook,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,2,80,49,10 EDITTEXT IDC_BookFile,62,76,140,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BrowseForBook,206,76,17,14 - LTEXT "Max nr of CPUs:",IDC_STATIC,106,26,52,8 + LTEXT "Max nr of CPUs:",IDC_CPU,106,26,52,8 EDITTEXT IDC_Cores,162,22,40,14,ES_AUTOHSCROLL CONTROL "First has Own Book",IDC_OwnBook1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,2,94,100,10 CONTROL "Second has Own Book",IDC_OwnBook2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,2,107,100,10 - LTEXT "Book Depth:",IDC_STATIC,106,98,52,8 + LTEXT "Book Depth:",IDC_Depth,106,98,52,8 EDITTEXT IDC_BookDep,162,94,40,14,ES_AUTOHSCROLL - LTEXT "Book Variation:",IDC_STATIC,106,116,52,8 + LTEXT "Book Variation:",IDC_Variation,106,116,52,8 EDITTEXT IDC_BookStr,162,112,40,14,ES_AUTOHSCROLL - LTEXT "Default Match Games:",IDC_STATIC,2,135,72,8 + LTEXT "Default Match Games:",IDC_DefGames,2,135,72,8 EDITTEXT IDC_Games,76,131,28,14,ES_AUTOHSCROLL DEFPUSHBUTTON "OK",IDOK,118,142,50,14 PUSHBUTTON "Cancel",IDCANCEL,174,142,50,14 -- 1.7.0.4