Implement writing RTF to the clipboard (off by default), so that if
[u/mdw/putty] / windlg.c
index 25b8445..21ed7a7 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -479,12 +479,16 @@ enum { IDCX_ABOUT =
     IDC_MBWINDOWS,
     IDC_MBXTERM,
     IDC_MOUSEOVERRIDE,
+    IDC_SELTYPESTATIC,
+    IDC_SELTYPELEX,
+    IDC_SELTYPERECT,
     IDC_CCSTATIC,
     IDC_CCLIST,
     IDC_CCSET,
     IDC_CCSTATIC2,
     IDC_CCEDIT,
     IDC_RAWCNP,
+    IDC_RTFPASTE,
     selectionpanelend,
 
     colourspanelstart,
@@ -763,11 +767,13 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
 
     }
 
-
     CheckRadioButton(hwnd, IDC_MBWINDOWS, IDC_MBXTERM,
                     cfg.mouse_is_xterm ? IDC_MBXTERM : IDC_MBWINDOWS);
+    CheckRadioButton(hwnd, IDC_SELTYPELEX, IDC_SELTYPERECT,
+                    cfg.rect_select == 0 ? IDC_SELTYPELEX : IDC_SELTYPERECT);
     CheckDlgButton(hwnd, IDC_MOUSEOVERRIDE, cfg.mouse_override);
     CheckDlgButton(hwnd, IDC_RAWCNP, cfg.rawcnp);
+    CheckDlgButton(hwnd, IDC_RTFPASTE, cfg.rtf_paste);
     {
        static int tabs[4] = { 25, 61, 96, 128 };
        SendDlgItemMessage(hwnd, IDC_CCLIST, LB_SETTABSTOPS, 4,
@@ -1042,7 +1048,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
     }
 
     if (panel == windowpanelstart) {
-       /* The Window panel. Accelerators used: [acgo] rmz sdikp w4ylt f */
+       /* The Window panel. Accelerators used: [acgo] rmznb sdikp w4ylt f */
        struct ctlpos cp;
        ctlposinit(&cp, hwnd, 80, 3, 13);
        bartitle(&cp, "Options controlling PuTTY's window",
@@ -1054,7 +1060,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
        radioline(&cp, "Action when the window is resized:", IDC_RESIZESTATIC,
                  3, "Resi&ze terminal", IDC_RESIZETERM,
                  "Change fo&nt", IDC_RESIZEFONT,
-                 "Forb&id resizing", IDC_RESIZENONE, NULL);
+                 "For&bid resizing", IDC_RESIZENONE, NULL);
        endbox(&cp);
        beginbox(&cp, "Control the scrollback in the window",
                 IDC_BOX_WINDOW2);
@@ -1141,7 +1147,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
     }
 
     if (panel == selectionpanelstart) {
-       /* The Selection panel. Accelerators used: [acgo] d wxp hst */
+       /* The Selection panel. Accelerators used: [acgo] df wxp hst nr */
        struct ctlpos cp;
        ctlposinit(&cp, hwnd, 80, 3, 13);
        bartitle(&cp, "Options controlling copy and paste",
@@ -1151,6 +1157,9 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
        checkbox(&cp,
                 "&Don't translate line drawing chars into +, - and |",
                 IDC_RAWCNP);
+       checkbox(&cp,
+                "Paste to clipboard in RT&F as well as plain text",
+                IDC_RTFPASTE);
        endbox(&cp);
        beginbox(&cp, "Control which mouse button does which thing",
                 IDC_BOX_SELECTION2);
@@ -1161,6 +1170,11 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
        checkbox(&cp,
                 "Shift overrides a&pplication's use of mouse",
                 IDC_MOUSEOVERRIDE);
+        radioline(&cp,
+                  "Default selection mode (Alt+drag does the other one):",
+                  IDC_SELTYPESTATIC, 2,
+                 "&Normal", IDC_SELTYPELEX,
+                 "&Rectangular block", IDC_SELTYPERECT, NULL);
        endbox(&cp);
        beginbox(&cp, "Control the select-one-word-at-a-time mode",
                 IDC_BOX_SELECTION3);
@@ -2403,10 +2417,17 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
              case IDC_RAWCNP:
                cfg.rawcnp = IsDlgButtonChecked(hwnd, IDC_RAWCNP);
                break;
+             case IDC_RTFPASTE:
+               cfg.rtf_paste = IsDlgButtonChecked(hwnd, IDC_RTFPASTE);
+               break;
              case IDC_MBWINDOWS:
              case IDC_MBXTERM:
                cfg.mouse_is_xterm = IsDlgButtonChecked(hwnd, IDC_MBXTERM);
                break;
+             case IDC_SELTYPELEX:
+             case IDC_SELTYPERECT:
+               cfg.rect_select = IsDlgButtonChecked(hwnd, IDC_SELTYPERECT);
+               break;
              case IDC_MOUSEOVERRIDE:
                cfg.mouse_override = IsDlgButtonChecked(hwnd, IDC_MOUSEOVERRIDE);
                break;