X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/0a3f1d48f7f8779690073685f057bc5705d61006..22dcdc3b1a1c7c820fabe3ebaae8be6b09b4408e:/windlg.c diff --git a/windlg.c b/windlg.c index 9b2e60fb..e6194699 100644 --- a/windlg.c +++ b/windlg.c @@ -168,6 +168,13 @@ static int CALLBACK AboutProc (HWND hwnd, UINT msg, EnableWindow(hwnd, 1); SetActiveWindow(hwnd); return 0; + + case IDA_WEB: + /* Load web browser */ + ShellExecute(hwnd, "open", + "http://www.chiark.greenend.org.uk/~sgtatham/putty/", + 0, 0, SW_SHOWDEFAULT); + return 0; } return 0; case WM_CLOSE: @@ -252,6 +259,7 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_CURNORMAL, IDC_CURAPPLIC, IDC_COMPOSEKEY, + IDC_CTRLALTKEYS, keyboardpanelend, terminalpanelstart, @@ -264,6 +272,8 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_BEEP, IDC_BCE, IDC_BLINKTEXT, + IDC_ANSWERBACK, + IDC_ANSWEREDIT, IDC_ECHOSTATIC, IDC_ECHOBACKEND, IDC_ECHOYES, @@ -385,6 +395,7 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_TITLE_SELECTION, IDC_BOX_SELECTION1, IDC_BOX_SELECTION2, + IDC_BOX_SELECTION3, IDC_MBSTATIC, IDC_MBWINDOWS, IDC_MBXTERM, @@ -393,6 +404,7 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_CCSET, IDC_CCSTATIC2, IDC_CCEDIT, + IDC_RAWCNP, selectionpanelend, colourspanelstart, @@ -467,9 +479,8 @@ static void fmtfont (char *buf) { if (cfg.fontheight == 0) strcat (buf, "default height"); else - sprintf (buf+strlen(buf), "%d-%s", - (cfg.fontheight < 0 ? -cfg.fontheight : cfg.fontheight), - (cfg.fontheight < 0 ? "pixel" : "point")); + sprintf (buf+strlen(buf), "%d-point", + (cfg.fontheight < 0 ? -cfg.fontheight : cfg.fontheight)); } static void init_dlg_ctrls(HWND hwnd) { @@ -516,12 +527,14 @@ static void init_dlg_ctrls(HWND hwnd) { CheckDlgButton (hwnd, IDC_ALTSPACE, cfg.alt_space); CheckDlgButton (hwnd, IDC_ALTONLY, cfg.alt_only); CheckDlgButton (hwnd, IDC_COMPOSEKEY, cfg.compose_key); + CheckDlgButton (hwnd, IDC_CTRLALTKEYS, cfg.ctrlaltkeys); CheckRadioButton (hwnd, IDC_ECHOBACKEND, IDC_ECHONO, cfg.localecho == LD_BACKEND ? IDC_ECHOBACKEND: cfg.localecho == LD_YES ? IDC_ECHOYES : IDC_ECHONO); CheckRadioButton (hwnd, IDC_EDITBACKEND, IDC_EDITNO, cfg.localedit == LD_BACKEND ? IDC_EDITBACKEND: cfg.localedit == LD_YES ? IDC_EDITYES : IDC_EDITNO); + SetDlgItemText (hwnd, IDC_ANSWEREDIT, cfg.answerback); CheckDlgButton (hwnd, IDC_ALWAYSONTOP, cfg.alwaysontop); CheckDlgButton (hwnd, IDC_SCROLLKEY, cfg.scroll_on_key); CheckDlgButton (hwnd, IDC_SCROLLDISP, cfg.scroll_on_disp); @@ -592,6 +605,7 @@ static void init_dlg_ctrls(HWND hwnd) { CheckRadioButton (hwnd, IDC_MBWINDOWS, IDC_MBXTERM, cfg.mouse_is_xterm ? IDC_MBXTERM : IDC_MBWINDOWS); + CheckDlgButton (hwnd, IDC_RAWCNP, cfg.rawcnp); { static int tabs[4] = {25, 61, 96, 128}; SendDlgItemMessage (hwnd, IDC_CCLIST, LB_SETTABSTOPS, 4, @@ -738,7 +752,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == terminalpanelstart) { - /* The Terminal panel. Accelerators used: [acgo] wdlben ht */ + /* The Terminal panel. Accelerators used: [acgo] wdlben hts */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling the terminal emulation", @@ -751,6 +765,9 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { checkbox(&cp, "&Beep enabled", IDC_BEEP); checkbox(&cp, "Use background colour to &erase screen", IDC_BCE); checkbox(&cp, "Enable bli&nking text", IDC_BLINKTEXT); + multiedit(&cp, + "An&swerback to ^E:", IDC_ANSWERBACK, + IDC_ANSWEREDIT, 100, NULL); endbox(&cp); beginbox(&cp, "Line discipline options", @@ -767,7 +784,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == keyboardpanelstart) { - /* The Keyboard panel. Accelerators used: [acgo] h?sr~lxv unpymie t */ + /* The Keyboard panel. Accelerators used: [acgo] h?sr~lxvunpymietd */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling the effects of keys", @@ -804,8 +821,10 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { endbox(&cp); beginbox(&cp, "Enable extra keyboard features:", IDC_BOX_KEYBOARD3); - checkbox(&cp, "Application and AltGr ac&t as Compose key", + checkbox(&cp, "AltGr ac&ts as Compose key", IDC_COMPOSEKEY); + checkbox(&cp, "Control-Alt is &different from AltGr", + IDC_CTRLALTKEYS); endbox(&cp); } @@ -907,20 +926,25 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == selectionpanelstart) { - /* The Selection panel. Accelerators used: [acgo] wx hst */ + /* The Selection panel. Accelerators used: [acgo] d wx hst */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling copy and paste", IDC_TITLE_SELECTION); - beginbox(&cp, "Control which mouse button does which thing", + beginbox(&cp, "Translation of pasted characters", IDC_BOX_SELECTION1); + checkbox(&cp, "&Don't translate line drawing chars into +, - and |", + IDC_RAWCNP); + endbox(&cp); + beginbox(&cp, "Control which mouse button does which thing", + IDC_BOX_SELECTION2); radiobig(&cp, "Action of mouse buttons:", IDC_MBSTATIC, "&Windows (Right pastes, Middle extends)", IDC_MBWINDOWS, "&xterm (Right extends, Middle pastes)", IDC_MBXTERM, NULL); endbox(&cp); beginbox(&cp, "Control the select-one-word-at-a-time mode", - IDC_BOX_SELECTION2); + IDC_BOX_SELECTION3); charclass(&cp, "C&haracter classes:", IDC_CCSTATIC, IDC_CCLIST, "&Set", IDC_CCSET, IDC_CCEDIT, "&to class", IDC_CCSTATIC2); @@ -1007,7 +1031,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == sshpanelstart) { - /* The SSH panel. Accelerators used: [acgo] rmfkw pe123bd i */ + /* The SSH panel. Accelerators used: [acgo] rmfkw pe123bds i */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); if (dlgtype == 0) { @@ -1037,7 +1061,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { "&3DES", IDC_CIPHER3DES, "&Blowfish", IDC_CIPHERBLOWF, "&DES", IDC_CIPHERDES, - "&AES", IDC_CIPHERAES, + "AE&S", IDC_CIPHERAES, NULL); checkbox(&cp, "&Imitate SSH 2 MAC bug in commercial <= v2.3.x", IDC_BUGGYMAC); @@ -1478,6 +1502,11 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, if (LOWORD(wParam)==IDC_EDITNO) cfg.localedit=LD_NO; } break; + case IDC_ANSWEREDIT: + if (HIWORD(wParam) == EN_CHANGE) + GetDlgItemText (hwnd, IDC_ANSWEREDIT, cfg.answerback, + sizeof(cfg.answerback)-1); + break; case IDC_ALWAYSONTOP: if (HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == BN_DOUBLECLICKED) @@ -1498,6 +1527,11 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, HIWORD(wParam) == BN_DOUBLECLICKED) cfg.compose_key = IsDlgButtonChecked (hwnd, IDC_COMPOSEKEY); break; + case IDC_CTRLALTKEYS: + if (HIWORD(wParam) == BN_CLICKED || + HIWORD(wParam) == BN_DOUBLECLICKED) + cfg.ctrlaltkeys = IsDlgButtonChecked (hwnd, IDC_CTRLALTKEYS); + break; case IDC_WRAPMODE: if (HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == BN_DOUBLECLICKED) @@ -1549,7 +1583,7 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, cfg.font[sizeof(cfg.font)-1] = '\0'; cfg.fontisbold = (lf.lfWeight == FW_BOLD); cfg.fontcharset = lf.lfCharSet; - cfg.fontheight = lf.lfHeight; + cfg.fontheight = cf.iPointSize / 10; fmtfont (fontstatic); SetDlgItemText (hwnd, IDC_FONTSTATIC, fontstatic); } @@ -1843,6 +1877,8 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, SetDlgItemText (hwnd, IDC_PKEDIT, cfg.keyfile); } break; + case IDC_RAWCNP: + cfg.rawcnp = IsDlgButtonChecked (hwnd, IDC_RAWCNP); case IDC_MBWINDOWS: case IDC_MBXTERM: cfg.mouse_is_xterm = IsDlgButtonChecked (hwnd, IDC_MBXTERM);