X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/ca20bfcf9f32391ac683100cd3f1bfeb48083236..2c23c16ab03df465bfabe49ff396f5e65a8f09c0:/windlg.c diff --git a/windlg.c b/windlg.c index 026e35c2..77264386 100644 --- a/windlg.c +++ b/windlg.c @@ -259,6 +259,7 @@ enum { IDCX_ABOUT = IDC_LGFSTATIC, IDC_LGFEDIT, IDC_LGFBUTTON, + IDC_LGFEXPLAIN, IDC_LSTATXIST, IDC_LSTATXOVR, IDC_LSTATXAPN, @@ -470,6 +471,7 @@ enum { IDCX_ABOUT = IDC_MBSTATIC, IDC_MBWINDOWS, IDC_MBXTERM, + IDC_MOUSEOVERRIDE, IDC_CCSTATIC, IDC_CCLIST, IDC_CCSET, @@ -743,16 +745,13 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess) SendDlgItemMessage(hwnd, IDC_CIPHERLIST, LB_SETITEMDATA, pos, (LPARAM) c); } - SendDlgItemMessage(hwnd, IDC_CIPHERLIST, LB_ADDSTRING, - 0, (LPARAM) "FIXME1"); - SendDlgItemMessage(hwnd, IDC_CIPHERLIST, LB_ADDSTRING, - 0, (LPARAM) "FIXME2"); } CheckRadioButton(hwnd, IDC_MBWINDOWS, IDC_MBXTERM, cfg.mouse_is_xterm ? IDC_MBXTERM : IDC_MBWINDOWS); + CheckDlgButton(hwnd, IDC_MOUSEOVERRIDE, cfg.mouse_override); CheckDlgButton(hwnd, IDC_RAWCNP, cfg.rawcnp); { static int tabs[4] = { 25, 61, 96, 128 }; @@ -788,15 +787,13 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess) { int i; char *cp; - int index = 0; + strcpy(cfg.line_codepage, cp_name(decode_codepage(cfg.line_codepage))); SendDlgItemMessage(hwnd, IDC_CODEPAGE, CB_RESETCONTENT, 0, 0); for (i = 0; (cp = cp_enumerate(i)) != NULL; i++) { SendDlgItemMessage(hwnd, IDC_CODEPAGE, CB_ADDSTRING, 0, (LPARAM) cp); - if (!strcmp(cp, cfg.line_codepage)) - index = i; } - SendDlgItemMessage(hwnd, IDC_CODEPAGE, CB_SETCURSEL, index, 0); + SetDlgItemText(hwnd, IDC_CODEPAGE, cfg.line_codepage); } CheckRadioButton(hwnd, IDC_VTXWINDOWS, IDC_VTUNICODE, @@ -911,6 +908,8 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) editbutton(&cp, "Log &file name:", IDC_LGFSTATIC, IDC_LGFEDIT, "Bro&wse...", IDC_LGFBUTTON); + statictext(&cp, "(Log file name can contain &&Y, &&M, &&D for date," + " &&T for time, and &&H for host name)", 2, IDC_LGFEXPLAIN); radiobig(&cp, "What to do if the log file already &exists:", IDC_LSTATXIST, "Always overwrite it", IDC_LSTATXOVR, @@ -977,7 +976,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) IDC_BELLOVLTSTATIC, IDC_BELLOVLT, 20); statictext(&cp, "The bell is re-enabled after a few seconds of silence.", - IDC_BELLOVLEXPLAIN); + 1, IDC_BELLOVLEXPLAIN); staticedit(&cp, "Seconds of &silence required", IDC_BELLOVLSSTATIC, IDC_BELLOVLS, 20); endbox(&cp); @@ -1096,6 +1095,11 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling character set translation", IDC_TITLE_TRANSLATION); + beginbox(&cp, "Character set translation on received data", + IDC_BOX_TRANSLATION2); + combobox(&cp, "Received data assumed to be in which character set:", + IDC_CODEPAGESTATIC, IDC_CODEPAGE); + endbox(&cp); beginbox(&cp, "Adjust how PuTTY displays line drawing characters", IDC_BOX_TRANSLATION1); radiobig(&cp, @@ -1106,16 +1110,10 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) "&Poor man's line drawing (" "+" ", " "-" " and " "|" ")", IDC_VTPOORMAN, "&Unicode mode", IDC_VTUNICODE, NULL); endbox(&cp); - beginbox(&cp, "Character set translation on received data", - IDC_BOX_TRANSLATION2); - dropdownlist(&cp, - "Received data assumed to be in which character set:", - IDC_CODEPAGESTATIC, IDC_CODEPAGE); - endbox(&cp); } if (panel == selectionpanelstart) { - /* The Selection panel. Accelerators used: [acgo] d wx hst */ + /* The Selection panel. Accelerators used: [acgo] d wxp hst */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling copy and paste", @@ -1132,6 +1130,9 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) "&Windows (Right pastes, Middle extends)", IDC_MBWINDOWS, "&xterm (Right extends, Middle pastes)", IDC_MBXTERM, NULL); + checkbox(&cp, + "Shift overrides a&pplication's use of mouse", + IDC_MOUSEOVERRIDE); endbox(&cp); beginbox(&cp, "Control the select-one-word-at-a-time mode", IDC_BOX_SELECTION3); @@ -1486,6 +1487,9 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg, TVITEM item; int j; char buffer[64]; + + SendMessage (hwnd, WM_SETREDRAW, FALSE, 0); + item.hItem = i; item.pszText = buffer; item.cchTextMax = sizeof(buffer); @@ -1530,6 +1534,9 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg, create_controls(hwnd, dlgtype, translationpanelstart); init_dlg_ctrls(hwnd, FALSE); + + SendMessage (hwnd, WM_SETREDRAW, TRUE, 0); + InvalidateRect (hwnd, NULL, TRUE); SetFocus(((LPNMHDR) lParam)->hwndFrom); /* ensure focus stays */ return 0; @@ -2341,10 +2348,14 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg, break; case IDC_RAWCNP: cfg.rawcnp = IsDlgButtonChecked(hwnd, IDC_RAWCNP); + break; case IDC_MBWINDOWS: case IDC_MBXTERM: cfg.mouse_is_xterm = IsDlgButtonChecked(hwnd, IDC_MBXTERM); break; + case IDC_MOUSEOVERRIDE: + cfg.mouse_override = IsDlgButtonChecked(hwnd, IDC_MOUSEOVERRIDE); + break; case IDC_CCSET: { BOOL ok; @@ -2462,6 +2473,13 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg, CB_GETCURSEL, 0, 0); SendDlgItemMessage(hwnd, IDC_CODEPAGE, CB_GETLBTEXT, index, (LPARAM)cfg.line_codepage); + } else if (HIWORD(wParam) == CBN_EDITCHANGE) { + GetDlgItemText(hwnd, IDC_CODEPAGE, cfg.line_codepage, + sizeof(cfg.line_codepage) - 1); + } else if (HIWORD(wParam) == CBN_KILLFOCUS) { + strcpy(cfg.line_codepage, + cp_name(decode_codepage(cfg.line_codepage))); + SetDlgItemText(hwnd, IDC_CODEPAGE, cfg.line_codepage); } break; case IDC_VTXWINDOWS: