[Ttssh2-commit] [7592] ダイアログを親(vtwin)の中央に表示するよう修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 4月 18日 (木) 00:08:43 JST


Revision: 7592
          https://osdn.net/projects/ttssh2/scm/svn/commits/7592
Author:   zmatsuo
Date:     2019-04-18 00:08:42 +0900 (Thu, 18 Apr 2019)
Log Message:
-----------
ダイアログを親(vtwin)の中央に表示するよう修正

Modified Paths:
--------------
    trunk/TTProxy/ProxyWSockHook.h
    trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c
    trunk/teraterm/common/tmfc.cpp
    trunk/teraterm/common/tmfc.h
    trunk/teraterm/common/tmfc_frame.cpp
    trunk/teraterm/teraterm/addsetting.cpp
    trunk/teraterm/teraterm/addsetting.h
    trunk/teraterm/teraterm/dnddlg.cpp
    trunk/teraterm/ttpdlg/ttdlg.c
    trunk/ttssh2/ttxssh/auth.c
    trunk/ttssh2/ttxssh/fwdui.c
    trunk/ttssh2/ttxssh/hosts.c
    trunk/ttssh2/ttxssh/key.c
    trunk/ttssh2/ttxssh/sftp.c
    trunk/ttssh2/ttxssh/ssh.c
    trunk/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: trunk/TTProxy/ProxyWSockHook.h
===================================================================
--- trunk/TTProxy/ProxyWSockHook.h	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/TTProxy/ProxyWSockHook.h	2019-04-17 15:08:42 UTC (rev 7592)
@@ -879,6 +879,8 @@
             if (logfile != NULL)
                 log.SetWindowText(logfile);
 
+            CenterWindow((HWND)*this, GetParent());
+
             return true;
         }
         virtual void onOK() {
@@ -1071,6 +1073,7 @@
             }
             lock = false;
             onChanged(0);
+            CenterWindow((HWND)*this, GetParent());
             return true;
         }
         virtual void onOK() {
@@ -1255,6 +1258,8 @@
             UTIL_get_lang_msg("BTN_OK", uimsg, sizeof(uimsg),"OK");
             SetDlgItemText(IDOK, uimsg);
 
+            CenterWindow((HWND)*this, GetParent());
+
             return true;
         }
         virtual void onOK() {

Modified: trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c
===================================================================
--- trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c	2019-04-17 15:08:42 UTC (rev 7592)
@@ -520,6 +520,8 @@
 		SendMessage(GetDlgItem(dlg, IDC_ADD_NL), BM_SETCHECK,
 		            pvar->add_nl?BST_CHECKED:BST_UNCHECKED, 0);
 
+		CenterWindow(dlg, GetParent(dlg));
+
 		return TRUE;
 	  case WM_COMMAND:
 		switch (LOWORD(wParam)) {

Modified: trunk/teraterm/common/tmfc.cpp
===================================================================
--- trunk/teraterm/common/tmfc.cpp	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/teraterm/common/tmfc.cpp	2019-04-17 15:08:42 UTC (rev 7592)
@@ -715,6 +715,8 @@
 TTCPropertySheet::TTCPropertySheet(HINSTANCE hInstance, LPCTSTR pszCaption, HWND hParentWnd)
 {
 	m_hInst = hInstance;
+	m_hWnd = 0;
+	m_hParentWnd = hParentWnd;
 	memset(&m_psh, 0, sizeof(m_psh));
 	m_psh.dwSize = sizeof(m_psh);
 	m_psh.dwFlags = PSH_DEFAULT | PSH_NOAPPLYNOW | PSH_USECALLBACK;	// | PSH_MODELESS

Modified: trunk/teraterm/common/tmfc.h
===================================================================
--- trunk/teraterm/common/tmfc.h	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/teraterm/common/tmfc.h	2019-04-17 15:08:42 UTC (rev 7592)
@@ -164,6 +164,7 @@
 	INT_PTR DoModal();
 	PROPSHEETHEADER m_psh;
 	HWND m_hWnd;
+	HWND m_hParentWnd;
 	static int CALLBACK PropSheetProc(HWND hWnd, UINT msg, LPARAM lParam);
 	HINSTANCE m_hInst;
 };

Modified: trunk/teraterm/common/tmfc_frame.cpp
===================================================================
--- trunk/teraterm/common/tmfc_frame.cpp	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/teraterm/common/tmfc_frame.cpp	2019-04-17 15:08:42 UTC (rev 7592)
@@ -66,7 +66,7 @@
 	m_hParentWnd = hParentWnd;
 	pseudoPtr = this;
 	HWND hWnd = ::CreateWindowEx(
-		0,
+		WS_EX_OVERLAPPEDWINDOW,
 		lpszClassName,
 		lpszWindowName,
 		dwStyle,

Modified: trunk/teraterm/teraterm/addsetting.cpp
===================================================================
--- trunk/teraterm/teraterm/addsetting.cpp	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/teraterm/teraterm/addsetting.cpp	2019-04-17 15:08:42 UTC (rev 7592)
@@ -1516,3 +1516,8 @@
 	delete m_CygwinPage;
 }
 
+void CAddSettingPropSheetDlg::OnInitDialog()
+{
+	TTCPropertySheet::OnInitDialog();
+	CenterWindow(m_hWnd, m_hParentWnd);
+}

Modified: trunk/teraterm/teraterm/addsetting.h
===================================================================
--- trunk/teraterm/teraterm/addsetting.h	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/teraterm/teraterm/addsetting.h	2019-04-17 15:08:42 UTC (rev 7592)
@@ -126,8 +126,10 @@
 	CAddSettingPropSheetDlg(HINSTANCE hInstance, LPCTSTR pszCaption, HWND hParentWnd);
 	virtual ~CAddSettingPropSheetDlg();
 private:
+	void OnInitDialog();
+
 	HPROPSHEETPAGE hPsp[6];
-	
+
 	CGeneralPropPageDlg   *m_GeneralPage;
 	CSequencePropPageDlg  *m_SequencePage;
 	CCopypastePropPageDlg *m_CopypastePage;

Modified: trunk/teraterm/teraterm/dnddlg.cpp
===================================================================
--- trunk/teraterm/teraterm/dnddlg.cpp	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/teraterm/teraterm/dnddlg.cpp	2019-04-17 15:08:42 UTC (rev 7592)
@@ -1,5 +1,5 @@
 /*
- * (C) 2005-2018 TeraTerm Project
+ * (C) 2005-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -165,6 +165,7 @@
 						(WPARAM)GetDlgItem(hDlgWnd, focus_id), TRUE);
 		}
 
+		CenterWindow(hDlgWnd, GetParent(hDlgWnd));
 		// TRUE\x82ɂ\xB7\x82\xE9\x82ƃ{\x83^\x83\x93\x82Ƀt\x83H\x81[\x83J\x83X\x82\xAA\x93\x96\x82\xBD\x82\xE7\x82Ȃ\xA2\x81B
 		return FALSE;
 	}

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2019-04-17 15:08:42 UTC (rev 7592)
@@ -264,6 +264,7 @@
 				SetDlgItemText(Dialog, IDC_LOCALE_EDIT, ts->Locale);
 				SendDlgItemMessage(Dialog, IDC_LOCALE_EDIT, EM_LIMITTEXT, sizeof(ts->Locale), 0);
 			}
+			CenterWindow(Dialog, GetParent(Dialog));
 			return TRUE;
 
 		case WM_COMMAND:
@@ -677,6 +678,8 @@
 
 			ChangeSB(Dialog,ts,IAttr,IOffset);
 
+			CenterWindow(Dialog, GetParent(Dialog));
+
 			return TRUE;
 
 		case WM_COMMAND:
@@ -1055,6 +1058,9 @@
 				ShowDlgItem(Dialog,IDC_KEYBKEYBTEXT,IDC_KEYBKEYB);
 				SetDropDownList(Dialog, IDC_KEYBKEYB, RussList2, ts->RussKeyb);
 			}
+
+			CenterWindow(Dialog, GetParent(Dialog));
+
 			return TRUE;
 
 		case WM_COMMAND:
@@ -1190,6 +1196,8 @@
 			SetDlgItemInt(Dialog,IDC_SERIALDELAYLINE,ts->DelayPerLine,FALSE);
 			SendDlgItemMessage(Dialog, IDC_SERIALDELAYLINE, EM_LIMITTEXT,4, 0);
 
+			CenterWindow(Dialog, GetParent(Dialog));
+
 			return TRUE;
 
 		case WM_COMMAND:
@@ -1308,6 +1316,8 @@
 			// SSH\x90ڑ\xB1\x82̂Ƃ\xAB\x82ɂ\xE0 TERM \x82𑗂\xE9\x82̂ŁAtelnet\x82\xAA\x96\xB3\x8C\xF8\x82ł\xE0 disabled \x82ɂ\xB5\x82Ȃ\xA2\x81B(2005.11.3 yutaka)
 			EnableDlgItem(Dialog,IDC_TCPIPTERMTYPELABEL,IDC_TCPIPTERMTYPE);
 
+			CenterWindow(Dialog, GetParent(Dialog));
+
 			return TRUE;
 
 		case WM_COMMAND:
@@ -1606,6 +1616,8 @@
 				DisableDlgItem(Dialog,IDC_HOSTTCPPROTOCOLLABEL,IDC_HOSTTCPPROTOCOL);
 			}
 
+			CenterWindow(Dialog, GetParent(Dialog));
+
 			return TRUE;
 
 		case WM_COMMAND:
@@ -1811,6 +1823,8 @@
 			// resize dialog
 			MoveWindow(Dialog,WX,WY,WW,WH,TRUE);
 
+			CenterWindow(Dialog, GetParent(Dialog));
+
 			return TRUE;
 
 		case WM_COMMAND:
@@ -2315,6 +2329,8 @@
 			ReleaseDC(hwnd, hdc);
 #endif
 
+			CenterWindow(Dialog, GetParent(Dialog));
+
 			return TRUE;
 
 		case WM_COMMAND:
@@ -2591,6 +2607,8 @@
 				EnableWindow(GetDlgItem(Dialog, IDC_GENLANG_UI), FALSE);
 			}
 
+			CenterWindow(Dialog, GetParent(Dialog));
+
 			return TRUE;
 
 		case WM_COMMAND:
@@ -2687,6 +2705,9 @@
 			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile);
 		
 			SetWinList(GetParent(Dialog),Dialog,IDC_WINLISTLIST);
+
+			CenterWindow(Dialog, GetParent(Dialog));
+
 			return TRUE;
 
 		case WM_COMMAND:
@@ -2842,6 +2863,8 @@
 
 			SetFocus(GetDlgItem(Dialog,cmb1));
 
+			CenterWindow(Dialog, GetParent(Dialog));
+
 			break;
 		}
 #if 0

Modified: trunk/ttssh2/ttxssh/auth.c
===================================================================
--- trunk/ttssh2/ttxssh/auth.c	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/ttssh2/ttxssh/auth.c	2019-04-17 15:08:42 UTC (rev 7592)
@@ -829,6 +829,7 @@
 				SetTimer(dlg, IDC_TIMER3, autologin_timeout, 0);
 			}
 		}
+		CenterWindow(dlg, GetParent(dlg));
 		return FALSE;			/* because we set the focus */
 
 	case WM_TIMER:
@@ -1267,6 +1268,7 @@
 			SendMessage(dlg, WM_COMMAND, IDOK, 0);
 		}
 
+		CenterWindow(dlg, GetParent(dlg));
 		return FALSE;			/* because we set the focus */
 
 	case WM_COMMAND:
@@ -1495,6 +1497,7 @@
 			DlgAuthSetupFont = NULL;
 		}
 #endif
+		CenterWindow(dlg, GetParent(dlg));
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:

Modified: trunk/ttssh2/ttxssh/fwdui.c
===================================================================
--- trunk/ttssh2/ttxssh/fwdui.c	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/ttssh2/ttxssh/fwdui.c	2019-04-17 15:08:42 UTC (rev 7592)
@@ -1026,6 +1026,7 @@
 			DlgFwdEditFont = NULL;
 		}
 #endif
+		CenterWindow(dlg, GetParent(dlg));
 		return FALSE;			/* because we set the focus */
 
 	case WM_COMMAND:
@@ -1179,6 +1180,7 @@
 			DlgFwdFont = NULL;
 		}
 #endif
+		CenterWindow(dlg, GetParent(dlg));
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:

Modified: trunk/ttssh2/ttxssh/hosts.c
===================================================================
--- trunk/ttssh2/ttxssh/hosts.c	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/ttssh2/ttxssh/hosts.c	2019-04-17 15:08:42 UTC (rev 7592)
@@ -1808,6 +1808,8 @@
 		// add host check box\x82Ƀ`\x83F\x83b\x83N\x82\xF0\x83f\x83t\x83H\x83\x8B\x83g\x82œ\xFC\x82\xEA\x82Ă\xA8\x82\xAD 
 		SendMessage(GetDlgItem(dlg, IDC_ADDTOKNOWNHOSTS), BM_SETCHECK, BST_CHECKED, 0);
 
+		CenterWindow(dlg, GetParent(dlg));
+
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
@@ -1970,6 +1972,7 @@
 			DlgHostsReplaceFont = NULL;
 		}
 #endif
+		CenterWindow(dlg, GetParent(dlg));
 		// \x83f\x83t\x83H\x83\x8B\x83g\x82Ń`\x83F\x83b\x83N\x82͓\xFC\x82\xEA\x82Ȃ\xA2
 		return TRUE;			/* because we do not set the focus */
 
@@ -2135,6 +2138,7 @@
 			DlgHostsAddFont = NULL;
 		}
 #endif
+		CenterWindow(dlg, GetParent(dlg));
 		// add host check box \x82̃f\x83t\x83H\x83\x8B\x83g\x82\xCD off \x82ɂ\xB7\x82\xE9
 		// SendMessage(GetDlgItem(dlg, IDC_ADDTOKNOWNHOSTS), BM_SETCHECK, BST_CHECKED, 0);
 

Modified: trunk/ttssh2/ttxssh/key.c
===================================================================
--- trunk/ttssh2/ttxssh/key.c	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/ttssh2/ttxssh/key.c	2019-04-17 15:08:42 UTC (rev 7592)
@@ -2266,6 +2266,7 @@
 			DlgHostsAddFont = NULL;
 		}
 #endif
+		CenterWindow(dlg, GetParent(dlg));
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:

Modified: trunk/ttssh2/ttxssh/sftp.c
===================================================================
--- trunk/ttssh2/ttxssh/sftp.c	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/ttssh2/ttxssh/sftp.c	2019-04-17 15:08:42 UTC (rev 7592)
@@ -1076,6 +1076,8 @@
 			hEditProc = (WNDPROC)GetWindowLong(hEdit, GWL_WNDPROC);
 			SetWindowLong(hEdit, GWL_WNDPROC, (LONG)EditProc);
 
+			CenterWindow(hDlgWnd, GetParent(hDlgWnd));
+
 			return TRUE;
 
 		case WM_COMMAND:

Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/ttssh2/ttxssh/ssh.c	2019-04-17 15:08:42 UTC (rev 7592)
@@ -7397,6 +7397,8 @@
 
 		SetFocus(GetDlgItem(dlg, IDC_OLD_PASSWD));
 
+		CenterWindow(dlg, GetParent(dlg));
+
 		return FALSE;
 
 	case WM_COMMAND:
@@ -8120,6 +8122,7 @@
 	switch (msg) {
 		case WM_INITDIALOG:
 			closed = 0;
+			CenterWindow(hWnd, GetParent(hWnd));
 			return FALSE;
 
 		// SCP\x83t\x83@\x83C\x83\x8B\x8E\xF3\x90M(remote-to-local)\x8E\x9E\x81A\x8Eg\x97p\x82\xB7\x82\xE9\x81B

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2019-04-17 15:08:26 UTC (rev 7591)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2019-04-17 15:08:42 UTC (rev 7592)
@@ -1491,7 +1491,9 @@
 			DlgHostFont = NULL;
 		}
 #endif
-		
+
+		CenterWindow(dlg, GetParent(dlg));
+
 		// SetFocus()\x82Ńt\x83H\x81[\x83J\x83X\x82\xF0\x82\xA0\x82킹\x82\xBD\x8Fꍇ\x81AFALSE\x82\xF0\x95Ԃ\xB7\x95K\x97v\x82\xAA\x82\xA0\x82\xE9\x81B
 		// TRUE\x82\xF0\x95Ԃ\xB7\x82ƁATABSTOP\x91Ώۂ̈\xEA\x94Ԃ͂\xB6\x82߂̃R\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x82\xAA\x91I\x82΂\xEA\x82\xE9\x81B
 		// (2004.11.23 yutaka)
@@ -2544,6 +2546,8 @@
 		g_deltaSumAboutDlg = 0;
 		g_defAboutDlgEditWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(dlg, IDC_ABOUTTEXT), GWLP_WNDPROC, (LONG_PTR)AboutDlgEditWindowProc);
 
+		CenterWindow(dlg, GetParent(dlg));
+
 		return FALSE;
 
 	case WM_COMMAND:
@@ -3384,6 +3388,9 @@
 			DlgSetupFont = NULL;
 		}
 #endif
+
+		CenterWindow(dlg, GetParent(dlg));
+
 		return TRUE;
 	case WM_COMMAND:
 		switch (LOWORD(wParam)) {
@@ -3946,6 +3953,7 @@
 #ifdef SFTP_DEBUG
 		ShowWindow(GetDlgItem(dlg, IDC_SFTP_TEST), SW_SHOW);
 #endif
+		CenterWindow(dlg, GetParent(dlg));
 
 		return TRUE;
 
@@ -4428,6 +4436,8 @@
 		SetDlgItemInt(dlg, IDC_BCRYPT_KDF_ROUNDS, DEFAULT_ROUNDS, FALSE);
 		SendDlgItemMessage(dlg, IDC_BCRYPT_KDF_ROUNDS, EM_LIMITTEXT, 4, 0);
 
+		CenterWindow(dlg, GetParent(dlg));
+
 		}
 		return TRUE;
 


Ttssh2-commit メーリングリストの案内
Back to archive index