• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision8471 (tree)
Time2020-01-14 01:26:06
Authorzmatsuo

Log Message

GUIを多言語化

Change Summary

Incremental Difference

--- trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c (revision 8470)
+++ trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c (revision 8471)
@@ -430,24 +430,25 @@
430430 // コントロールメニューにRecurringCommandを追加。
431431 //
432432 static void PASCAL TTXModifyMenu(HMENU menu) {
433+ static const DlgTextInfo MenuTextInfo[] = {
434+ { ID_MENU_SETUP, "MENU_SETUP_RECURRING" },
435+ { ID_MENU_CONTROL, "MENU_CONTROL_RECURRING" },
436+ };
433437 UINT flag = MF_BYCOMMAND | MF_STRING | MF_ENABLED;
434438
435439 pvar->SetupMenu = GetSetupMenu(menu);
436440 pvar->ControlMenu = GetControlMenu(menu);
437441
438- GetI18nStr(SECTION, "MENU_SETUP_RECURRING", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg),
439- "Rec&urring command", pvar->ts->UILanguageFile);
440- InsertMenu(pvar->SetupMenu, ID_SETUP_ADDITIONALSETTINGS, flag, ID_MENU_SETUP, pvar->ts->UIMsg);
442+ InsertMenu(pvar->SetupMenu, ID_SETUP_ADDITIONALSETTINGS, flag, ID_MENU_SETUP, "Rec&urring command");
441443
442444 if (pvar->enable) {
443445 flag |= MF_CHECKED;
444446 }
445447
448+ InsertMenu(pvar->ControlMenu, ID_CONTROL_MACRO, flag, ID_MENU_CONTROL, "Rec&urring command");
449+ InsertMenu(pvar->ControlMenu, ID_CONTROL_MACRO, MF_BYCOMMAND | MF_SEPARATOR, 0, NULL);
446450
447- GetI18nStr(SECTION, "MENU_CONTROL_RECURRING", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg),
448- "Rec&urring command", pvar->ts->UILanguageFile);
449- InsertMenu(pvar->ControlMenu, ID_CONTROL_MACRO, flag, ID_MENU_CONTROL, pvar->ts->UIMsg);
450- InsertMenu(pvar->ControlMenu, ID_CONTROL_MACRO, MF_BYCOMMAND | MF_SEPARATOR, 0, NULL);
451+ SetI18MenuStrs(SECTION, menu, MenuTextInfo, _countof(MenuTextInfo), pvar->ts->UILanguageFile);
451452 }
452453
453454 static void PASCAL TTXModifyPopupMenu(HMENU menu) {
@@ -465,54 +466,18 @@
465466 // RecurringCommand設定ダイアログのコールバック関数。
466467 //
467468 static LRESULT CALLBACK RecurringCommandSetting(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) {
468- char uimsg[MAX_UIMSG];
469-#if 0
470- static HFONT DlgFont;
471- LOGFONT logfont;
472- HFONT font;
473-#endif
469+ const static DlgTextInfo text_info[] = {
470+ { 0, "DLG_TITLE" },
471+ { IDC_ENABLE, "DLG_ENABLE" },
472+ { IDC_INTERVAL_LABEL, "DLG_INTERVAL" },
473+ { IDC_COMMAND_LABEL, "DLG_COMMAND" },
474+ { IDC_ADD_NL, "DLG_ADD_NEWLINE" },
475+ };
474476
475477 switch (msg) {
476478 case WM_INITDIALOG:
477-#if 0
478- font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0);
479- GetObject(font, sizeof(LOGFONT), &logfont);
479+ SetI18DlgStrs(SECTION, dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
480480
481- if ((GetI18nLogfont(SECTION, "DLG_TAHOMA_FONT", &logfont, GetDeviceCaps(GetDC(dlg), LOGPIXELSY),
482- pvar->ts->UILanguageFile) != FALSE) &&
483- ((DlgFont = CreateFontIndirect(&logfont)) != NULL)) {
484- SendDlgItemMessage(dlg, IDC_ENABLE, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
485- SendDlgItemMessage(dlg, IDC_INTERVAL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
486- SendDlgItemMessage(dlg, IDC_INTERVAL_LABEL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
487- SendDlgItemMessage(dlg, IDC_COMMAND, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
488- SendDlgItemMessage(dlg, IDC_COMMAND_LABEL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
489- SendDlgItemMessage(dlg, IDC_ADD_NL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
490- }
491- else {
492- DlgFont = NULL;
493- }
494-#endif
495-
496- GetWindowText(dlg, uimsg, sizeof(uimsg));
497- GetI18nStr(SECTION, "DLG_TITLE", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg), uimsg, pvar->ts->UILanguageFile);
498- SetWindowText(dlg, pvar->ts->UIMsg);
499-
500- GetDlgItemText(dlg, IDC_ENABLE, uimsg, sizeof(uimsg));
501- GetI18nStr(SECTION, "DLG_ENABLE", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg), uimsg, pvar->ts->UILanguageFile);
502- SetDlgItemText(dlg, IDC_ENABLE, pvar->ts->UIMsg);
503-
504- GetDlgItemText(dlg, IDC_INTERVAL_LABEL, uimsg, sizeof(uimsg));
505- GetI18nStr(SECTION, "DLG_INTERVAL", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg), uimsg, pvar->ts->UILanguageFile);
506- SetDlgItemText(dlg, IDC_INTERVAL_LABEL, pvar->ts->UIMsg);
507-
508- GetDlgItemText(dlg, IDC_COMMAND_LABEL, uimsg, sizeof(uimsg));
509- GetI18nStr(SECTION, "DLG_COMMAND", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg), uimsg, pvar->ts->UILanguageFile);
510- SetDlgItemText(dlg, IDC_COMMAND_LABEL, pvar->ts->UIMsg);
511-
512- GetDlgItemText(dlg, IDC_ADD_NL, uimsg, sizeof(uimsg));
513- GetI18nStr(SECTION, "DLG_ADD_NEWLINE", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg), uimsg, pvar->ts->UILanguageFile);
514- SetDlgItemText(dlg, IDC_ADD_NL, pvar->ts->UIMsg);
515-
516481 SendMessage(GetDlgItem(dlg, IDC_ENABLE), BM_SETCHECK,
517482 pvar->enable?BST_CHECKED:BST_UNCHECKED, 0);
518483 SetDlgItemInt(dlg, IDC_INTERVAL, pvar->interval, FALSE);
@@ -555,20 +520,10 @@
555520 }
556521
557522 EndDialog(dlg, IDOK);
558-#if 0
559- if (DlgFont != NULL) {
560- DeleteObject(DlgFont);
561- }
562-#endif
563523 return TRUE;
564524
565525 case IDCANCEL:
566526 EndDialog(dlg, IDCANCEL);
567-#if 0
568- if (DlgFont != NULL) {
569- DeleteObject(DlgFont);
570- }
571-#endif
572527 return TRUE;
573528 }
574529 break;
Show on old repository browser