[Ttssh2-commit] [5752] チケット #34762

svnno****@sourc***** svnno****@sourc*****
2015年 1月 2日 (金) 16:48:25 JST


Revision: 5752
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5752
Author:   yutakapon
Date:     2015-01-02 16:48:24 +0900 (Fri, 02 Jan 2015)
Log Message:
-----------
チケット #34762
マクロウィンドウをリサイズ可能にした。

Ticket Links:
------------
    http://sourceforge.jp/projects/ttssh2/tracker/detail/34762

Modified Paths:
--------------
    trunk/teraterm/ttpmacro/ttmbuff.c
    trunk/teraterm/ttpmacro/ttmmain.cpp
    trunk/teraterm/ttpmacro/ttmmain.h
    trunk/teraterm/ttpmacro/ttpmacro.rc

-------------- next part --------------
Modified: trunk/teraterm/ttpmacro/ttmbuff.c
===================================================================
--- trunk/teraterm/ttpmacro/ttmbuff.c	2014-12-31 12:32:37 UTC (rev 5751)
+++ trunk/teraterm/ttpmacro/ttmbuff.c	2015-01-02 07:48:24 UTC (rev 5752)
@@ -20,7 +20,7 @@
 
 #define MAXNESTLEVEL 10
 
-#define MAXFILENAME 32   // .ttl\x83t\x83@\x83C\x83\x8B\x96\xBC\x82̍ő\xE5\x83T\x83C\x83Y
+#define MAXFILENAME 128   // .ttl\x83t\x83@\x83C\x83\x8B\x96\xBC\x82̍ő\xE5\x83T\x83C\x83Y
 
 static int INest;
 static HANDLE BuffHandle[MAXNESTLEVEL];

Modified: trunk/teraterm/ttpmacro/ttmmain.cpp
===================================================================
--- trunk/teraterm/ttpmacro/ttmmain.cpp	2014-12-31 12:32:37 UTC (rev 5751)
+++ trunk/teraterm/ttpmacro/ttmmain.cpp	2015-01-02 07:48:24 UTC (rev 5752)
@@ -49,6 +49,7 @@
 	char Temp[2];
 
 	if (TTLStatus==IdTTLEnd) {
+		::DestroyWindow(m_hStatus);
 		DestroyWindow();
 		return FALSE;
 	}
@@ -193,6 +194,8 @@
 	ON_WM_DESTROY()
 	ON_WM_ERASEBKGND()
 	ON_WM_PAINT()
+	ON_WM_SIZE()
+	ON_WM_GETMINMAXINFO()
 	ON_WM_QUERYDRAGICON()
 	ON_WM_SYSCOLORCHANGE()
 	ON_WM_TIMER()
@@ -218,6 +221,8 @@
 	LOGFONT logfont;
 	HFONT font;
 	int fuLoad = LR_DEFAULTCOLOR;
+	RECT rc_dlg, rc_filename, rc_lineno;
+	LONG dlg_len, len;
 
 	CDialog::OnInitDialog();
 
@@ -286,6 +291,32 @@
 	// send the initialization signal to TT
 	SendCmnd(CmdInit,0);
 
+	// \x83_\x83C\x83A\x83\x8D\x83O\x82̏\x89\x8A\xFA\x83T\x83C\x83Y\x82\xF0\x95ۑ\xB6
+	GetWindowRect(&rc_dlg);
+	m_init_width = rc_dlg.right - rc_dlg.left;
+	m_init_height = rc_dlg.bottom - rc_dlg.top;
+
+	/* \x83}\x83N\x83\x8D\x83E\x83B\x83\x93\x83h\x83E\x82\xF0\x83\x8A\x83T\x83C\x83Y\x89”\\x82ɂ\xB7\x82\xE9\x81B
+	 * (2015.1.2 yutaka)
+	 */
+	// \x8C\xBB\x8D݃T\x83C\x83Y\x82\xA9\x82\xE7\x95K\x97v\x82Ȓl\x82\xF0\x8Cv\x8EZ
+	GetClientRect(&rc_dlg);
+	ClientToScreen(&rc_dlg);
+	dlg_len = rc_dlg.right - rc_dlg.left;
+
+	GetDlgItem(IDC_FILENAME)->GetWindowRect(&rc_filename);
+	len = rc_filename.right - rc_filename.left;
+	m_filename_ratio = len*100 / dlg_len;
+
+	GetDlgItem(IDC_LINENO)->GetWindowRect(&rc_lineno);
+	len = rc_lineno.right - rc_lineno.left;
+	m_lineno_ratio = len * 100 / dlg_len;
+
+	// \x83\x8A\x83T\x83C\x83Y\x83A\x83C\x83R\x83\x93\x82\xF0\x89E\x89\xBA\x82ɕ\\x8E\xA6\x82\xB3\x82\xB9\x82\xBD\x82\xA2\x82̂ŁA\x83X\x83e\x81[\x83^\x83X\x83o\x81[\x82\xF0\x95t\x82\xAF\x82\xE9\x81B
+	m_hStatus = CreateStatusWindow(
+		WS_CHILD | WS_VISIBLE |
+		CCS_BOTTOM | SBARS_SIZEGRIP, NULL, GetSafeHwnd(), 1);
+
 	if (VOption) {
 		return TRUE;
 	}
@@ -296,11 +327,13 @@
 		CmdShow = SW_SHOWDEFAULT;
 	}
 	ShowWindow(CmdShow);
+
 	return TRUE;
 }
 
 void CCtrlWindow::OnCancel( )
 {
+	::DestroyWindow(m_hStatus);
 	DestroyWindow();
 }
 
@@ -379,6 +412,56 @@
 	dc.SetMapMode(OldMapMode);
 }
 
+// \x83}\x83N\x83\x8D\x83E\x83B\x83\x93\x83h\x83E\x82\xF0\x83\x8A\x83T\x83C\x83Y\x89”\\x82Ƃ\xB7\x82邽\x82߂ɁAOnSize\x83n\x83\x93\x83h\x83\x89\x82\xF0override\x82\xB7\x82\xE9\x81B
+// (2015.1.1 yutaka)
+void CCtrlWindow::OnSize(UINT nType, int cx, int cy)
+{
+	RECT rc_dlg, rc_filename, rc_lineno;
+	LONG new_w, new_h, new_x, new_y;
+	LONG len;
+
+	GetClientRect(&rc_dlg);
+	ClientToScreen(&rc_dlg);
+	len = rc_dlg.right - rc_dlg.left;
+
+	// TTL\x83t\x83@\x83C\x83\x8B\x96\xBC\x82̍Ĕz\x92u
+	GetDlgItem(IDC_FILENAME)->GetWindowRect(&rc_filename);
+	ScreenToClient(&rc_filename);
+	new_w = (len * m_filename_ratio) / 100;
+	new_h = rc_filename.bottom - rc_filename.top;
+	GetDlgItem(IDC_FILENAME)->SetWindowPos(&CWnd::wndBottom,
+		0, 0, new_w, new_h,
+		SWP_NOMOVE | SWP_NOZORDER
+	);
+	new_x = rc_filename.left + new_w;
+
+	// \x8Ds\x94ԍ\x86\x82̍Ĕz\x92u
+	GetDlgItem(IDC_LINENO)->GetWindowRect(&rc_lineno);
+	ScreenToClient(&rc_lineno);
+	new_w = (len * m_lineno_ratio) / 100;
+	new_h = rc_lineno.bottom - rc_lineno.top;
+	new_y = rc_lineno.top;
+	GetDlgItem(IDC_LINENO)->SetWindowPos(&CWnd::wndBottom,
+		new_x, new_y, new_w, new_h,
+		SWP_NOZORDER
+		);
+
+	// status bar
+	::SendMessage(m_hStatus, WM_SIZE, cx, cy);
+}
+
+// \x83}\x83N\x83\x8D\x83E\x83B\x83\x93\x83h\x83E\x82\xF0\x83\x8A\x83T\x83C\x83Y\x89”\\x82Ƃ\xB7\x82邽\x82߂ɁAOnGetMinMaxInfo\x83n\x83\x93\x83h\x83\x89\x82\xF0override\x82\xB7\x82\xE9\x81B
+// (2015.1.1 yutaka)
+void CCtrlWindow::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
+{
+	LPMINMAXINFO lpmmi;
+
+	// \x83_\x83C\x83A\x83\x8D\x83O\x82̏\x89\x8A\xFA\x83T\x83C\x83Y\x82\xE6\x82菬\x82\xB3\x82\xAD\x82ł\xAB\x82Ȃ\xA2\x82悤\x82ɂ\xB7\x82\xE9
+	lpmmi = (LPMINMAXINFO)lpMMI;
+	lpmmi->ptMinTrackSize.x = m_init_width;
+	lpmmi->ptMinTrackSize.y = m_init_height;
+}
+
 // for icon drawing in Win NT 3.5
 HCURSOR CCtrlWindow::OnQueryDragIcon()
 {

Modified: trunk/teraterm/ttpmacro/ttmmain.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmmain.h	2014-12-31 12:32:37 UTC (rev 5751)
+++ trunk/teraterm/ttpmacro/ttmmain.h	2015-01-02 07:48:24 UTC (rev 5752)
@@ -34,12 +34,18 @@
 	HICON m_hIcon;
 	HFONT DlgFont;
 
+	LONG m_init_width, m_init_height;
+	LONG m_filename_ratio, m_lineno_ratio;
+	HWND m_hStatus;
+
 	//{{AFX_MSG(CCtrlWindow)
 	virtual BOOL OnInitDialog();
 	afx_msg void OnClose();
 	afx_msg void OnDestroy();
 	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
 	afx_msg void OnPaint();
+	afx_msg void OnSize(UINT nType, int cx, int cy);
+	afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
 	afx_msg HCURSOR OnQueryDragIcon();
 	afx_msg void OnSysColorChange();
 	afx_msg void OnTimer(UINT nIDEvent);

Modified: trunk/teraterm/ttpmacro/ttpmacro.rc
===================================================================
--- trunk/teraterm/ttpmacro/ttpmacro.rc	2014-12-31 12:32:37 UTC (rev 5751)
+++ trunk/teraterm/ttpmacro/ttpmacro.rc	2015-01-02 07:48:24 UTC (rev 5752)
@@ -49,15 +49,15 @@
 // Dialog
 //
 
-IDD_CTRLWIN DIALOGEX 20, 20, 116, 42
-STYLE DS_SETFONT | DS_3DLOOK | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU
+IDD_CTRLWIN DIALOGEX 20, 20, 116, 51
+STYLE DS_SETFONT | DS_3DLOOK | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
 CAPTION "MACRO"
 FONT 14, "System", 0, 0, 0x0
 BEGIN
     DEFPUSHBUTTON   "&Pau&se",IDC_CTRLPAUSESTART,21,14,30,14
     PUSHBUTTON      "&End",IDC_CTRLEND,65,14,30,14
-    LTEXT           "LineNo:",IDC_LINENO,42,32,70,8
-    RTEXT           "FILENAME",IDC_FILENAME,3,32,35,8,SS_ENDELLIPSIS
+    LTEXT           "LineNo:",IDC_LINENO,42,34,70,8
+    RTEXT           "FILENAME",IDC_FILENAME,3,34,35,8,SS_ENDELLIPSIS
 END
 
 IDD_ERRDLG DIALOGEX 20, 20, 263, 49
@@ -120,6 +120,7 @@
 BEGIN
     IDD_CTRLWIN, DIALOG
     BEGIN
+        BOTTOMMARGIN, 42
     END
 
     IDD_ERRDLG, DIALOG



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