Reintroduce Cyrillic Caps Lock mode, which was in 0.51 but got
[u/mdw/putty] / windlg.c
index f15e385..d8f1e03 100644 (file)
--- 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,
@@ -354,6 +355,7 @@ enum { IDCX_ABOUT =
     IDC_COLSSTATIC,
     IDC_COLSEDIT,
     IDC_LOCKSIZE,
+    IDC_LOCKFONT,
     IDC_SCROLLBAR,
     IDC_CLOSEWARN,
     IDC_SAVESTATIC,
@@ -364,6 +366,7 @@ enum { IDCX_ABOUT =
     IDC_SCROLLKEY,
     IDC_SCROLLDISP,
     IDC_ALWAYSONTOP,
+    IDC_FULLSCREENONALTENTER,
     windowpanelend,
 
     appearancepanelstart,
@@ -385,6 +388,8 @@ enum { IDCX_ABOUT =
     IDC_WINNAME,
     IDC_HIDEMOUSE,
     IDC_SUNKENEDGE,
+    IDC_WINBSTATIC,
+    IDC_WINBEDIT,
     appearancepanelend,
 
     connectionpanelstart,
@@ -500,8 +505,10 @@ enum { IDCX_ABOUT =
     IDC_TITLE_TRANSLATION,
     IDC_BOX_TRANSLATION1,
     IDC_BOX_TRANSLATION2,
+    IDC_BOX_TRANSLATION3,
     IDC_CODEPAGESTATIC,
     IDC_CODEPAGE,
+    IDC_CAPSLOCKCYR,
     IDC_VTSTATIC,
     IDC_VTXWINDOWS,
     IDC_VTOEMANSI,
@@ -624,6 +631,7 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
                     cfg.localedit == LD_YES ? IDC_EDITYES : IDC_EDITNO);
     SetDlgItemText(hwnd, IDC_ANSWEREDIT, cfg.answerback);
     CheckDlgButton(hwnd, IDC_ALWAYSONTOP, cfg.alwaysontop);
+    CheckDlgButton(hwnd, IDC_FULLSCREENONALTENTER, cfg.fullscreenonaltenter);
     CheckDlgButton(hwnd, IDC_SCROLLKEY, cfg.scroll_on_key);
     CheckDlgButton(hwnd, IDC_SCROLLDISP, cfg.scroll_on_disp);
 
@@ -659,12 +667,14 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
     CheckDlgButton(hwnd, IDC_WINNAME, cfg.win_name_always);
     CheckDlgButton(hwnd, IDC_HIDEMOUSE, cfg.hide_mouseptr);
     CheckDlgButton(hwnd, IDC_SUNKENEDGE, cfg.sunken_edge);
+    SetDlgItemInt(hwnd, IDC_WINBEDIT, cfg.window_border, FALSE);
     CheckRadioButton(hwnd, IDC_CURBLOCK, IDC_CURVERT,
                     cfg.cursor_type == 0 ? IDC_CURBLOCK :
                     cfg.cursor_type == 1 ? IDC_CURUNDER : IDC_CURVERT);
     CheckDlgButton(hwnd, IDC_BLINKCUR, cfg.blink_cur);
     CheckDlgButton(hwnd, IDC_SCROLLBAR, cfg.scrollbar);
     CheckDlgButton(hwnd, IDC_LOCKSIZE, cfg.locksize);
+    CheckDlgButton(hwnd, IDC_LOCKFONT, cfg.lockfont);
     CheckRadioButton(hwnd, IDC_COEALWAYS, IDC_COENORMAL,
                     cfg.close_on_exit == COE_NORMAL ? IDC_COENORMAL :
                     cfg.close_on_exit ==
@@ -788,6 +798,7 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
        char *cp;
        strcpy(cfg.line_codepage, cp_name(decode_codepage(cfg.line_codepage)));
        SendDlgItemMessage(hwnd, IDC_CODEPAGE, CB_RESETCONTENT, 0, 0);
+       CheckDlgButton (hwnd, IDC_CAPSLOCKCYR, cfg.xlat_capslockcyr);
        for (i = 0; (cp = cp_enumerate(i)) != NULL; i++) {
            SendDlgItemMessage(hwnd, IDC_CODEPAGE, CB_ADDSTRING,
                               0, (LPARAM) cp);
@@ -907,6 +918,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,
@@ -973,7 +986,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);
@@ -1023,7 +1036,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
     }
 
     if (panel == windowpanelstart) {
-       /* The Window panel. Accelerators used: [acgo] rmz sdkp w4ylt */
+       /* The Window panel. Accelerators used: [acgo] rmz sdkp w4ylt */
        struct ctlpos cp;
        ctlposinit(&cp, hwnd, 80, 3, 13);
        bartitle(&cp, "Options controlling PuTTY's window",
@@ -1032,7 +1045,8 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
        multiedit(&cp,
                  "&Rows", IDC_ROWSSTATIC, IDC_ROWSEDIT, 50,
                  "Colu&mns", IDC_COLSSTATIC, IDC_COLSEDIT, 50, NULL);
-       checkbox(&cp, "Lock window size against resi&zing", IDC_LOCKSIZE);
+       checkbox(&cp, "Lock terminal size against resi&zing", IDC_LOCKSIZE);
+       checkbox(&cp, "Lock font size against resi&zing", IDC_LOCKFONT);
        endbox(&cp);
        beginbox(&cp, "Control the scrollback in the window",
                 IDC_BOX_WINDOW2);
@@ -1049,6 +1063,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
        checkbox(&cp, "S&ystem menu appears on ALT-Space", IDC_ALTSPACE);
        checkbox(&cp, "System menu appears on A&LT alone", IDC_ALTONLY);
        checkbox(&cp, "Ensure window is always on &top", IDC_ALWAYSONTOP);
+       checkbox(&cp, "&Full screen on Alt-Enter", IDC_FULLSCREENONALTENTER);
        endbox(&cp);
     }
 
@@ -1056,8 +1071,8 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
        /* The Appearance panel. Accelerators used: [acgo] luvb h ti p s */
        struct ctlpos cp;
        ctlposinit(&cp, hwnd, 80, 3, 13);
-       bartitle(&cp, "Options controlling PuTTY's appearance",
-                IDC_TITLE_APPEARANCE);
+       /* bartitle(&cp, "Options controlling PuTTY's appearance",
+                IDC_TITLE_APPEARANCE); */
        beginbox(&cp, "Adjust the use of the cursor", IDC_BOX_APPEARANCE1);
        radioline(&cp, "Cursor appearance:", IDC_CURSORSTATIC, 3,
                  "B&lock", IDC_CURBLOCK,
@@ -1083,22 +1098,29 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
        beginbox(&cp, "Adjust the window border", IDC_BOX_APPEARANCE5);
        checkbox(&cp, "&Sunken-edge border (slightly thicker)",
                 IDC_SUNKENEDGE);
+       staticedit(&cp, "Gap between text and window edge",
+                  IDC_WINBSTATIC, IDC_WINBEDIT, 20);
        endbox(&cp);
     }
 
     if (panel == translationpanelstart) {
-       /* The Translation panel. Accelerators used: [acgo] xbep t s */
+       /* The Translation panel. Accelerators used: [acgo] rxbepus */
        struct ctlpos cp;
        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_BOX_TRANSLATION1);
+       combobox(&cp, "&Received data assumed to be in which character set:",
                 IDC_CODEPAGESTATIC, IDC_CODEPAGE);
        endbox(&cp);
+        beginbox(&cp, "Enable character set translation on input data",
+                 IDC_BOX_TRANSLATION2);
+        checkbox(&cp, "CAP&S LOCK acts as cyrillic switch",
+                 IDC_CAPSLOCKCYR);
+        endbox(&cp);
        beginbox(&cp, "Adjust how PuTTY displays line drawing characters",
-                IDC_BOX_TRANSLATION1);
+                IDC_BOX_TRANSLATION3);
        radiobig(&cp,
                 "Handling of line drawing characters:", IDC_VTSTATIC,
                 "Font has &XWindows encoding", IDC_VTXWINDOWS,
@@ -1234,7 +1256,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
     }
 
     if (panel == sshpanelstart) {
-       /* The SSH panel. Accelerators used: [acgo] r pe12i sud */
+       /* The SSH panel. Accelerators used: [acgo] r pe12i s */
        struct ctlpos cp;
        ctlposinit(&cp, hwnd, 80, 3, 13);
        if (dlgtype == 0) {
@@ -1843,6 +1865,12 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                        cfg.alwaysontop =
                        IsDlgButtonChecked(hwnd, IDC_ALWAYSONTOP);
                break;
+             case IDC_FULLSCREENONALTENTER:
+               if (HIWORD(wParam) == BN_CLICKED ||
+                   HIWORD(wParam) == BN_DOUBLECLICKED)
+                       cfg.fullscreenonaltenter =
+                       IsDlgButtonChecked(hwnd, IDC_FULLSCREENONALTENTER);
+               break;
              case IDC_SCROLLKEY:
                if (HIWORD(wParam) == BN_CLICKED ||
                    HIWORD(wParam) == BN_DOUBLECLICKED)
@@ -2046,6 +2074,13 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                        cfg.sunken_edge =
                        IsDlgButtonChecked(hwnd, IDC_SUNKENEDGE);
                break;
+             case IDC_WINBEDIT:
+               if (HIWORD(wParam) == EN_CHANGE)
+                   MyGetDlgItemInt(hwnd, IDC_WINBEDIT,
+                                   &cfg.window_border);
+               if (cfg.window_border > 32)
+                   cfg.window_border = 32;
+               break;
              case IDC_CURBLOCK:
                if (HIWORD(wParam) == BN_CLICKED ||
                    HIWORD(wParam) == BN_DOUBLECLICKED)
@@ -2079,6 +2114,12 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                        cfg.locksize =
                        IsDlgButtonChecked(hwnd, IDC_LOCKSIZE);
                break;
+             case IDC_LOCKFONT:
+               if (HIWORD(wParam) == BN_CLICKED ||
+                   HIWORD(wParam) == BN_DOUBLECLICKED)
+                       cfg.lockfont =
+                       IsDlgButtonChecked(hwnd, IDC_LOCKFONT);
+               break;
              case IDC_WINEDIT:
                if (HIWORD(wParam) == EN_CHANGE)
                    GetDlgItemText(hwnd, IDC_WINEDIT, cfg.wintitle,
@@ -2479,6 +2520,13 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
                    SetDlgItemText(hwnd, IDC_CODEPAGE, cfg.line_codepage);
                }
                break;
+             case IDC_CAPSLOCKCYR:
+               if (HIWORD(wParam) == BN_CLICKED ||
+                   HIWORD(wParam) == BN_DOUBLECLICKED) {
+                   cfg.xlat_capslockcyr =
+                       IsDlgButtonChecked (hwnd, IDC_CAPSLOCKCYR);
+               }
+               break;
              case IDC_VTXWINDOWS:
              case IDC_VTOEMANSI:
              case IDC_VTOEMONLY: