[Ttssh2-commit] [5299] ウィンドウを並べて表示に対して、元に戻す (Undo) するメニューを追加した。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2013年 6月 2日 (日) 21:12:19 JST


Revision: 5299
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5299
Author:   yutakapon
Date:     2013-06-02 21:12:19 +0900 (Sun, 02 Jun 2013)
Log Message:
-----------
ウィンドウを並べて表示に対して、元に戻す(Undo)するメニューを追加した。

Modified Paths:
--------------
    trunk/installer/release/lang/English.lng
    trunk/installer/release/lang/French.lng
    trunk/installer/release/lang/German.lng
    trunk/installer/release/lang/Japanese.lng
    trunk/installer/release/lang/Korean.lng
    trunk/installer/release/lang/Russian.lng
    trunk/teraterm/common/ttcommon.h
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/teraterm/vtwin.h
    trunk/teraterm/ttpcmn/ttcmn.c
    trunk/teraterm/ttpcmn/ttpcmn.def

-------------- next part --------------
Modified: trunk/installer/release/lang/English.lng
===================================================================
--- trunk/installer/release/lang/English.lng	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/installer/release/lang/English.lng	2013-06-02 12:12:19 UTC (rev 5299)
@@ -80,6 +80,9 @@
 MENU_WINDOW_STACKED=&Stacked
 MENU_WINDOW_SIDEBYSIDE=Side &By Side
 MENU_WINDOW_RESTOREALL=&Restore All
+MENU_WINDOW_CASCADE_UNDO=&Undo - Cascade
+MENU_WINDOW_STACKED_UNDO=&Undo - Stacked
+MENU_WINDOW_SIDEBYSIDE_UNDO=&Undo - Side By Side
 
 MENU_HELP=&Help
 MENU_HELP_INDEX=&Index

Modified: trunk/installer/release/lang/French.lng
===================================================================
--- trunk/installer/release/lang/French.lng	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/installer/release/lang/French.lng	2013-06-02 12:12:19 UTC (rev 5299)
@@ -81,6 +81,9 @@
 MENU_WINDOW_STACKED=&Stacked
 MENU_WINDOW_SIDEBYSIDE=Side &By Side
 MENU_WINDOW_RESTOREALL=&Restore All
+MENU_WINDOW_CASCADE_UNDO=&Undo - Cascade
+MENU_WINDOW_STACKED_UNDO=&Undo - Stacked
+MENU_WINDOW_SIDEBYSIDE_UNDO=&Undo - Side By Side
 
 MENU_HELP=&Aide
 MENU_HELP_INDEX=&Index

Modified: trunk/installer/release/lang/German.lng
===================================================================
--- trunk/installer/release/lang/German.lng	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/installer/release/lang/German.lng	2013-06-02 12:12:19 UTC (rev 5299)
@@ -81,6 +81,9 @@
 MENU_WINDOW_STACKED=&Stacked
 MENU_WINDOW_SIDEBYSIDE=Side &By Side
 MENU_WINDOW_RESTOREALL=&Restore All
+MENU_WINDOW_CASCADE_UNDO=&Undo - Cascade
+MENU_WINDOW_STACKED_UNDO=&Undo - Stacked
+MENU_WINDOW_SIDEBYSIDE_UNDO=&Undo - Side By Side
 
 MENU_HELP=&Hilfe
 MENU_HELP_INDEX=&Hilfedatei

Modified: trunk/installer/release/lang/Japanese.lng
===================================================================
--- trunk/installer/release/lang/Japanese.lng	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/installer/release/lang/Japanese.lng	2013-06-02 12:12:19 UTC (rev 5299)
@@ -80,6 +80,9 @@
 MENU_WINDOW_STACKED=\x8F㉺\x82ɕ\xC0\x82ׂĕ\\x8E\xA6(&S)
 MENU_WINDOW_SIDEBYSIDE=\x8D\xB6\x89E\x82ɕ\xC0\x82ׂĕ\\x8E\xA6(&B)
 MENU_WINDOW_RESTOREALL=\x82\xB7\x82ׂĕ\x9C\x8C\xB3(&R)
+MENU_WINDOW_CASCADE_UNDO=\x8C\xB3\x82ɖ߂\xB7 - \x8Fd\x82˂ĕ\\x8E\xA6(&U)
+MENU_WINDOW_STACKED_UNDO=\x8C\xB3\x82ɖ߂\xB7 - \x8F㉺\x82ɕ\xC0\x82ׂĕ\\x8E\xA6(&U)
+MENU_WINDOW_SIDEBYSIDE_UNDO=\x8C\xB3\x82ɖ߂\xB7 - \x8D\xB6\x89E\x82ɕ\xC0\x82ׂĕ\\x8E\xA6(&U)
 
 MENU_HELP=\x83w\x83\x8B\x83v(&H)
 MENU_HELP_INDEX=\x96ڎ\x9F(&I)

Modified: trunk/installer/release/lang/Korean.lng
===================================================================
--- trunk/installer/release/lang/Korean.lng	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/installer/release/lang/Korean.lng	2013-06-02 12:12:19 UTC (rev 5299)
@@ -80,6 +80,9 @@
 MENU_WINDOW_STACKED=&Stacked
 MENU_WINDOW_SIDEBYSIDE=Side &By Side
 MENU_WINDOW_RESTOREALL=â \xBA\xB9\xB1\xB8(&R)
+MENU_WINDOW_CASCADE_UNDO=&Undo - Cascade
+MENU_WINDOW_STACKED_UNDO=&Undo - Stacked
+MENU_WINDOW_SIDEBYSIDE_UNDO=&Undo - Side By Side
 
 MENU_HELP=\xB5\xB5\xBF\xF2\xB8\xBB(&H)
 MENU_HELP_INDEX=\xC2\xF7\xB7\xCA(&I)

Modified: trunk/installer/release/lang/Russian.lng
===================================================================
--- trunk/installer/release/lang/Russian.lng	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/installer/release/lang/Russian.lng	2013-06-02 12:12:19 UTC (rev 5299)
@@ -81,6 +81,9 @@
 MENU_WINDOW_STACKED=&Stacked
 MENU_WINDOW_SIDEBYSIDE=Side &By Side
 MENU_WINDOW_RESTOREALL=&\xC2\xEE\xF1\xF1\xF2\xE0\xED\xEE\xE2\xE8\xF2\xFC \xEE\xEA\xED\xE0
+MENU_WINDOW_CASCADE_UNDO=&Undo - Cascade
+MENU_WINDOW_STACKED_UNDO=&Undo - Stacked
+MENU_WINDOW_SIDEBYSIDE_UNDO=&Undo - Side By Side
 
 MENU_HELP=&\xCF\xEE\xEC\xEE\xF9\xFC
 MENU_HELP_INDEX=&\xCF\xEE\xE8\xF1\xEA

Modified: trunk/teraterm/common/ttcommon.h
===================================================================
--- trunk/teraterm/common/ttcommon.h	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/teraterm/common/ttcommon.h	2013-06-02 12:12:19 UTC (rev 5299)
@@ -39,6 +39,7 @@
 void FAR PASCAL ShowAllWinStacked(HWND);
 void FAR PASCAL ShowAllWinCascade(HWND);
 void FAR PASCAL BroadcastClosingMessage(HWND myhwnd);
+void FAR PASCAL UndoAllWin();
 
 int FAR PASCAL CommReadRawByte(PComVar cv, LPBYTE b);
 int FAR PASCAL CommRead1Byte(PComVar cv, LPBYTE b);

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/teraterm/common/tttypes.h	2013-06-02 12:12:19 UTC (rev 5299)
@@ -991,6 +991,7 @@
 #define ID_WINDOW_CASCADEALL   50813
 #define ID_WINDOW_STACKED      50814
 #define ID_WINDOW_SIDEBYSIDE   50815
+#define ID_WINDOW_UNDO         50816
 #define ID_TEKWINDOW_WINDOW    51810
 
 #define ID_TRANSFER      9 // the position on [File] menu
@@ -1017,6 +1018,8 @@
 	unsigned char ComFlag[(MAXCOMPORT-1)/CHAR_BIT+1];
 	/* Previous window rect (Tera Term 4.78 or later) */
 	WINDOWPLACEMENT WinPrevRect[MAXNWIN];
+	BOOL WinUndoFlag;
+	int WinUndoStyle;
 } TMap;
 typedef TMap far *PMap;
 
@@ -1025,12 +1028,16 @@
  * Increment the number of this macro value
  * when you change TMap or member of TMap.
  *
+ * - At version 4.79, ttset_memfilemap was replaced with ttset_memfilemap_21.
+ *   added TMap.WinUndoFlag
+ *
  * - At version 4.78, ttset_memfilemap was replaced with ttset_memfilemap_20.
  *   added tttset.LogRotate
  *   added tttset.LogRotateSize
  *   added tttset.LogRotateSizeType
  *   added tttset.LogRotateStep
  *   added tttset.DeferredLogWriteMode
+ *   added TMap.WinPrevRect
  *
  * - At version 4.74, ttset_memfilemap was replaced with ttset_memfilemap_19.
  *   added tttset.FontQuality
@@ -1147,4 +1154,4 @@
  *   added tttset.VTCompatTab.
  */
 
-#define TT_FILEMAPNAME "ttset_memfilemap_20"
+#define TT_FILEMAPNAME "ttset_memfilemap_21"

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/teraterm/teraterm/vtwin.cpp	2013-06-02 12:12:19 UTC (rev 5299)
@@ -212,6 +212,7 @@
 	ON_COMMAND(ID_WINDOW_STACKED, OnWindowStacked)
 	ON_COMMAND(ID_WINDOW_SIDEBYSIDE, OnWindowSidebySide)
 	ON_COMMAND(ID_WINDOW_RESTOREALL, OnWindowRestoreAll)
+	ON_COMMAND(ID_WINDOW_UNDO, OnWindowUndo)
 	ON_COMMAND(ID_HELP_INDEX2, OnHelpIndex)
 	ON_COMMAND(ID_HELP_ABOUT, OnHelpAbout)
 	//}}AFX_MSG_MAP
@@ -5362,6 +5363,11 @@
 	ShowAllWin(SW_RESTORE);
 }
 
+void CVTWindow::OnWindowUndo()
+{
+	UndoAllWin();
+}
+
 void CVTWindow::OnHelpIndex()
 {
 	OpenHelp(HVTWin,HH_DISPLAY_TOPIC,0);

Modified: trunk/teraterm/teraterm/vtwin.h
===================================================================
--- trunk/teraterm/teraterm/vtwin.h	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/teraterm/teraterm/vtwin.h	2013-06-02 12:12:19 UTC (rev 5299)
@@ -181,6 +181,7 @@
 	afx_msg void OnWindowStacked();
 	afx_msg void OnWindowSidebySide();
 	afx_msg void OnWindowRestoreAll();
+	afx_msg void OnWindowUndo();
 	afx_msg void OnHelpIndex();
 	afx_msg void OnHelpUsing();
 	afx_msg void OnHelpAbout();

Modified: trunk/teraterm/ttpcmn/ttcmn.c
===================================================================
--- trunk/teraterm/ttpcmn/ttcmn.c	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/teraterm/ttpcmn/ttcmn.c	2013-06-02 12:12:19 UTC (rev 5299)
@@ -31,6 +31,13 @@
 #define TEKCLASSNAME "TEKWin32"
 
 
+enum window_style {
+	WIN_CASCADE,
+	WIN_STACKED,
+	WIN_SIDEBYSIDE,
+};
+
+
 void PASCAL CopyShmemToTTSet(PTTSet ts)
 {
 	// \x8C\xBB\x8D݂̐ݒ\xE8\x82\xF0\x8B\xA4\x97L\x83\x81\x83\x82\x83\x8A\x82\xA9\x82\xE7\x83R\x83s\x81[\x82\xB7\x82\xE9
@@ -942,6 +949,18 @@
 		get_lang_msg("MENU_WINDOW_SIDEBYSIDE", buf, buflen, "Side &by Side", langFile);
 		AppendMenu(menu, MF_ENABLED | MF_STRING, ID_WINDOW_SIDEBYSIDE, buf);
 
+		if (pm->WinUndoFlag) {
+			if (pm->WinUndoStyle == WIN_CASCADE)
+				get_lang_msg("MENU_WINDOW_CASCADE_UNDO", buf, buflen, "&Undo - Cascade", langFile);
+			else if (pm->WinUndoStyle == WIN_STACKED)
+				get_lang_msg("MENU_WINDOW_STACKED_UNDO", buf, buflen, "&Undo - Stacked", langFile);
+			else
+				get_lang_msg("MENU_WINDOW_SIDEBYSIDE_UNDO", buf, buflen, "&Undo - Side by Side", langFile);
+			AppendMenu(menu, MF_ENABLED | MF_STRING, ID_WINDOW_UNDO, buf);
+		} else {
+			RemoveMenu(menu, MF_BYCOMMAND, ID_WINDOW_UNDO);
+		}
+
 	}
 	else {
 		AppendMenu(menu,MF_ENABLED | MF_STRING,ID_TEKWINDOW_WINDOW, buf);
@@ -1030,14 +1049,17 @@
 	}
 }
 
-#if 0
-void FAR PASCAL ShowAllWin(int stat) {
+void FAR PASCAL UndoAllWin(void) {
 	int i;
 	WINDOWPLACEMENT rc0;
 	RECT rc;
 	HMONITOR hMonitor;
 	MONITORINFO mi;
+	int stat = SW_RESTORE;
 
+	// \x88\xEA\x93x\x81A\x95\x9C\x8C\xB3\x82\xB5\x82\xBD\x82\xE7\x83t\x83\x89\x83O\x82͗\x8E\x82Ƃ\xB7\x81B
+	pm->WinUndoFlag = FALSE;
+
 	memset(&rc0, 0, sizeof(rc0));
 
 	for (i=0; i < pm->NWin; i++) {
@@ -1085,7 +1107,6 @@
 		}
 	}
 }
-#endif
 
 HWND FAR PASCAL GetNthWin(int n)
 {
@@ -1099,11 +1120,24 @@
 
 
 // \x97L\x8C\xF8\x82ȃE\x83B\x83\x93\x83h\x83E\x82\xF0\x92T\x82\xB5\x81A\x8C\xBB\x8D݈ʒu\x82\xF0\x8BL\x89\xAF\x82\xB3\x82\xB9\x82Ă\xA8\x82\xAD\x81B
-static void get_valid_window_and_memorize_rect(HWND myhwnd, HWND hwnd[], int *num)
+static void get_valid_window_and_memorize_rect(HWND myhwnd, HWND hwnd[], int *num, int style)
 {
 	int i, n;
 	WINDOWPLACEMENT wndPlace;
 
+	// \x8C\xB3\x82ɖ߂\xB7(Undo)\x83\x81\x83j\x83\x85\x81[\x82͈\xEA\x93x\x82\xBE\x82\xAF\x95\\x8E\xA6\x82\xB3\x82\xB9\x82\xE9\x81B
+	if (pm->WinUndoFlag == FALSE) {
+		pm->WinUndoFlag = TRUE;
+	} else {
+		// \x82\xB7\x82łɃ\x81\x83j\x83\x85\x81[\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82āA\x82\xA9\x82ˆȑO\x82Ɠ\xAF\x82\xB6\x83X\x83^\x83C\x83\x8B\x82\xAA\x91I\x91\xF0\x82\xB3\x82ꂽ\x82\xE7\x81A
+		// \x83\x81\x83j\x83\x85\x81[\x82\xF0\x8F\xC1\x82\xB7\x81B
+		// Windows8\x82ł́A\x82\xB3\x82\xE7\x82ɘA\x91\xB1\x82\xB5\x82ē\xAF\x82\xB6\x83X\x83^\x83C\x83\x8B\x82\xF0\x91I\x91\xF0\x82\xB5\x82Ă\xE0\x83\x81\x83j\x83\x85\x81[\x82\xAA\x8F\xC1\x82\xA6\x82\xBD\x82܂܂\xBE\x82\xAA\x81A
+		// Tera Term\x82ł̓\x81\x83j\x83\x85\x81[\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82邽\x82߁A\x93\xAE\x8D삪\x88قȂ\xE9\x81B
+		if (pm->WinUndoStyle == style)
+			pm->WinUndoFlag = FALSE;
+	}
+	pm->WinUndoStyle = style;
+
 	n = 0;
 	for (i = 0 ; i < pm->NWin ; i++) {
 		// \x8C\xBB\x8D݈ʒu\x82\xF0\x8Ao\x82\xA6\x82Ă\xA8\x82\xAD\x81B
@@ -1129,7 +1163,7 @@
 	int n;
 	HWND hwnd[MAXNWIN];
 
-	get_valid_window_and_memorize_rect(myhwnd, hwnd, &n);
+	get_valid_window_and_memorize_rect(myhwnd, hwnd, &n, WIN_SIDEBYSIDE);
 	TileWindows(NULL, MDITILE_VERTICAL, NULL, n, hwnd);
 }
 
@@ -1139,7 +1173,7 @@
 	int n;
 	HWND hwnd[MAXNWIN];
 
-	get_valid_window_and_memorize_rect(myhwnd, hwnd, &n);
+	get_valid_window_and_memorize_rect(myhwnd, hwnd, &n, WIN_STACKED);
 	TileWindows(NULL, MDITILE_HORIZONTAL, NULL, n, hwnd);
 }
 
@@ -1149,7 +1183,7 @@
 	int n;
 	HWND hwnd[MAXNWIN];
 
-	get_valid_window_and_memorize_rect(myhwnd, hwnd, &n);
+	get_valid_window_and_memorize_rect(myhwnd, hwnd, &n, WIN_CASCADE);
 	CascadeWindows(NULL, MDITILE_SKIPDISABLED, NULL, n, hwnd);
 }
 

Modified: trunk/teraterm/ttpcmn/ttpcmn.def
===================================================================
--- trunk/teraterm/ttpcmn/ttpcmn.def	2013-05-30 15:40:12 UTC (rev 5298)
+++ trunk/teraterm/ttpcmn/ttpcmn.def	2013-06-02 12:12:19 UTC (rev 5299)
@@ -51,3 +51,4 @@
   ShowAllWinStacked @57
   ShowAllWinCascade @58
   BroadcastClosingMessage @59
+  UndoAllWin @60



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