[Ttssh2-commit] [5179] box 系マクロコマンドの表示位置がおかしくなる問題を修正

svnno****@sourc***** svnno****@sourc*****
2013年 3月 27日 (水) 22:41:26 JST


Revision: 5179
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5179
Author:   maya
Date:     2013-03-27 22:41:26 +0900 (Wed, 27 Mar 2013)
Log Message:
-----------
box 系マクロコマンドの表示位置がおかしくなる問題を修正
  http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=31049

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/ttpmacro/errdlg.cpp
    trunk/teraterm/ttpmacro/inpdlg.cpp
    trunk/teraterm/ttpmacro/msgdlg.cpp
    trunk/teraterm/ttpmacro/statdlg.cpp
    trunk/teraterm/ttpmacro/ttmdlg.cpp
    trunk/teraterm/ttpmacro/ttmlib.c
    trunk/teraterm/ttpmacro/ttmlib.h

-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2013-03-27 12:32:03 UTC (rev 5178)
+++ trunk/doc/en/html/about/history.html	2013-03-27 13:41:26 UTC (rev 5179)
@@ -60,6 +60,7 @@
     <ul>
       <li>Can not open a file including the IPv6 address in the &h of the log file.</li>
       <!--li><a href="../setup/teraterm-misc.html#LogLockExclusive">LogLockExclusive</a>\x82\xF0off\x82ɂ\xB5\x82Ă\xE0\x94r\x91\xBC\x83\x8D\x83b\x83N\x82\xAA\x82\xA9\x82\xA9\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li-->
+      <!--li>\x83}\x83\x8B\x83`\x83f\x83B\x83X\x83v\x83\x8C\x83C\x8A‹\xAB\x82\xC5 box \x8Cn\x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82̃_\x83C\x83A\x83\x8D\x83O\x95\\x8E\xA6\x88ʒu\x82\xAA\x82\xA8\x82\xA9\x82\xB5\x82\xAD\x82Ȃ\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li-->
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2013-03-27 12:32:03 UTC (rev 5178)
+++ trunk/doc/ja/html/about/history.html	2013-03-27 13:41:26 UTC (rev 5179)
@@ -59,6 +59,7 @@
     <ul>
       <li>\x83f\x83t\x83H\x83\x8B\x83g\x83\x8D\x83O\x83t\x83@\x83C\x83\x8B\x96\xBC\x82\xCC&h\x82\xC9IPv6\x83A\x83h\x83\x8C\x83X\x82\xF0\x8A܂߂\xE9\x82ƁA\x83t\x83@\x83C\x83\x8B\x82\xAA\x83I\x81[\x83v\x83\x93\x82ł\xAB\x82Ȃ\xA2\x81B</li>
       <li><a href="../setup/teraterm-misc.html#LogLockExclusive">LogLockExclusive</a>\x82\xF0off\x82ɂ\xB5\x82Ă\xE0\x94r\x91\xBC\x83\x8D\x83b\x83N\x82\xAA\x82\xA9\x82\xA9\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
+      <li>\x83}\x83\x8B\x83`\x83f\x83B\x83X\x83v\x83\x8C\x83C\x8A‹\xAB\x82\xC5 box \x8Cn\x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82̃_\x83C\x83A\x83\x8D\x83O\x95\\x8E\xA6\x88ʒu\x82\xAA\x82\xA8\x82\xA9\x82\xB5\x82\xAD\x82Ȃ\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
     </ul>
   </li>
 

Modified: trunk/teraterm/ttpmacro/errdlg.cpp
===================================================================
--- trunk/teraterm/ttpmacro/errdlg.cpp	2013-03-27 12:32:03 UTC (rev 5178)
+++ trunk/teraterm/ttpmacro/errdlg.cpp	2013-03-27 13:41:26 UTC (rev 5179)
@@ -65,7 +65,7 @@
 	SetDlgItemText(IDC_ERRMSG,MsgStr);
 	SetDlgItemText(IDC_ERRLINE,LineStr);
 
-	if (PosX<=-100) {
+	if (PosX<=GetMonitorLeftmost(PosX, PosY)-100) {
 		GetWindowRect(&R);
 		TmpDC = ::GetDC(GetSafeHwnd());
 		PosX = (GetDeviceCaps(TmpDC,HORZRES)-R.right+R.left) / 2;

Modified: trunk/teraterm/ttpmacro/inpdlg.cpp
===================================================================
--- trunk/teraterm/ttpmacro/inpdlg.cpp	2013-03-27 12:32:03 UTC (rev 5178)
+++ trunk/teraterm/ttpmacro/inpdlg.cpp	2013-03-27 13:41:26 UTC (rev 5179)
@@ -175,7 +175,7 @@
 
 	SendDlgItemMessage(IDC_INPEDIT, EM_LIMITTEXT, MaxStrLen, 0);
 
-	if (PosX<=-100) {
+	if (PosX<=GetMonitorLeftmost(PosX, PosY)-100) {
 		GetWindowRect(&R);
 		TmpDC = ::GetDC(GetSafeHwnd());
 		PosX = (GetDeviceCaps(TmpDC,HORZRES)-R.right+R.left) / 2;

Modified: trunk/teraterm/ttpmacro/msgdlg.cpp
===================================================================
--- trunk/teraterm/ttpmacro/msgdlg.cpp	2013-03-27 12:32:03 UTC (rev 5178)
+++ trunk/teraterm/ttpmacro/msgdlg.cpp	2013-03-27 13:41:26 UTC (rev 5179)
@@ -170,7 +170,7 @@
 		::MoveWindow(HOk,(TW-BW)/2,TH+BH,BW,BH,TRUE);
 	}
 
-	if (PosX<=-100) {
+	if (PosX<=GetMonitorLeftmost(PosX, PosY)-100) {
 		TmpDC = ::GetDC(GetSafeHwnd());
 		PosX = (GetDeviceCaps(TmpDC,HORZRES)-WW) / 2;
 		PosY = (GetDeviceCaps(TmpDC,VERTRES)-WH) / 2;

Modified: trunk/teraterm/ttpmacro/statdlg.cpp
===================================================================
--- trunk/teraterm/ttpmacro/statdlg.cpp	2013-03-27 12:32:03 UTC (rev 5178)
+++ trunk/teraterm/ttpmacro/statdlg.cpp	2013-03-27 13:41:26 UTC (rev 5179)
@@ -200,7 +200,7 @@
 		::MoveWindow(HText,(TW-s.cx)/2,5,TW,TH,TRUE);
 	}
 
-	if (PosX<=-100) {
+	if (PosX<=GetMonitorLeftmost(PosX, PosY)-100) {
 		TmpDC = ::GetDC(GetSafeHwnd());
 		PosX = (GetDeviceCaps(TmpDC,HORZRES)-WW) / 2;
 		PosY = (GetDeviceCaps(TmpDC,VERTRES)-WH) / 2;

Modified: trunk/teraterm/ttpmacro/ttmdlg.cpp
===================================================================
--- trunk/teraterm/ttpmacro/ttmdlg.cpp	2013-03-27 12:32:03 UTC (rev 5178)
+++ trunk/teraterm/ttpmacro/ttmdlg.cpp	2013-03-27 13:41:26 UTC (rev 5179)
@@ -37,7 +37,7 @@
 int ParamCnt;   /* \x88\xF8\x90\x94\x82̌\x94 */
 }
 
-static int DlgPosX = -1000;
+static int DlgPosX = -10000;
 static int DlgPosY = 0;
 
 static PStatDlg StatDlg = NULL;

Modified: trunk/teraterm/ttpmacro/ttmlib.c
===================================================================
--- trunk/teraterm/ttpmacro/ttmlib.c	2013-03-27 12:32:03 UTC (rev 5178)
+++ trunk/teraterm/ttpmacro/ttmlib.c	2013-03-27 13:41:26 UTC (rev 5179)
@@ -187,3 +187,29 @@
 	}
 	return 1;
 }
+
+int GetMonitorLeftmost(int PosX, int PosY)
+{
+	OSVERSIONINFO osvi;
+
+	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+	GetVersionEx(&osvi);
+	if ( (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
+	     (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && osvi.dwMinorVersion < 10) ) {
+		// // NT4.0, 95 \x82̓}\x83\x8B\x83`\x83\x82\x83j\x83^API\x82ɔ\xF1\x91Ή\x9E
+		return 0;
+	}
+	else {
+		HMONITOR hm;
+		POINT pt;
+		MONITORINFO mi;
+
+		pt.x = PosX;
+		pt.y = PosY;
+		hm = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
+
+		mi.cbSize = sizeof(MONITORINFO);
+		GetMonitorInfo(hm, &mi);
+		return mi.rcWork.left;
+	}
+}

Modified: trunk/teraterm/ttpmacro/ttmlib.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmlib.h	2013-03-27 12:32:03 UTC (rev 5178)
+++ trunk/teraterm/ttpmacro/ttmlib.h	2013-03-27 13:41:26 UTC (rev 5179)
@@ -15,6 +15,7 @@
 void TTMSetDir(PCHAR Dir);
 int GetAbsPath(PCHAR FName, int destlen);
 int GetSpecialFolder(PCHAR dest, int dest_len, PCHAR type);
+int GetMonitorLeftmost(int PosX, int PosY);
 
 #ifdef __cplusplus
 }



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