0x0000, 0x0000, L"Engine #1 Settings ", 8, L"MS Sans Serif"\r
};\r
\r
+char *\r
+AddCR(char *s)\r
+{\r
+ char *p=s, *q;\r
+ int n=0;\r
+ while(p = strchr(p, '\n')) p++, n++; // count linefeeds\r
+ p = q = malloc(strlen(s) + n + 1);\r
+ while(*p++ = *s++) if(p[-1] == '\n') p[-1] = '\r', *p++ = '\n';\r
+ return q;\r
+}\r
+\r
void\r
SetOptionValues(HWND hDlg, ChessProgramState *cps, Option *optionList)\r
// Put all current option values in controls, and write option names next to them\r
case TextBox:\r
case FileName:\r
case PathName:\r
- SetDlgItemText( hDlg, 2001+2*i, cps ? optionList[j].textValue : *(char**)optionList[j].target );\r
+ name = AddCR(cps ? optionList[j].textValue : *(char**)optionList[j].target); // stupid CR...\r
+ SetDlgItemText( hDlg, 2001+2*i, name);\r
+ free(name);\r
break;\r
case CheckBox:\r
CheckDlgButton( hDlg, 2000+2*i, (cps ? optionList[j].value : *(Boolean*)optionList[j].target) != 0);\r
AddControl(x, y+1, 95, 9, 0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD, i);\r
extra = 13*activeList[layoutList[i/2]].min;\r
AddControl(x+95, y, 200, 11+extra, 0x0081, ES_AUTOHSCROLL | WS_BORDER | WS_VISIBLE | WS_CHILD | WS_TABSTOP | \r
- (extra ? ES_MULTILINE | WS_VSCROLL :0), i+1);\r
+ (extra ? ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL :0), i+1);\r
break;\r
case Label:\r
extra = activeList[layoutList[i/2]].value;\r