[Ttssh2-commit] [8645] CStatDlg を Unicode化

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2020年 3月 28日 (土) 00:48:40 JST


Revision: 8645
          https://osdn.net/projects/ttssh2/scm/svn/commits/8645
Author:   zmatsuo
Date:     2020-03-28 00:48:40 +0900 (Sat, 28 Mar 2020)
Log Message:
-----------
CStatDlg を Unicode化

Modified Paths:
--------------
    branches/unicode_macro_2/teraterm/ttpmacro/statdlg.cpp
    branches/unicode_macro_2/teraterm/ttpmacro/statdlg.h
    branches/unicode_macro_2/teraterm/ttpmacro/ttl_gui.cpp
    branches/unicode_macro_2/teraterm/ttpmacro/ttmdlg.cpp
    branches/unicode_macro_2/teraterm/ttpmacro/ttmdlg.h

-------------- next part --------------
Modified: branches/unicode_macro_2/teraterm/ttpmacro/statdlg.cpp
===================================================================
--- branches/unicode_macro_2/teraterm/ttpmacro/statdlg.cpp	2020-03-27 15:48:29 UTC (rev 8644)
+++ branches/unicode_macro_2/teraterm/ttpmacro/statdlg.cpp	2020-03-27 15:48:40 UTC (rev 8645)
@@ -43,7 +43,7 @@
 
 // CStatDlg dialog
 
-BOOL CStatDlg::Create(HINSTANCE hInst, const TCHAR *Text, const TCHAR *Title, int x, int y)
+BOOL CStatDlg::Create(HINSTANCE hInst, const wchar_t *Text, const wchar_t *Title, int x, int y)
 {
 	TextStr = Text;
 	TitleStr = Title;
@@ -52,12 +52,12 @@
 	return TTCDialog::Create(hInst, NULL, CStatDlg::IDD);
 }
 
-void CStatDlg::Update(const TCHAR *Text, const TCHAR *Title, int x, int y)
+void CStatDlg::Update(const wchar_t *Text, const wchar_t *Title, int x, int y)
 {
 	RECT R;
 
 	if (Title!=NULL) {
-		SetWindowText(Title);
+		SetWindowTextW(Title);
 		TitleStr = Title;
 	}
 
@@ -70,12 +70,12 @@
 	if (Text!=NULL) {
 		SIZE textSize;
 		HWND hWnd = GetDlgItem(IDC_STATTEXT);
-		CalcTextExtent(hWnd, NULL, Text, &textSize);
+		CalcTextExtentW(hWnd, NULL, Text, &textSize);
 		TW = textSize.cx + textSize.cx/10;	// (cx * (1+0.1)) ?
 		TH = textSize.cy;
 		s = textSize;			// TODO s!?
 
-		SetDlgItemText(IDC_STATTEXT,Text);
+		SetDlgItemTextW(IDC_STATTEXT,Text);
 		TextStr = Text;
 	}
 

Modified: branches/unicode_macro_2/teraterm/ttpmacro/statdlg.h
===================================================================
--- branches/unicode_macro_2/teraterm/ttpmacro/statdlg.h	2020-03-27 15:48:29 UTC (rev 8644)
+++ branches/unicode_macro_2/teraterm/ttpmacro/statdlg.h	2020-03-27 15:48:40 UTC (rev 8645)
@@ -34,13 +34,13 @@
 class CStatDlg : public CMacroDlgBase
 {
 public:
-	BOOL Create(HINSTANCE hInst, const TCHAR *Text, const TCHAR *Title, int x, int y);
-	void Update(const TCHAR *Text, const TCHAR *Title, int x, int y);
+	BOOL Create(HINSTANCE hInst, const wchar_t *Text, const wchar_t *Title, int x, int y);
+	void Update(const wchar_t *Text, const wchar_t *Title, int x, int y);
 	void Bringup();
 	enum { IDD = IDD_STATDLG };
 private:
-	const TCHAR *TextStr;
-	const TCHAR *TitleStr;
+	const wchar_t *TextStr;
+	const wchar_t *TitleStr;
 	int  init_WW, TW, TH;
 	SIZE s;
 

Modified: branches/unicode_macro_2/teraterm/ttpmacro/ttl_gui.cpp
===================================================================
--- branches/unicode_macro_2/teraterm/ttpmacro/ttl_gui.cpp	2020-03-27 15:48:29 UTC (rev 8644)
+++ branches/unicode_macro_2/teraterm/ttpmacro/ttl_gui.cpp	2020-03-27 15:48:40 UTC (rev 8645)
@@ -237,7 +237,7 @@
 
 	Err = 0;
 	GetStrVal(Str1,&Err);
-	wc Str1T = tc::fromUtf8(Str1);
+	wc Str1T = wc::fromUtf8(Str1);
 
 	if (Err!=0) return Err;
 
@@ -489,7 +489,7 @@
 		return (ret);
 	}
 	else if (BoxId==IdStatusBox) {
-		OpenStatDlg(tc::fromUtf8(Str1),tc::fromUtf8(Str2));
+		OpenStatDlg(wc::fromUtf8(Str1), wc::fromUtf8(Str2));
 
 	} else if (BoxId==IdListBox) {
 		//  \x83\x8A\x83X\x83g\x83{\x83b\x83N\x83X\x82̑I\x91\xF0\x8E\x88\x82\xF0\x8E擾\x82\xB7\x82\xE9\x81B

Modified: branches/unicode_macro_2/teraterm/ttpmacro/ttmdlg.cpp
===================================================================
--- branches/unicode_macro_2/teraterm/ttpmacro/ttmdlg.cpp	2020-03-27 15:48:29 UTC (rev 8644)
+++ branches/unicode_macro_2/teraterm/ttpmacro/ttmdlg.cpp	2020-03-27 15:48:40 UTC (rev 8645)
@@ -246,7 +246,7 @@
 	return MsgDlg.DoModal(hInst, hWndParent);
 }
 
-void OpenStatDlg(const TCHAR *Text, const TCHAR *Caption)
+void OpenStatDlg(const wchar_t *Text, const wchar_t *Caption)
 {
 	if (StatDlg==NULL) {
 		HINSTANCE hInst = GetInstance();

Modified: branches/unicode_macro_2/teraterm/ttpmacro/ttmdlg.h
===================================================================
--- branches/unicode_macro_2/teraterm/ttpmacro/ttmdlg.h	2020-03-27 15:48:29 UTC (rev 8644)
+++ branches/unicode_macro_2/teraterm/ttpmacro/ttmdlg.h	2020-03-27 15:48:40 UTC (rev 8645)
@@ -44,7 +44,7 @@
                 const wchar_t *Default, BOOL Paswd);
 int OpenErrDlg(const char *Msg, const char *Line, int lineno, int start, int end, const char *FileName);
 int OpenMsgDlg(const wchar_t *Text, const wchar_t *Caption, BOOL YesNo);
-void OpenStatDlg(const TCHAR *Text, const TCHAR *Caption);
+void OpenStatDlg(const wchar_t *Text, const wchar_t *Caption);
 void CloseStatDlg();
 void BringupStatDlg();
 


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