1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-26 09:42:25 +00:00

Stop throwing out the Connection panel during midsession reconfig.

Instead, only throw out the useless parts of it. See, the new auto-
layout features bear fruit immediately!

[originally from svn r685]
This commit is contained in:
Simon Tatham 2000-10-06 16:01:09 +00:00
parent 942d7f0533
commit 0129f94d1c

View File

@ -18,7 +18,7 @@
#define NPANELS 9
#define MAIN_NPANELS 9
#define RECONF_NPANELS 6
#define RECONF_NPANELS 7
static char **events = NULL;
static int nevents = 0, negsize = 0;
@ -822,6 +822,7 @@ static int CALLBACK ConnectionProc (HWND hwnd, UINT msg,
case WM_INITDIALOG:
/* Accelerators used: [aco] dehlnprstwx */
ctlposinit(&cp, hwnd);
if (wParam == 0) {
multiedit(&cp,
"Host &Name", IDC_HOSTSTATIC, IDC_HOST, 75,
"&Port", IDC_PORTSTATIC, IDC_PORT, 25, NULL);
@ -846,6 +847,7 @@ static int CALLBACK ConnectionProc (HWND hwnd, UINT msg,
"&Load", IDC_SESSLOAD,
"&Save", IDC_SESSSAVE,
"&Delete", IDC_SESSDEL, NULL);
}
checkbox(&cp, "Close Window on E&xit", IDC_CLOSEEXIT);
checkbox(&cp, "&Warn on Close", IDC_CLOSEWARN);
@ -1300,6 +1302,7 @@ static int CALLBACK WindowProc (HWND hwnd, UINT msg,
case WM_INITDIALOG:
/* Accelerators used: [aco] bikty */
ctlposinit(&cp, hwnd);
if (wParam == 0)
multiedit(&cp,
"Initial window &title:", IDC_WINTITLE, IDC_WINEDIT, 100,
NULL);
@ -1375,6 +1378,7 @@ static int CALLBACK TelnetProc (HWND hwnd, UINT msg,
case WM_INITDIALOG:
/* Accelerators used: [aco] bdflrstuv */
ctlposinit(&cp, hwnd);
if (wParam == 0) {
staticedit(&cp, "Terminal-&type string", IDC_TTSTATIC, IDC_TTEDIT);
staticedit(&cp, "Terminal-&speed string", IDC_TSSTATIC, IDC_TSEDIT);
staticedit(&cp, "Auto-login &username", IDC_LOGSTATIC, IDC_LOGEDIT);
@ -1386,6 +1390,7 @@ static int CALLBACK TelnetProc (HWND hwnd, UINT msg,
radioline(&cp, "Handling of OLD_ENVIRON ambiguity:", IDC_EMSTATIC, 2,
"&BSD (commonplace)", IDC_EMBSD,
"R&FC 1408 (unusual)", IDC_EMRFC, NULL);
}
SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype);
SetDlgItemText (hwnd, IDC_TSEDIT, cfg.termspeed);
@ -1528,6 +1533,7 @@ static int CALLBACK SshProc (HWND hwnd, UINT msg,
case WM_INITDIALOG:
/* Accelerators used: [aco] 123abdkmprtuw */
ctlposinit(&cp, hwnd);
if (wParam == 0) {
staticedit(&cp, "Terminal-&type string", IDC_TTSTATIC, IDC_TTEDIT);
staticedit(&cp, "Auto-login &username", IDC_LOGSTATIC, IDC_LOGEDIT);
multiedit(&cp,
@ -1546,6 +1552,7 @@ static int CALLBACK SshProc (HWND hwnd, UINT msg,
"&3DES", IDC_CIPHER3DES,
"&Blowfish", IDC_CIPHERBLOWF,
"&DES", IDC_CIPHERDES, NULL);
}
SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype);
SetDlgItemText (hwnd, IDC_LOGEDIT, cfg.username);
@ -1959,9 +1966,10 @@ static char *names[NPANELS] = {
};
static int mainp[MAIN_NPANELS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8};
static int reconfp[RECONF_NPANELS] = { 1, 2, 3, 6, 7, 8};
static int reconfp[RECONF_NPANELS] = { 0, 1, 2, 3, 6, 7, 8};
static HWND makesubdialog(HWND hwnd, int x, int y, int w, int h, int n) {
static HWND makesubdialog(HWND hwnd, int x, int y, int w, int h,
int n, int dlgtype) {
RECT r;
HWND ret;
WPARAM font;
@ -1978,13 +1986,14 @@ static HWND makesubdialog(HWND hwnd, int x, int y, int w, int h, int n) {
SetWindowLong (ret, DWL_DLGPROC, (LONG)panelproc[n]);
font = SendMessage(hwnd, WM_GETFONT, 0, 0);
SendMessage (ret, WM_SETFONT, font, MAKELPARAM(0, 0));
SendMessage (ret, WM_INITDIALOG, 0, 0);
SendMessage (ret, WM_INITDIALOG, dlgtype, 0);
return ret;
}
static int GenericMainDlgProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam,
int npanels, int *panelnums, HWND *page) {
int npanels, int dlgtype,
int *panelnums, HWND *page) {
HWND hw, tabctl;
switch (msg) {
@ -2039,7 +2048,7 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg,
}
SendDlgItemMessage(hwnd, IDC_TABLIST, CB_SETCURSEL, 0, 0);
}
*page = makesubdialog(hwnd, 6, 30, 168, 163, panelnums[0]);
*page = makesubdialog(hwnd, 6, 30, 168, 163, panelnums[0], dlgtype);
SetFocus (*page);
return 0;
case WM_NOTIFY:
@ -2048,7 +2057,8 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg,
int i = TabCtrl_GetCurSel(((LPNMHDR)lParam)->hwndFrom);
if (*page)
DestroyWindow (*page);
*page = makesubdialog(hwnd, 6, 30, 168, 163, panelnums[i]);
*page = makesubdialog(hwnd, 6, 30, 168, 163,
panelnums[i], dlgtype);
SetFocus (((LPNMHDR)lParam)->hwndFrom); /* ensure focus stays */
return 0;
}
@ -2061,7 +2071,8 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg,
int i = SendMessage (tablist, CB_GETCURSEL, 0, 0);
if (*page)
DestroyWindow (*page);
*page = makesubdialog(hwnd, 6, 30, 168, 163, panelnums[i]);
*page = makesubdialog(hwnd, 6, 30, 168, 163,
panelnums[i], dlgtype);
SetFocus(tablist); /* ensure focus stays */
return 0;
}
@ -2104,14 +2115,14 @@ static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
SetActiveWindow(hwnd);
}
return GenericMainDlgProc (hwnd, msg, wParam, lParam,
MAIN_NPANELS, mainp, &page);
MAIN_NPANELS, 0, mainp, &page);
}
static int CALLBACK ReconfDlgProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
static HWND page;
return GenericMainDlgProc (hwnd, msg, wParam, lParam,
RECONF_NPANELS, reconfp, &page);
RECONF_NPANELS, 1, reconfp, &page);
}
int do_config (void) {