[ttssh2-commit] [10487] ttdlg.cのlngファイルの参照をUnicode化した

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2023年 1月 15日 (日) 00:33:33 JST


Revision: 10487
          https://osdn.net/projects/ttssh2/scm/svn/commits/10487
Author:   zmatsuo
Date:     2023-01-15 00:33:33 +0900 (Sun, 15 Jan 2023)
Log Message:
-----------
ttdlg.cのlngファイルの参照をUnicode化した

- UILanguageFile の Unicode版 UILanguageFileW を使うよう修正
- ComPortInfoGet() で使用していない lang 引数を削除

Modified Paths:
--------------
    trunk/teraterm/common/comportinfo.cpp
    trunk/teraterm/common/comportinfo.h
    trunk/teraterm/ttpdlg/ttdlg.c
    trunk/tools/lscom/main.cpp

-------------- next part --------------
Modified: trunk/teraterm/common/comportinfo.cpp
===================================================================
--- trunk/teraterm/common/comportinfo.cpp	2023-01-14 15:33:22 UTC (rev 10486)
+++ trunk/teraterm/common/comportinfo.cpp	2023-01-14 15:33:33 UTC (rev 10487)
@@ -473,7 +473,7 @@
  *				NULL\x82̂Ƃ\xABcom\x83|\x81[\x83g\x82Ȃ\xB5
  *				\x8Eg\x97p\x8C\xE3ComPortInfoFree()\x82\xF0\x8CĂԂ\xB1\x82\xC6
  */
-ComPortInfo_t *ComPortInfoGet(int *count, const char *lang)
+ComPortInfo_t *ComPortInfoGet(int *count)
 {
 #if defined(_MSC_VER) && _MSC_VER > 1400
 	// VS2005\x82\xE6\x82肠\x82\xBD\x82炵\x82\xA2\x8Fꍇ\x82\xCD 9x \x82ŋN\x93\xAE\x82\xB5\x82Ȃ\xA2\x83o\x83C\x83i\x83\x8A\x82ƂȂ\xE9

Modified: trunk/teraterm/common/comportinfo.h
===================================================================
--- trunk/teraterm/common/comportinfo.h	2023-01-14 15:33:22 UTC (rev 10486)
+++ trunk/teraterm/common/comportinfo.h	2023-01-14 15:33:33 UTC (rev 10487)
@@ -39,7 +39,7 @@
 	wchar_t *property;			// \x91\xB6\x8D݂\xB5\x82Ȃ\xA2\x8Fꍇ\x82\xCD NULL
 } ComPortInfo_t;
 
-ComPortInfo_t *ComPortInfoGet(int *count, const char *lang);
+ComPortInfo_t *ComPortInfoGet(int *count);
 void ComPortInfoFree(ComPortInfo_t *info, int count);
 
 #ifdef __cplusplus

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2023-01-14 15:33:22 UTC (rev 10486)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2023-01-14 15:33:33 UTC (rev 10487)
@@ -1121,13 +1121,14 @@
 	int w, h;
 	int cx, cy;
 	RECT wr;
-	wchar_t uimsg[MAX_UIMSG];
+	wchar_t *uimsg;
 	PTTSet ts;
 
 	switch (msg) {
 		case WM_MOUSEMOVE:
 			ts = (PTTSet)GetWindowLongPtr(GetParent(hWnd) ,DWLP_USER);
-			get_lang_msgW("DLG_SERIAL_SPEED_TOOLTIP", uimsg, _countof(uimsg), L"You can directly specify a number", ts->UILanguageFile);
+			uimsg = TTGetLangStrW("Tera Term",
+								  "DLG_SERIAL_SPEED_TOOLTIP", L"You can directly specify a number", ts->UILanguageFileW);
 
 			// Combo-box\x82̍\xB6\x8F\xE3\x8D\xC0\x95W\x82\xF0\x8B\x81\x82߂\xE9
 			GetWindowRect(hWnd, &wr);
@@ -1152,6 +1153,8 @@
 			TipWinSetPos(g_SerialDlgSpeedTip, cx, cy);
 			TipWinSetHideTimer(g_SerialDlgSpeedTip, tooltip_timeout);
 
+			free(uimsg);
+
 			break;
 	}
     return CallWindowProc(g_defSerialDlgSpeedComboboxWndProc, hWnd, msg, wp, lp);
@@ -1193,7 +1196,7 @@
 			ts = (PTTSet)lParam;
 			SetWindowLongPtr(Dialog, DWLP_USER, lParam);
 
-			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), ts->UILanguageFile);
+			SetDlgTextsW(Dialog, TextInfos, _countof(TextInfos), ts->UILanguageFileW);
 
 			EnableDlgItem(Dialog, IDC_SERIALPORT, IDC_SERIALPORT);
 			EnableDlgItem(Dialog, IDC_SERIALPORT_LABEL, IDC_SERIALPORT_LABEL);
@@ -1202,7 +1205,7 @@
 			// COM\x83|\x81[\x83g\x82̏ڍ׏\xEE\x95\xF1\x82\xF0\x8E擾\x82\xB7\x82\xE9\x81B
 			// COM\x82̐ڑ\xB1\x8F󋵂͓s\x93x\x95ς\xED\x82邽\x82߁A\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95\\x8E\xA6\x82\xB7\x82\xE9\x93x\x82Ɏ擾\x82\xB7\x82\xE9\x81B
 			// \x95s\x97v\x82ɂȂ\xC1\x82\xBD\x82\xE7\x81AComPortInfoFree()\x82Ń\x81\x83\x82\x83\x8A\x82\xF0\x89\xF0\x95\xFA\x82\xB7\x82邱\x82ƁB
-			ComPortInfoPtr = ComPortInfoGet(&ComPortInfoCount, ts->UILanguageFile);
+			ComPortInfoPtr = ComPortInfoGet(&ComPortInfoCount);
 
 			w = 0;
 
@@ -1682,9 +1685,9 @@
 			SetWindowLongPtr(Dialog, DWLP_USER, (LPARAM)dlg_data);
 			dlg_data->GetHNRec = GetHNRec;
 
-			dlg_data->ComPortInfoPtr = ComPortInfoGet(&dlg_data->ComPortInfoCount, NULL);
+			dlg_data->ComPortInfoPtr = ComPortInfoGet(&dlg_data->ComPortInfoCount);
 
-			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), ts.UILanguageFile);
+			SetDlgTextsW(Dialog, TextInfos, _countof(TextInfos), ts.UILanguageFileW);
 
 			// \x83t\x83@\x83C\x83\x8B\x82\xA8\x82\xE6\x82і\xBC\x91O\x95t\x82\xAB\x83p\x83C\x83v\x82̏ꍇ\x81ATCP/IP\x88\xB5\x82\xA2\x82Ƃ\xB7\x82\xE9\x81B
 			if ( GetHNRec->PortType==IdFile ||
@@ -2448,7 +2451,7 @@
 #endif
 			}
 
-			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), ts.UILanguageFile);
+			SetDlgTextsW(Dialog, TextInfos, _countof(TextInfos), ts.UILanguageFileW);
 
 			// Tera Term \x96{\x91̂̃o\x81[\x83W\x83\x87\x83\x93
 			_snprintf_s(buf, sizeof(buf), _TRUNCATE, "Version %d.%d", TT_VERSION_MAJOR, TT_VERSION_MINOR);
@@ -2838,7 +2841,7 @@
 			ts = (PTTSet)lParam;
 			SetWindowLongPtr(Dialog, DWLP_USER, lParam);
 
-			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), ts->UILanguageFile);
+			SetDlgTextsW(Dialog, TextInfos, _countof(TextInfos), ts->UILanguageFileW);
 
 			SendDlgItemMessageA(Dialog, IDC_GENPORT, CB_ADDSTRING,
 			                   0, (LPARAM)"TCP/IP");
@@ -2988,7 +2991,7 @@
 			Close = (PBOOL)lParam;
 			SetWindowLongPtr(Dialog, DWLP_USER, lParam);
 
-			SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), ts.UILanguageFile);
+			SetDlgTextsW(Dialog, TextInfos, _countof(TextInfos), ts.UILanguageFileW);
 
 			SetWinList(GetParent(Dialog),Dialog,IDC_WINLISTLIST);
 

Modified: trunk/tools/lscom/main.cpp
===================================================================
--- trunk/tools/lscom/main.cpp	2023-01-14 15:33:22 UTC (rev 10486)
+++ trunk/tools/lscom/main.cpp	2023-01-14 15:33:33 UTC (rev 10487)
@@ -100,7 +100,7 @@
 void lscom()
 {
 	int comPortCount;
-	ComPortInfo_t *infos = ComPortInfoGet(&comPortCount, NULL);
+	ComPortInfo_t *infos = ComPortInfoGet(&comPortCount);
 	printf("comport count %d\n", comPortCount);
 	for (int i = 0; i < comPortCount; i++) {
 		ComPortInfo_t *p = &infos[i];


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