[Ttssh2-commit] [6459] ・Tek Window での貼り付け時、確認ダイアログが出た時に VT Window にフォーカスが移るのを修正

svnno****@sourc***** svnno****@sourc*****
2016年 8月 3日 (水) 02:33:43 JST


Revision: 6459
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6459
Author:   doda
Date:     2016-08-03 02:33:43 +0900 (Wed, 03 Aug 2016)
Log Message:
-----------
・Tek Window での貼り付け時、確認ダイアログが出た時に VT Window にフォーカスが移るのを修正
・Tek Window での Alt-V / Alt-R による貼り付け時、Bracketed Paste Mode が適用されないようにした

Tek Window での貼り付けで確認ダイアログが出ない問題自体は r6456 で修正。

Revision Links:
--------------
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6456

Modified Paths:
--------------
    trunk/teraterm/teraterm/clipboar.c
    trunk/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: trunk/teraterm/teraterm/clipboar.c
===================================================================
--- trunk/teraterm/teraterm/clipboar.c	2016-08-01 12:59:15 UTC (rev 6458)
+++ trunk/teraterm/teraterm/clipboar.c	2016-08-02 17:33:43 UTC (rev 6459)
@@ -197,7 +197,7 @@
  *   TRUE  -> \x96\xE2\x91\xE8\x82Ȃ\xB5\x81A\x93\\x82\xE8\x95t\x82\xAF\x82\xF0\x8E\xC0\x8E{
  *   FALSE -> \x93\\x82\xE8\x95t\x82\xAF\x92\x86\x8E~
  */
-BOOL CheckClipboardContent(BOOL AddCR, BOOL Bracketed)
+BOOL CheckClipboardContent(HWND HWin, BOOL AddCR, BOOL Bracketed)
 {
 	int pos;
 	int ret = IDOK;
@@ -241,7 +241,7 @@
 
 	if (confirm) {
 		ret = DialogBox(hInst, MAKEINTRESOURCE(IDD_CLIPBOARD_DIALOG),
-		                HVTWin, (DLGPROC)OnClipboardDlgProc);
+		                HWin, (DLGPROC)OnClipboardDlgProc);
 		/*
 		 * \x88ȑO\x82̓_\x83C\x83A\x83\x8D\x83O\x82̓\xE0\x97e\x82\xF0\x83N\x83\x8A\x83b\x83v\x83{\x81[\x83h\x82ɏ\x91\x82\xAB\x96߂\xB5\x82Ă\xA2\x82\xBD\x82\xAF\x82\xEA\x82ǁA\x95K\x97v?
 		 */
@@ -358,7 +358,7 @@
 		return;
 	}
 
-	if (!CheckClipboardContent(AddCR, Bracketed)) {
+	if (!CheckClipboardContent(HWin, AddCR, Bracketed)) {
 		CBEndPaste();
 		return;
 	}
@@ -778,9 +778,24 @@
 
 			SendMessage(GetDlgItem(hDlgWnd, IDC_EDIT), WM_SETTEXT, 0, (LPARAM)CBMemPtr);
 
-			DispConvScreenToWin(CursorX, CursorY, &p.x, &p.y);
-			ClientToScreen(HVTWin, &p);
+			if (ActiveWin == IdVT) { // VT Window
+				/*
+				 * Caret off \x8E\x9E\x82\xC9 GetCaretPos() \x82Ő\xB3\x8Am\x82ȏꏊ\x82\xAA\x8E\xE6\x82\xEA\x82Ȃ\xA2\x82̂ŁA
+				 * vtdisp.c \x93\xE0\x95\x94\x82ŊǗ\x9D\x82\xB5\x82Ă\xA2\x82\xE9\x92l\x82\xA9\x82\xE7\x8Cv\x8EZ\x82\xB7\x82\xE9
+				 */
+				DispConvScreenToWin(CursorX, CursorY, &p.x, &p.y);
+			}
+			else if (!GetCaretPos(&p)) { // Tek Window
+				/*
+				 * Tek Window \x82͓\xE0\x95\x94\x8AǗ\x9D\x82̒l\x82\xF0\x8E\xE6\x82\xE9\x82̂\xAA\x96ʓ|\x82Ȃ̂\xC5 GetCaretPos() \x82\xF0\x8Eg\x82\xA4
+				 * GetCaretPos() \x82\xAA\x83G\x83\x89\x81[\x82ɂȂ\xC1\x82\xBD\x8Fꍇ\x82͔O\x82̂\xBD\x82\xDF 0, 0 \x82\xF0\x93\xFC\x82\xEA\x82Ă\xA8\x82\xAD
+				 */
+				p.x = 0;
+				p.y = 0;
+			}
 
+			ClientToScreen(GetParent(hDlgWnd), &p);
+
 			// \x83L\x83\x83\x83\x8C\x83b\x83g\x82\xAA\x89\xE6\x96ʂ\xA9\x82\xE7\x82͂ݏo\x82\xB5\x82Ă\xA2\x82\xE9\x82Ƃ\xAB\x82ɓ\\x82\xE8\x95t\x82\xAF\x82\xF0\x82\xB7\x82\xE9\x82\xC6
 			// \x8Am\x94F\x83E\x83C\x83\x93\x83h\x83E\x82\xAA\x8C\xA9\x82\xA6\x82\xE9\x82Ƃ\xB1\x82\xEB\x82ɕ\\x8E\xA6\x82\xB3\x82\xEA\x82Ȃ\xA2\x82\xB1\x82Ƃ\xAA\x82\xA0\x82\xE9\x81B
 			// \x83E\x83C\x83\x93\x83h\x83E\x82\xA9\x82\xE7\x82͂ݏo\x82\xB5\x82\xBD\x8Fꍇ\x82ɒ\xB2\x90߂\xB7\x82\xE9 (2008.4.24 maya)

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2016-08-01 12:59:15 UTC (rev 6458)
+++ trunk/teraterm/teraterm/vtwin.cpp	2016-08-02 17:33:43 UTC (rev 6459)
@@ -1761,15 +1761,9 @@
 				if (!ts.DisableAcceleratorSendBreak)
 					OnControlSendBreak();
 				return TRUE;
-			case ID_ACC_PASTECR:
-				OnEditPasteCR();
-				return TRUE;
 			case ID_ACC_AREYOUTHERE:
 				OnControlAreYouThere();
 				return TRUE;
-			case ID_ACC_PASTE:
-				OnEditPaste();
-				return TRUE;
 		}
 		if (ActiveWin==IdVT) {
 			switch (wID) {
@@ -1792,6 +1786,12 @@
 				case ID_ACC_COPY:
 					OnEditCopy();
 					return TRUE;
+				case ID_ACC_PASTECR:
+					OnEditPasteCR();
+					return TRUE;
+				case ID_ACC_PASTE:
+					OnEditPaste();
+					return TRUE;
 				case ID_ACC_PRINT:
 					OnFilePrint();
 					return TRUE;
@@ -1805,6 +1805,12 @@
 				case ID_ACC_COPY:
 					::PostMessage(HTEKWin,WM_COMMAND,ID_TEKEDIT_COPY,0);
 					return TRUE;
+				case ID_ACC_PASTECR:
+					::PostMessage(HTEKWin,WM_COMMAND,ID_TEKEDIT_PASTECR,0);
+					return TRUE;
+				case ID_ACC_PASTE:
+					::PostMessage(HTEKWin,WM_COMMAND,ID_TEKEDIT_PASTE,0);
+					return TRUE;
 				case ID_ACC_PRINT:
 					::PostMessage(HTEKWin,WM_COMMAND,ID_TEKFILE_PRINT,0);
 					return TRUE;



Ttssh2-commit メーリングリストの案内