• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision7589 (tree)
Time2019-04-14 01:40:46
Authorzmatsuo

Log Message

従来の設定のダイアログフォントを設定を使ってダイアログを表示するようにした
lngの各セクションのDLG_SYSTEM_FONT,DLG_TAHOMA_FONT等を参照する
新たにダイアログフォントの設定を行うと、その後はその設定で表示される
新し設定はteraterm.iniの[Tera Term]セクションのDlgFont

Change Summary

Incremental Difference

--- trunk/TTProxy/TTProxy.h (revision 7588)
+++ trunk/TTProxy/TTProxy.h (revision 7589)
@@ -251,7 +251,7 @@
251251 copy_UILanguageFile();
252252 SetDialogFont(getInstance().ts->SetupFName,
253253 getInstance().ts->UILanguageFile,
254- "TTProxy");
254+ "TTProxy", "DLG_TAHOMA_FONT");
255255 ProxyWSockHook::aboutDialog(hWin);
256256 return 1;
257257 case ID_PROXYSETUPMENU:
@@ -258,7 +258,7 @@
258258 copy_UILanguageFile();
259259 SetDialogFont(getInstance().ts->SetupFName,
260260 getInstance().ts->UILanguageFile,
261- "TTProxy");
261+ "TTProxy", "DLG_TAHOMA_FONT");
262262 ProxyWSockHook::setupDialog(hWin);
263263 return 1;
264264 case ID_ASYNCMESSAGEBOX:
--- trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c (revision 7588)
+++ trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c (revision 7589)
@@ -580,9 +580,9 @@
580580 static int PASCAL TTXProcessCommand(HWND hWin, WORD cmd) {
581581 switch (cmd) {
582582 case ID_MENU_SETUP:
583- SetDialogFont(pvar->ts->SetupFName,
584- pvar->ts->UILanguageFile,
585- SECTION);
583+ SetDialogFont(pvar->ts->SetupFName,
584+ pvar->ts->UILanguageFile,
585+ SECTION, "DLG_TAHOMA_FONT");
586586 switch (TTDialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SETUP_RECURRINGCOMMAND),
587587 hWin, RecurringCommandSetting, (LPARAM)NULL)) {
588588 case IDOK:
--- trunk/teraterm/common/dlglib.h (revision 7588)
+++ trunk/teraterm/common/dlglib.h (revision 7589)
@@ -87,7 +87,8 @@
8787 LPCTSTR lpTemplateName,
8888 HWND hWndParent,
8989 DLGPROC lpDialogFunc);
90-void SetDialogFont(const char *SetupFName, const char *UILanguageFile, const char *Section);
90+void SetDialogFont(const char *SetupFName,
91+ const char *UILanguageFile, const char *Section, const char *Key);
9192 HFONT SetDlgFonts(HWND hDlg, const int nIDDlgItems[], int nIDDlgItemCount,
9293 const char *UILanguageFile, PCHAR key);
9394 BOOL IsExistFontA(const char *face, BYTE charset, BOOL strict);
--- trunk/teraterm/common/dlglib_cpp.cpp (revision 7588)
+++ trunk/teraterm/common/dlglib_cpp.cpp (revision 7589)
@@ -253,12 +253,13 @@
253253 * 使用するダイアログフォントを決定する
254254 */
255255 void SetDialogFont(const char *SetupFName,
256- const char *UILanguageFile, const char *Section)
256+ const char *UILanguageFile, const char *Section, const char *Key)
257257 {
258+ LOGFONTA logfont;
259+ BOOL result;
260+
258261 // teraterm.iniの指定
259262 if (SetupFName != NULL) {
260- LOGFONTA logfont;
261- BOOL result;
262263 result = GetI18nLogfont("Tera Term", "DlgFont", &logfont, 0, SetupFName);
263264 if (result == TRUE) {
264265 result = IsExistFontA(logfont.lfFaceName, logfont.lfCharSet, TRUE);
@@ -270,60 +271,30 @@
270271 }
271272
272273 // .lngの指定
273- if (UILanguageFile != NULL) {
274+ if (UILanguageFile != NULL && Section != NULL && Key != NULL) {
275+#if 0
274276 static const char *dlg_font_keys[] = {
275277 "DLG_FONT",
276278 "DLG_TAHOMA_FONT",
277279 "DLG_SYSTEM_FONT",
278280 };
279- BOOL result = FALSE;
280- LOGFONTA logfont;
281- size_t i;
282- if (Section != NULL) {
283- for (i = 0; i < _countof(dlg_font_keys); i++) {
284- result = GetI18nLogfont(Section, dlg_font_keys[i], &logfont, 0, UILanguageFile);
285- if (result == FALSE) {
286- continue;
287- }
288- if (logfont.lfFaceName[0] == '\0') {
289- break;
290- }
291- if (IsExistFontA(logfont.lfFaceName, logfont.lfCharSet, TRUE)) {
292- break;
293- }
281+#endif
282+ result = GetI18nLogfont(Section, Key, &logfont, 0, UILanguageFile);
283+ if (result == TRUE) {
284+ if (IsExistFontA(logfont.lfFaceName, logfont.lfCharSet, TRUE)) {
285+ TTSetDlgFontA(logfont.lfFaceName, logfont.lfHeight, logfont.lfCharSet);
286+ return;
294287 }
295288 }
296- if (result == FALSE) {
297- for (i = 0; i < _countof(dlg_font_keys); i++) {
298- result = GetI18nLogfont("Tera Term", dlg_font_keys[i], &logfont, 0, UILanguageFile);
299- if (result == FALSE) {
300- continue;
301- }
302- if (logfont.lfFaceName[0] == '\0') {
303- break;
304- }
305- if (IsExistFontA(logfont.lfFaceName, logfont.lfCharSet, TRUE)) {
306- break;
307- }
308- }
309- }
310- if (result == TRUE) {
311- TTSetDlgFontA(logfont.lfFaceName, logfont.lfHeight, logfont.lfCharSet);
312- return;
313- }
314289 }
315290
316291 // ini,lngで指定されたフォントが見つからなかったとき、
317- // 文字化けで正しく表示されない事態となる
318292 // messagebox()のフォントをとりあえず選択しておく
319- {
320- LOGFONT logfont;
321- GetMessageboxFont(&logfont);
322- if (logfont.lfHeight < 0) {
323- logfont.lfHeight = GetFontPointFromPixel(NULL, -logfont.lfHeight);
324- }
325- TTSetDlgFont(logfont.lfFaceName, logfont.lfHeight, logfont.lfCharSet);
293+ GetMessageboxFont(&logfont);
294+ if (logfont.lfHeight < 0) {
295+ logfont.lfHeight = GetFontPointFromPixel(NULL, -logfont.lfHeight);
326296 }
297+ TTSetDlgFont(logfont.lfFaceName, logfont.lfHeight, logfont.lfCharSet);
327298 }
328299
329300
--- trunk/teraterm/teraterm/tekwin.cpp (revision 7588)
+++ trunk/teraterm/teraterm/tekwin.cpp (revision 7589)
@@ -789,6 +789,8 @@
789789 return;
790790 }
791791 OldEmu = ts.TEKColorEmu;
792+ SetDialogFont(ts.SetupFName,
793+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
792794 Ok = (*SetupWin)(HTEKWin, &ts);
793795 FreeTTDLG();
794796 if (Ok) {
@@ -830,6 +832,8 @@
830832 if (! LoadTTDLG()) {
831833 return;
832834 }
835+ SetDialogFont(ts.SetupFName,
836+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
833837 (*WindowWindow)(HTEKWin,&Close);
834838 FreeTTDLG();
835839 if (Close) {
--- trunk/teraterm/teraterm/teraterm.cpp (revision 7588)
+++ trunk/teraterm/teraterm/teraterm.cpp (revision 7589)
@@ -289,9 +289,8 @@
289289 CVTWindow *m_pMainWnd = new CVTWindow();
290290 pVTWin = m_pMainWnd;
291291 main_window = m_pMainWnd->m_hWnd;
292- // [Tera Term]セクションのDlgFont=がない場合は
293- // [TTSSH]セクションのフォント設定を使用する
294- SetDialogFont(ts.SetupFName, ts.UILanguageFile, "TTSSH");
292+ // [Tera Term]セクションのDLG_SYSTEM_FONTをとりあえずセットする
293+ SetDialogFont(ts.SetupFName, ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
295294
296295 MSG msg;
297296 while (GetMessage(&msg, NULL, 0, 0)) {
--- trunk/teraterm/teraterm/vtwin.cpp (revision 7588)
+++ trunk/teraterm/teraterm/vtwin.cpp (revision 7589)
@@ -57,6 +57,7 @@
5757 #include <winsock2.h>
5858 #include <ws2tcpip.h>
5959 #include "ttplug.h" /* TTPLUG */
60+#include "teraterml.h"
6061
6162 #include <stdio.h>
6263 #include <stdlib.h>
@@ -2231,6 +2232,8 @@
22312232 if (!DoSameProcess) {
22322233 bool DoSameProcessNextDrop;
22332234 bool DoNotShowDialog = !DefaultShowDialog;
2235+ SetDialogFont(ts.SetupFName,
2236+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
22342237 DropType =
22352238 ShowDropDialogBox(hInst, HVTWin,
22362239 FileName, DropType,
@@ -3885,6 +3888,8 @@
38853888 return;
38863889 }
38873890
3891+ SetDialogFont(ts.SetupFName,
3892+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
38883893 if ((*GetHostName)(HVTWin,&GetHNRec)) {
38893894 if ((GetHNRec.PortType==IdTCPIP) && LoadTTSET()) {
38903895 if (ts.HistoryList) {
@@ -4441,6 +4446,8 @@
44414446 if (! LoadTTDLG()) {
44424447 return;
44434448 }
4449+ SetDialogFont(ts.SetupFName,
4450+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
44444451 (*ChangeDirectory)(HVTWin,ts.FileDir);
44454452 FreeTTDLG();
44464453 }
@@ -4577,6 +4584,8 @@
45774584 {
45784585 DWORD ret;
45794586
4587+ SetDialogFont(ts.SetupFName,
4588+ ts.UILanguageFile, "Tera Term", "DLG_TAHOMA_FONT");
45804589 CAddSettingPropSheetDlg CAddSetting(hInst, _T("Tera Term: Additional settings"), HVTWin);
45814590 ret = CAddSetting.DoModal();
45824591 switch (ret) {
@@ -4628,6 +4637,8 @@
46284637 if (! LoadTTDLG()) {
46294638 return;
46304639 }
4640+ SetDialogFont(ts.SetupFName,
4641+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
46314642 Ok = (*SetupTerminal)(HVTWin, &ts);
46324643 FreeTTDLG();
46334644 if (Ok) {
@@ -4648,6 +4659,8 @@
46484659 return;
46494660 }
46504661
4662+ SetDialogFont(ts.SetupFName,
4663+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
46514664 strncpy_s(orgTitle, sizeof(orgTitle), ts.Title, _TRUNCATE);
46524665 Ok = (*SetupWin)(HVTWin, &ts);
46534666 FreeTTDLG();
@@ -4728,8 +4741,6 @@
47284741 font_point,
47294742 LogFont.lfCharSet);
47304743 WritePrivateProfileStringA("Tera Term", "DlgFont", Temp, ts.SetupFName);
4731-
4732- SetDialogFont(ts.SetupFName, ts.UILanguageFile, "TTSSH");
47334744 }
47344745 }
47354746
@@ -4746,6 +4757,8 @@
47464757 if (! LoadTTDLG()) {
47474758 return;
47484759 }
4760+ SetDialogFont(ts.SetupFName,
4761+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
47494762 Ok = (*SetupKeyboard)(HVTWin, &ts);
47504763 FreeTTDLG();
47514764
@@ -4763,6 +4776,8 @@
47634776 if (! LoadTTDLG()) {
47644777 return;
47654778 }
4779+ SetDialogFont(ts.SetupFName,
4780+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
47664781 Ok = (*SetupSerialPort)(HVTWin, &ts);
47674782 FreeTTDLG();
47684783
@@ -4788,6 +4803,8 @@
47884803 if (! LoadTTDLG()) {
47894804 return;
47904805 }
4806+ SetDialogFont(ts.SetupFName,
4807+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
47914808 if ((*SetupTCPIP)(HVTWin, &ts)) {
47924809 TelUpdateKeepAliveInterval();
47934810 }
@@ -4800,6 +4817,8 @@
48004817 if (! LoadTTDLG()) {
48014818 return;
48024819 }
4820+ SetDialogFont(ts.SetupFName,
4821+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
48034822 if ((*SetupGeneral)(HVTWin,&ts)) {
48044823 ResetCharSet();
48054824 ResetIME();
@@ -6184,6 +6203,8 @@
61846203 if (! LoadTTDLG()) {
61856204 return;
61866205 }
6206+ SetDialogFont(ts.SetupFName,
6207+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
61876208 (*WindowWindow)(HVTWin,&Close);
61886209 FreeTTDLG();
61896210 if (Close) {
@@ -6231,6 +6252,8 @@
62316252 if (! LoadTTDLG()) {
62326253 return;
62336254 }
6255+ SetDialogFont(ts.SetupFName,
6256+ ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
62346257 (*AboutDialog)(HVTWin);
62356258 FreeTTDLG();
62366259 }
--- trunk/teraterm/ttpmacro/ttmacro.cpp (revision 7588)
+++ trunk/teraterm/ttpmacro/ttmacro.cpp (revision 7589)
@@ -78,7 +78,7 @@
7878 pSetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
7979 }
8080 // messageboxのフォントに設定する
81- SetDialogFont(NULL, NULL, NULL);
81+ SetDialogFont(NULL, NULL, NULL, NULL);
8282 }
8383
8484 // TTMACRO main engine
--- trunk/ttssh2/ttxssh/ttxssh.c (revision 7588)
+++ trunk/ttssh2/ttxssh/ttxssh.c (revision 7589)
@@ -1669,12 +1669,13 @@
16691669
16701670 static void UTIL_SetDialogFont()
16711671 {
1672- SetDialogFont(pvar->ts->SetupFName, pvar->ts->UILanguageFile, "TTSSH");
1672+ SetDialogFont(pvar->ts->SetupFName, pvar->ts->UILanguageFile, "TTSSH", "DLG_TAHOMA_FONT");
16731673 }
16741674
16751675 static BOOL PASCAL TTXGetHostName(HWND parent, PGetHNRec rec)
16761676 {
1677- UTIL_SetDialogFont();
1677+ SetDialogFont(pvar->ts->SetupFName,
1678+ pvar->ts->UILanguageFile, "TTSSH", "DLG_SYSTEM_FONT");
16781679 return (BOOL) DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_HOSTDLG),
16791680 parent, TTXHostDlg, (LPARAM)rec);
16801681 }
Show on old repository browser