[Ttssh2-commit] [3721] ClearOnResize= offの実装。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 5日 (火) 11:18:25 JST


Revision: 3721
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3721
Author:   doda
Date:     2010-01-05 11:18:25 +0900 (Tue, 05 Jan 2010)

Log Message:
-----------
ClearOnResize=offの実装。
ClearOnResize=offにすると、ウィンドウサイズ変更時に表示内容がクリアされなくなる。
ただし、現状では縦幅を変更する時の動作がおかしい。
他にも色々と調整が必要。

http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=19711

Modified Paths:
--------------
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/buffer.c
    trunk/teraterm/ttpset/ttset.c


-------------- next part --------------
Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2010-01-01 04:56:43 UTC (rev 3720)
+++ trunk/teraterm/common/tttypes.h	2010-01-05 02:18:25 UTC (rev 3721)
@@ -181,6 +181,7 @@
 #define TF_ACCEPT8BITCTRL     32
 #define TF_ENABLESLINE        64
 #define TF_BACKWRAP           128
+#define TF_CLEARONRESIZE      256
 
 // ANSI/Attribute color flags (used in ts.ColorFlag)
 #define CF_PCBOLD16     1

Modified: trunk/teraterm/teraterm/buffer.c
===================================================================
--- trunk/teraterm/teraterm/buffer.c	2010-01-01 04:56:43 UTC (rev 3720)
+++ trunk/teraterm/teraterm/buffer.c	2010-01-05 02:18:25 UTC (rev 3721)
@@ -2805,18 +2805,41 @@
 
 		PageStart = BuffEnd - NumOfLines;
 	}
-	BuffScroll(NumOfLines,NumOfLines-1);
+
+	if (ts.TermFlag & TF_CLEARONRESIZE) {
+		BuffScroll(NumOfLines,NumOfLines-1);
+	}
+
 	/* Set Cursor */
-	CursorX = 0;
-	if (St) {
-		CursorY = NumOfLines-1;
-		CursorTop = CursorY;
-		CursorBottom = CursorY;
+	if (ts.TermFlag & TF_CLEARONRESIZE) {
+		CursorX = 0;
+		if (St) {
+			CursorY = NumOfLines-1;
+			CursorTop = CursorY;
+			CursorBottom = CursorY;
+		}
+		else {
+			CursorY = 0;
+			CursorTop = 0;
+			CursorBottom = NumOfLines-1-StatusLine;
+		}
 	}
 	else {
-		CursorY = 0;
-		CursorTop = 0;
-		CursorBottom = NumOfLines-1-StatusLine;
+		if (CursorX >= NumOfColumns) {
+			CursorX = NumOfColumns - 1;
+		}
+		if (St) {
+			CursorY = NumOfLines-1;
+			CursorTop = CursorY;
+			CursorBottom = CursorY;
+		}
+		else {
+			if (CursorY >= NumOfColumns - StatusLine) {
+				CursorY = NumOfLines - 1 - StatusLine;
+			}
+			CursorTop = 0;
+			CursorBottom = NumOfLines - 1 - StatusLine;
+		}
 	}
 
 	SelectStart.x = 0;
@@ -2854,8 +2877,11 @@
 	/* Change Window Size */
 	BuffChangeWinSize(W,H);
 	WinOrgY = -NumOfLines;
-	DispScrollHomePos();
 
+	if (ts.TermFlag & TF_CLEARONRESIZE) {
+		DispScrollHomePos();
+	}
+
 	if (cv.Ready && cv.TelFlag) {
 		TelInformWinSize(NumOfColumns,NumOfLines-StatusLine);
 	}

Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2010-01-01 04:56:43 UTC (rev 3720)
+++ trunk/teraterm/ttpset/ttset.c	2010-01-05 02:18:25 UTC (rev 3721)
@@ -1329,6 +1329,10 @@
 
 	// Line at a time mode
 	ts->EnableLineMode = GetOnOff(Section, "EnableLineMode", FName, TRUE);
+
+	// Clear window on resize
+	if (GetOnOff(Section, "ClearOnResize", FName, TRUE))
+		ts->TermFlag |= TF_CLEARONRESIZE;
 }
 
 void FAR PASCAL WriteIniFile(PCHAR FName, PTTSet ts)



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