Revision: 8692 https://osdn.net/projects/ttssh2/scm/svn/commits/8692 Author: zmatsuo Date: 2020-04-12 00:54:28 +0900 (Sun, 12 Apr 2020) Log Message: ----------- CStatDlg を Unicode化 Modified Paths: -------------- trunk/teraterm/ttpmacro/statdlg.cpp trunk/teraterm/ttpmacro/statdlg.h trunk/teraterm/ttpmacro/ttl_gui.cpp trunk/teraterm/ttpmacro/ttmdlg.cpp trunk/teraterm/ttpmacro/ttmdlg.h -------------- next part -------------- Modified: trunk/teraterm/ttpmacro/statdlg.cpp =================================================================== --- trunk/teraterm/ttpmacro/statdlg.cpp 2020-04-11 15:54:20 UTC (rev 8691) +++ trunk/teraterm/ttpmacro/statdlg.cpp 2020-04-11 15:54:28 UTC (rev 8692) @@ -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: trunk/teraterm/ttpmacro/statdlg.h =================================================================== --- trunk/teraterm/ttpmacro/statdlg.h 2020-04-11 15:54:20 UTC (rev 8691) +++ trunk/teraterm/ttpmacro/statdlg.h 2020-04-11 15:54:28 UTC (rev 8692) @@ -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: trunk/teraterm/ttpmacro/ttl_gui.cpp =================================================================== --- trunk/teraterm/ttpmacro/ttl_gui.cpp 2020-04-11 15:54:20 UTC (rev 8691) +++ trunk/teraterm/ttpmacro/ttl_gui.cpp 2020-04-11 15:54:28 UTC (rev 8692) @@ -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: trunk/teraterm/ttpmacro/ttmdlg.cpp =================================================================== --- trunk/teraterm/ttpmacro/ttmdlg.cpp 2020-04-11 15:54:20 UTC (rev 8691) +++ trunk/teraterm/ttpmacro/ttmdlg.cpp 2020-04-11 15:54:28 UTC (rev 8692) @@ -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: trunk/teraterm/ttpmacro/ttmdlg.h =================================================================== --- trunk/teraterm/ttpmacro/ttmdlg.h 2020-04-11 15:54:20 UTC (rev 8691) +++ trunk/teraterm/ttpmacro/ttmdlg.h 2020-04-11 15:54:28 UTC (rev 8692) @@ -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();