mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 06:38:37 -05:00
Add Jordan Russell's patch for a sunken-edge border like a DOS box.
Configurable, of course, because I for one like the border as thin as possible. [originally from svn r1092]
This commit is contained in:
parent
f30937f737
commit
0086b20625
1
putty.h
1
putty.h
@ -242,6 +242,7 @@ typedef struct {
|
|||||||
int logtype;
|
int logtype;
|
||||||
int logxfovr;
|
int logxfovr;
|
||||||
int hide_mouseptr;
|
int hide_mouseptr;
|
||||||
|
int sunken_edge;
|
||||||
char answerback[256];
|
char answerback[256];
|
||||||
/* Colour options */
|
/* Colour options */
|
||||||
int try_palette;
|
int try_palette;
|
||||||
|
@ -102,6 +102,7 @@ void save_settings (char *section, int do_host, Config *cfg) {
|
|||||||
write_setting_s (sesskey, "Answerback", cfg->answerback);
|
write_setting_s (sesskey, "Answerback", cfg->answerback);
|
||||||
write_setting_i (sesskey, "AlwaysOnTop", cfg->alwaysontop);
|
write_setting_i (sesskey, "AlwaysOnTop", cfg->alwaysontop);
|
||||||
write_setting_i (sesskey, "HideMousePtr", cfg->hide_mouseptr);
|
write_setting_i (sesskey, "HideMousePtr", cfg->hide_mouseptr);
|
||||||
|
write_setting_i (sesskey, "SunkenEdge", cfg->sunken_edge);
|
||||||
write_setting_i (sesskey, "CurType", cfg->cursor_type);
|
write_setting_i (sesskey, "CurType", cfg->cursor_type);
|
||||||
write_setting_i (sesskey, "BlinkCur", cfg->blink_cur);
|
write_setting_i (sesskey, "BlinkCur", cfg->blink_cur);
|
||||||
write_setting_i (sesskey, "Beep", cfg->beep);
|
write_setting_i (sesskey, "Beep", cfg->beep);
|
||||||
@ -260,6 +261,7 @@ void load_settings (char *section, int do_host, Config *cfg) {
|
|||||||
gpps (sesskey, "Answerback", "PuTTY", cfg->answerback, sizeof(cfg->answerback));
|
gpps (sesskey, "Answerback", "PuTTY", cfg->answerback, sizeof(cfg->answerback));
|
||||||
gppi (sesskey, "AlwaysOnTop", 0, &cfg->alwaysontop);
|
gppi (sesskey, "AlwaysOnTop", 0, &cfg->alwaysontop);
|
||||||
gppi (sesskey, "HideMousePtr", 0, &cfg->hide_mouseptr);
|
gppi (sesskey, "HideMousePtr", 0, &cfg->hide_mouseptr);
|
||||||
|
gppi (sesskey, "SunkenEdge", 0, &cfg->sunken_edge);
|
||||||
gppi (sesskey, "CurType", 0, &cfg->cursor_type);
|
gppi (sesskey, "CurType", 0, &cfg->cursor_type);
|
||||||
gppi (sesskey, "BlinkCur", 0, &cfg->blink_cur);
|
gppi (sesskey, "BlinkCur", 0, &cfg->blink_cur);
|
||||||
gppi (sesskey, "Beep", 1, &cfg->beep);
|
gppi (sesskey, "Beep", 1, &cfg->beep);
|
||||||
|
17
windlg.c
17
windlg.c
@ -354,6 +354,7 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue,
|
|||||||
IDC_BOX_APPEARANCE2,
|
IDC_BOX_APPEARANCE2,
|
||||||
IDC_BOX_APPEARANCE3,
|
IDC_BOX_APPEARANCE3,
|
||||||
IDC_BOX_APPEARANCE4,
|
IDC_BOX_APPEARANCE4,
|
||||||
|
IDC_BOX_APPEARANCE5,
|
||||||
IDC_CURSORSTATIC,
|
IDC_CURSORSTATIC,
|
||||||
IDC_CURBLOCK,
|
IDC_CURBLOCK,
|
||||||
IDC_CURUNDER,
|
IDC_CURUNDER,
|
||||||
@ -365,6 +366,7 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue,
|
|||||||
IDC_WINEDIT,
|
IDC_WINEDIT,
|
||||||
IDC_WINNAME,
|
IDC_WINNAME,
|
||||||
IDC_HIDEMOUSE,
|
IDC_HIDEMOUSE,
|
||||||
|
IDC_SUNKENEDGE,
|
||||||
appearancepanelend,
|
appearancepanelend,
|
||||||
|
|
||||||
connectionpanelstart,
|
connectionpanelstart,
|
||||||
@ -608,6 +610,7 @@ static void init_dlg_ctrls(HWND hwnd) {
|
|||||||
SetDlgItemText (hwnd, IDC_WINEDIT, cfg.wintitle);
|
SetDlgItemText (hwnd, IDC_WINEDIT, cfg.wintitle);
|
||||||
CheckDlgButton (hwnd, IDC_WINNAME, cfg.win_name_always);
|
CheckDlgButton (hwnd, IDC_WINNAME, cfg.win_name_always);
|
||||||
CheckDlgButton (hwnd, IDC_HIDEMOUSE, cfg.hide_mouseptr);
|
CheckDlgButton (hwnd, IDC_HIDEMOUSE, cfg.hide_mouseptr);
|
||||||
|
CheckDlgButton (hwnd, IDC_SUNKENEDGE, cfg.sunken_edge);
|
||||||
CheckRadioButton (hwnd, IDC_CURBLOCK, IDC_CURVERT,
|
CheckRadioButton (hwnd, IDC_CURBLOCK, IDC_CURVERT,
|
||||||
cfg.cursor_type==0 ? IDC_CURBLOCK :
|
cfg.cursor_type==0 ? IDC_CURBLOCK :
|
||||||
cfg.cursor_type==1 ? IDC_CURUNDER : IDC_CURVERT);
|
cfg.cursor_type==1 ? IDC_CURUNDER : IDC_CURVERT);
|
||||||
@ -792,7 +795,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (panel == loggingpanelstart) {
|
if (panel == loggingpanelstart) {
|
||||||
/* The Logging panel. Accelerators used: [acgo] tplfwes */
|
/* The Logging panel. Accelerators used: [acgo] tplfwe */
|
||||||
struct ctlpos cp;
|
struct ctlpos cp;
|
||||||
ctlposinit(&cp, hwnd, 80, 3, 13);
|
ctlposinit(&cp, hwnd, 80, 3, 13);
|
||||||
bartitle(&cp, "Options controlling session logging",
|
bartitle(&cp, "Options controlling session logging",
|
||||||
@ -960,7 +963,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (panel == appearancepanelstart) {
|
if (panel == appearancepanelstart) {
|
||||||
/* The Appearance panel. Accelerators used: [acgo] luvb h ti p */
|
/* The Appearance panel. Accelerators used: [acgo] luvb h ti p s */
|
||||||
struct ctlpos cp;
|
struct ctlpos cp;
|
||||||
ctlposinit(&cp, hwnd, 80, 3, 13);
|
ctlposinit(&cp, hwnd, 80, 3, 13);
|
||||||
bartitle(&cp, "Options controlling PuTTY's appearance",
|
bartitle(&cp, "Options controlling PuTTY's appearance",
|
||||||
@ -990,6 +993,11 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) {
|
|||||||
checkbox(&cp, "Hide mouse &pointer when typing in window",
|
checkbox(&cp, "Hide mouse &pointer when typing in window",
|
||||||
IDC_HIDEMOUSE);
|
IDC_HIDEMOUSE);
|
||||||
endbox(&cp);
|
endbox(&cp);
|
||||||
|
beginbox(&cp, "Adjust the window border",
|
||||||
|
IDC_BOX_APPEARANCE5);
|
||||||
|
checkbox(&cp, "&Sunken-edge border (slightly thicker)",
|
||||||
|
IDC_SUNKENEDGE);
|
||||||
|
endbox(&cp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (panel == translationpanelstart) {
|
if (panel == translationpanelstart) {
|
||||||
@ -1767,6 +1775,11 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg,
|
|||||||
HIWORD(wParam) == BN_DOUBLECLICKED)
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
cfg.hide_mouseptr = IsDlgButtonChecked (hwnd, IDC_HIDEMOUSE);
|
cfg.hide_mouseptr = IsDlgButtonChecked (hwnd, IDC_HIDEMOUSE);
|
||||||
break;
|
break;
|
||||||
|
case IDC_SUNKENEDGE:
|
||||||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
|
cfg.sunken_edge = IsDlgButtonChecked (hwnd, IDC_SUNKENEDGE);
|
||||||
|
break;
|
||||||
case IDC_CURBLOCK:
|
case IDC_CURBLOCK:
|
||||||
if (HIWORD(wParam) == BN_CLICKED ||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
HIWORD(wParam) == BN_DOUBLECLICKED)
|
HIWORD(wParam) == BN_DOUBLECLICKED)
|
||||||
|
15
window.c
15
window.c
@ -371,7 +371,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
|
|||||||
int exwinmode = 0;
|
int exwinmode = 0;
|
||||||
if (!cfg.scrollbar) winmode &= ~(WS_VSCROLL);
|
if (!cfg.scrollbar) winmode &= ~(WS_VSCROLL);
|
||||||
if (cfg.locksize) winmode &= ~(WS_THICKFRAME|WS_MAXIMIZEBOX);
|
if (cfg.locksize) winmode &= ~(WS_THICKFRAME|WS_MAXIMIZEBOX);
|
||||||
if (cfg.alwaysontop) exwinmode = WS_EX_TOPMOST;
|
if (cfg.alwaysontop) exwinmode |= WS_EX_TOPMOST;
|
||||||
|
if (cfg.sunken_edge) exwinmode |= WS_EX_CLIENTEDGE;
|
||||||
hwnd = CreateWindowEx (exwinmode, appname, appname,
|
hwnd = CreateWindowEx (exwinmode, appname, appname,
|
||||||
winmode, CW_USEDEFAULT, CW_USEDEFAULT,
|
winmode, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||||
guess_width, guess_height,
|
guess_width, guess_height,
|
||||||
@ -1193,6 +1194,7 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
|
|||||||
case IDM_RECONF:
|
case IDM_RECONF:
|
||||||
{
|
{
|
||||||
int prev_alwaysontop = cfg.alwaysontop;
|
int prev_alwaysontop = cfg.alwaysontop;
|
||||||
|
int prev_sunken_edge = cfg.sunken_edge;
|
||||||
char oldlogfile[FILENAME_MAX];
|
char oldlogfile[FILENAME_MAX];
|
||||||
int oldlogtype;
|
int oldlogtype;
|
||||||
int need_setwpos = FALSE;
|
int need_setwpos = FALSE;
|
||||||
@ -1246,15 +1248,19 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
|
|||||||
nexflag = exflag;
|
nexflag = exflag;
|
||||||
if (cfg.alwaysontop != prev_alwaysontop) {
|
if (cfg.alwaysontop != prev_alwaysontop) {
|
||||||
if (cfg.alwaysontop) {
|
if (cfg.alwaysontop) {
|
||||||
nexflag = WS_EX_TOPMOST;
|
nexflag |= WS_EX_TOPMOST;
|
||||||
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0,
|
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0,
|
||||||
SWP_NOMOVE | SWP_NOSIZE);
|
SWP_NOMOVE | SWP_NOSIZE);
|
||||||
} else {
|
} else {
|
||||||
nexflag = 0;
|
nexflag &= ~(WS_EX_TOPMOST);
|
||||||
SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0,
|
SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0,
|
||||||
SWP_NOMOVE | SWP_NOSIZE);
|
SWP_NOMOVE | SWP_NOSIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (cfg.sunken_edge)
|
||||||
|
nexflag |= WS_EX_CLIENTEDGE;
|
||||||
|
else
|
||||||
|
nexflag &= ~(WS_EX_CLIENTEDGE);
|
||||||
|
|
||||||
nflg = flag;
|
nflg = flag;
|
||||||
if (cfg.scrollbar) nflg |= WS_VSCROLL;
|
if (cfg.scrollbar) nflg |= WS_VSCROLL;
|
||||||
@ -1291,7 +1297,8 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
|
|||||||
cfg.width != cols ||
|
cfg.width != cols ||
|
||||||
old_fwidth != font_width ||
|
old_fwidth != font_width ||
|
||||||
old_fheight != font_height ||
|
old_fheight != font_height ||
|
||||||
cfg.savelines != savelines)
|
cfg.savelines != savelines ||
|
||||||
|
cfg.sunken_edge != prev_sunken_edge)
|
||||||
need_setwpos = TRUE;
|
need_setwpos = TRUE;
|
||||||
term_size(cfg.height, cfg.width, cfg.savelines);
|
term_size(cfg.height, cfg.width, cfg.savelines);
|
||||||
InvalidateRect(hwnd, NULL, TRUE);
|
InvalidateRect(hwnd, NULL, TRUE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user