[Ttssh2-commit] [3902] ConfirmChangePaste の確認ダイアログ表示中にクリップボードがロックされたままにならないようにした。

svnno****@sourc***** svnno****@sourc*****
2010年 5月 21日 (金) 07:40:51 JST


Revision: 3902
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3902
Author:   maya
Date:     2010-05-21 07:40:51 +0900 (Fri, 21 May 2010)

Log Message:
-----------
ConfirmChangePaste の確認ダイアログ表示中にクリップボードがロックされたままにならないようにした。

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/installer/release/lang/English.lng
    trunk/installer/release/lang/German.lng
    trunk/installer/release/lang/Japanese.lng
    trunk/teraterm/common/tt_res.h
    trunk/teraterm/teraterm/clipboar.c
    trunk/teraterm/teraterm/ttermpro.rc


-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2010-05-20 15:37:49 UTC (rev 3901)
+++ trunk/doc/en/html/about/history.html	2010-05-20 22:40:51 UTC (rev 3902)
@@ -56,6 +56,7 @@
           <li>added the LogBinary entry in the teraterm.ini file. The default value is off.</li>
         </ul></li>
       <li>Change the cursor color depending on the IME open status.</li>
+      <!--li>ConfirmChangePaste ????????????????????????????????</li-->
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2010-05-20 15:37:49 UTC (rev 3901)
+++ trunk/doc/ja/html/about/history.html	2010-05-20 22:40:51 UTC (rev 3902)
@@ -56,6 +56,7 @@
           <li>teraterm.ini ‚É LogBinary ƒGƒ“ƒgƒŠ‚ð’ljÁ‚µ‚½BƒfƒtƒHƒ‹ƒg‚ÍoffB</li>
         </ul></li>
       <li>IME‚Ìon/offó‘Ô‚ðŒ©‚ÄAƒJ[ƒ\ƒ‹‚̐F‚ð•ÏX‚·‚é‚悤‚É‚µ‚½B</li>
+      <li>ConfirmChangePaste ‚ÌŠm”Fƒ_ƒCƒAƒƒO•\Ž¦’†‚ɃNƒŠƒbƒvƒ{[ƒh‚ðƒƒbƒN‚µ‚È‚¢‚悤‚É‚µ‚½B</li>
     </ul>
   </li>
 

Modified: trunk/installer/release/lang/English.lng
===================================================================
--- trunk/installer/release/lang/English.lng	2010-05-20 15:37:49 UTC (rev 3901)
+++ trunk/installer/release/lang/English.lng	2010-05-20 22:40:51 UTC (rev 3902)
@@ -402,7 +402,6 @@
 
 ; dlg clipboard
 DLG_CLIPBOARD_TITLE=Tera Term: Clipboard confirmation
-DLG_CLIPBOARD_INFO=Currently, Clipboard has been locked.
 
 ; ttptek
 ; tttek.c

Modified: trunk/installer/release/lang/German.lng
===================================================================
--- trunk/installer/release/lang/German.lng	2010-05-20 15:37:49 UTC (rev 3901)
+++ trunk/installer/release/lang/German.lng	2010-05-20 22:40:51 UTC (rev 3902)
@@ -402,7 +402,6 @@
 
 ; dlg clipboard
 DLG_CLIPBOARD_TITLE=Tera Term: Clipboard confirmation
-DLG_CLIPBOARD_INFO=Currently, Clipboard has been locked.
 
 ; ttptek
 ; tttek.c

Modified: trunk/installer/release/lang/Japanese.lng
===================================================================
--- trunk/installer/release/lang/Japanese.lng	2010-05-20 15:37:49 UTC (rev 3901)
+++ trunk/installer/release/lang/Japanese.lng	2010-05-20 22:40:51 UTC (rev 3902)
@@ -402,7 +402,6 @@
 
 ; dlg clipboard
 DLG_CLIPBOARD_TITLE=Tera Term: ƒNƒŠƒbƒvƒ{[ƒh‚ÌŠm”F
-DLG_CLIPBOARD_INFO=ƒNƒŠƒbƒvƒ{[ƒh‚ÍŒ»ÝƒƒbƒN‚³‚ê‚Ä‚¢‚Ü‚·B
 
 ; ttptek
 ; tttek.c

Modified: trunk/teraterm/common/tt_res.h
===================================================================
--- trunk/teraterm/common/tt_res.h	2010-05-20 15:37:49 UTC (rev 3901)
+++ trunk/teraterm/common/tt_res.h	2010-05-20 22:40:51 UTC (rev 3902)
@@ -1,6 +1,6 @@
 //{{NO_DEPENDENCIES}}
 // Microsoft Visual C++ generated include file.
-// Used by c:\usr\ttssh2\teraterm\teraterm\ttermpro.rc
+// Used by t:\ttssh2\teraterm\teraterm\ttermpro.rc
 //
 #define IDI_TTERM                       100
 #define IDR_ACC                         100
@@ -127,7 +127,6 @@
 #define IDC_EDIT                        2510
 #define IDC_SCROLL_LINE                 2510
 #define IDC_PASTEDELAY_EDIT             2510
-#define IDC_CLIPBOARD_INFO              2511
 #define IDC_CHECK1                      2512
 #define IDC_CONFIRM_CHANGE_PASTE        2512
 #define IDC_CURSOR_CTRL_SEQ             2512

Modified: trunk/teraterm/teraterm/clipboar.c
===================================================================
--- trunk/teraterm/teraterm/clipboar.c	2010-05-20 15:37:49 UTC (rev 3901)
+++ trunk/teraterm/teraterm/clipboar.c	2010-05-20 22:40:51 UTC (rev 3902)
@@ -313,8 +313,8 @@
 	RECT rc_dsk, rc_dlg;
 	int dlg_height, dlg_width;
 	OSVERSIONINFO osvi;
-	static int ok2right, info2bottom, edit2ok, edit2info;
-	RECT rc_edit, rc_ok, rc_cancel, rc_info;
+	static int ok2right, edit2ok, edit2bottom;
+	RECT rc_edit, rc_ok, rc_cancel;
 	// for status bar
 	static HWND hStatus = NULL;
 	static init_width, init_height;
@@ -333,7 +333,6 @@
 			GetObject(font, sizeof(LOGFONT), &logfont);
 			if (get_lang_font("DLG_TAHOMA_FONT", hDlgWnd, &logfont, &DlgClipboardFont, ts.UILanguageFile)) {
 				SendDlgItemMessage(hDlgWnd, IDC_EDIT, WM_SETFONT, (WPARAM)DlgClipboardFont, MAKELPARAM(TRUE,0));
-				SendDlgItemMessage(hDlgWnd, IDC_CLIPBOARD_INFO, WM_SETFONT, (WPARAM)DlgClipboardFont, MAKELPARAM(TRUE,0));
 				SendDlgItemMessage(hDlgWnd, IDOK, WM_SETFONT, (WPARAM)DlgClipboardFont, MAKELPARAM(TRUE,0));
 				SendDlgItemMessage(hDlgWnd, IDCANCEL, WM_SETFONT, (WPARAM)DlgClipboardFont, MAKELPARAM(TRUE,0));
 			}
@@ -344,9 +343,6 @@
 			GetWindowText(hDlgWnd, uimsg, sizeof(uimsg));
 			get_lang_msg("DLG_CLIPBOARD_TITLE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
 			SetWindowText(hDlgWnd, ts.UIMsg);
-			GetDlgItemText(hDlgWnd, IDC_CLIPBOARD_INFO, uimsg, sizeof(uimsg));
-			get_lang_msg("DLG_CLIPBOARD_INFO", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-			SetDlgItemText(hDlgWnd, IDC_CLIPBOARD_INFO, ts.UIMsg);
 			GetDlgItemText(hDlgWnd, IDCANCEL, uimsg, sizeof(uimsg));
 			get_lang_msg("BTN_CANCEL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
 			SetDlgItemText(hDlgWnd, IDCANCEL, ts.UIMsg);
@@ -410,15 +406,13 @@
 			GetClientRect(hDlgWnd,                                 &rc_dlg);
 			GetWindowRect(GetDlgItem(hDlgWnd, IDC_EDIT),           &rc_edit);
 			GetWindowRect(GetDlgItem(hDlgWnd, IDOK),               &rc_ok);
-			GetWindowRect(GetDlgItem(hDlgWnd, IDC_CLIPBOARD_INFO), &rc_info);
 
 			p.x = rc_dlg.right;
 			p.y = rc_dlg.bottom;
 			ClientToScreen(hDlgWnd, &p);
 			ok2right = p.x - rc_ok.left;
-			info2bottom = p.y - rc_info.top;
+			edit2bottom = p.y - rc_edit.bottom;
 			edit2ok = rc_ok.left - rc_edit.right;
-			edit2info = rc_info.top - rc_edit.bottom;
 
 			// ƒTƒCƒY‚𕜌³
 			SetWindowPos(hDlgWnd, NULL, 0, 0,
@@ -441,16 +435,18 @@
 					HGLOBAL hMem;
 					char *buf;
 
-					hMem = GlobalAlloc(GMEM_MOVEABLE, len + 1);
-					buf = GlobalLock(hMem);
-					SendMessage(GetDlgItem(hDlgWnd, IDC_EDIT), WM_GETTEXT, len + 1, (LPARAM)buf);
-					GlobalUnlock(hMem);
+					if (OpenClipboard(hDlgWnd) != 0) {
+						hMem = GlobalAlloc(GMEM_MOVEABLE, len + 1);
+						buf = GlobalLock(hMem);
+						SendMessage(GetDlgItem(hDlgWnd, IDC_EDIT), WM_GETTEXT, len + 1, (LPARAM)buf);
+						GlobalUnlock(hMem);
 
-					EmptyClipboard();
-					SetClipboardData(CF_TEXT, hMem);
+						EmptyClipboard();
+						SetClipboardData(CF_TEXT, hMem);
+						CloseClipboard();
+						// hMem‚̓NƒŠƒbƒvƒ{[ƒh‚ª•ÛŽ‚µ‚Ä‚¢‚é‚̂ŁA”jŠü‚µ‚Ä‚Í‚¢‚¯‚È‚¢B
+					}
 
-					// hMem‚̓NƒŠƒbƒvƒ{[ƒh‚ª•ÛŽ‚µ‚Ä‚¢‚é‚̂ŁA”jŠü‚µ‚Ä‚Í‚¢‚¯‚È‚¢B
-
 					if (DlgClipboardFont != NULL) {
 						DeleteObject(DlgClipboardFont);
 					}
@@ -495,7 +491,6 @@
 				GetWindowRect(GetDlgItem(hDlgWnd, IDC_EDIT),           &rc_edit);
 				GetWindowRect(GetDlgItem(hDlgWnd, IDOK),               &rc_ok);
 				GetWindowRect(GetDlgItem(hDlgWnd, IDCANCEL),           &rc_cancel);
-				GetWindowRect(GetDlgItem(hDlgWnd, IDC_CLIPBOARD_INFO), &rc_info);
 
 				// OK
 				p.x = rc_ok.left;
@@ -513,20 +508,12 @@
 				             dlg_w - ok2right, p.y, 0, 0,
 				             SWP_NOSIZE | SWP_NOZORDER);
 
-				// INFO
-				p.x = rc_info.left;
-				p.y = rc_info.top;
-				ScreenToClient(hDlgWnd, &p);
-				SetWindowPos(GetDlgItem(hDlgWnd, IDC_CLIPBOARD_INFO), 0,
-				             p.x, dlg_h - info2bottom, 0, 0,
-				             SWP_NOSIZE | SWP_NOZORDER);
-
 				// EDIT
 				p.x = rc_edit.left;
 				p.y = rc_edit.top;
 				ScreenToClient(hDlgWnd, &p);
 				SetWindowPos(GetDlgItem(hDlgWnd, IDC_EDIT), 0,
-				             0, 0, dlg_w - p.x - edit2ok - ok2right, dlg_h - p.y - edit2info - info2bottom,
+				             0, 0, dlg_w - p.x - edit2ok - ok2right, dlg_h - p.y - edit2bottom,
 				             SWP_NOMOVE | SWP_NOZORDER);
 
 				// ƒTƒCƒY‚ð•Û‘¶
@@ -644,30 +631,33 @@
 		}
 
 		if (confirm) {
-			ClipboardPtr = pText;
+			ClipboardPtr = (char *)calloc(sizeof(char), strlen(pText)+1);
+			memcpy(ClipboardPtr, pText, strlen(pText));
+			GlobalUnlock(hText);
+			CloseClipboard();
 			PasteCanceled = 0;
 			ret = DialogBox(hInst, MAKEINTRESOURCE(IDD_CLIPBOARD_DIALOG),
-							HVTWin, (DLGPROC)OnClipboardDlgProc);
+			                HVTWin, (DLGPROC)OnClipboardDlgProc);
+			free(ClipboardPtr);
 			if (ret == 0 || ret == -1) {
 				ret = GetLastError();
 			}
 
 			if (PasteCanceled) {
 				ret = 0;
-				GlobalUnlock(hText);
-				CloseClipboard();
 				goto error;
 			}
 
 		}
+		else {
+			GlobalUnlock(hText);
+			CloseClipboard();
+		}
 
 		ret = 1;
 
-		GlobalUnlock(hText);
 	}
 
-	CloseClipboard();
-
 error:
 	return (ret);
 }

Modified: trunk/teraterm/teraterm/ttermpro.rc
===================================================================
--- trunk/teraterm/teraterm/ttermpro.rc	2010-05-20 15:37:49 UTC (rev 3901)
+++ trunk/teraterm/teraterm/ttermpro.rc	2010-05-20 22:40:51 UTC (rev 3902)
@@ -270,8 +270,7 @@
 BEGIN
     DEFPUSHBUTTON   "OK",IDOK,161,5,50,14
     PUSHBUTTON      "Cancel",IDCANCEL,161,25,50,14
-    EDITTEXT        IDC_EDIT,5,5,150,100,ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL
-    LTEXT           "Currently, Clipboard has been locked.",IDC_CLIPBOARD_INFO,5,110,206,10
+    EDITTEXT        IDC_EDIT,5,5,150,112,ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL
 END
 
 



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