[Ttssh2-commit] [3764] ダイアログも i18n 対応。

svnno****@sourc***** svnno****@sourc*****
2010年 2月 2日 (火) 00:04:35 JST


Revision: 3764
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3764
Author:   doda
Date:     2010-02-02 00:04:35 +0900 (Tue, 02 Feb 2010)

Log Message:
-----------
ダイアログも i18n 対応。

Modified Paths:
--------------
    trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c
    trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.rc
    trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.vcproj
    trunk/TTXSamples/TTXRecurringCommand/resource.h
    trunk/installer/release/lang/English.lng
    trunk/installer/release/lang/German.lng
    trunk/installer/release/lang/Japanese.lng


-------------- next part --------------
Modified: trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c
===================================================================
--- trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c	2010-02-01 12:37:04 UTC (rev 3763)
+++ trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c	2010-02-01 15:04:35 UTC (rev 3764)
@@ -426,8 +426,45 @@
 // RecurringCommandÝ’èƒ_ƒCƒAƒƒO‚̃R[ƒ‹ƒoƒbƒNŠÖ”B
 //
 static LRESULT CALLBACK RecurringCommandSetting(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) {
+	char uimsg[MAX_UIMSG];
+	static HFONT DlgFont;
+	LOGFONT logfont;
+	HFONT font;
+
 	switch (msg) {
 	  case WM_INITDIALOG:
+	  	font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0);
+		GetObject(font, sizeof(LOGFONT), &logfont);
+
+		if ((GetI18nLogfont(SECTION, "DLG_TAHOMA_FONT", &logfont, GetDeviceCaps(GetDC(dlg), LOGPIXELSY),
+		                   pvar->ts->UILanguageFile) != FALSE) &&
+		   ((DlgFont = CreateFontIndirect(&logfont)) != NULL)) {
+			SendDlgItemMessage(dlg, IDC_ENABLE, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
+			SendDlgItemMessage(dlg, IDC_INTERVAL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
+			SendDlgItemMessage(dlg, IDC_INTERVAL_LABEL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
+			SendDlgItemMessage(dlg, IDC_COMMAND, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
+			SendDlgItemMessage(dlg, IDC_COMMAND_LABEL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
+		}
+		else {
+			DlgFont = NULL;
+		}
+
+		GetWindowText(dlg, uimsg, sizeof(uimsg));
+		GetI18nStr(SECTION, "DLG_TITLE", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg), uimsg, pvar->ts->UILanguageFile);
+		SetWindowText(dlg, pvar->ts->UIMsg);
+
+		GetDlgItemText(dlg, IDC_ENABLE, uimsg, sizeof(uimsg));
+		GetI18nStr(SECTION, "DLG_ENABLE", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg), uimsg, pvar->ts->UILanguageFile);
+		SetDlgItemText(dlg, IDC_ENABLE, pvar->ts->UIMsg);
+
+		GetDlgItemText(dlg, IDC_INTERVAL_LABEL, uimsg, sizeof(uimsg));
+		GetI18nStr(SECTION, "DLG_INTERVAL", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg), uimsg, pvar->ts->UILanguageFile);
+		SetDlgItemText(dlg, IDC_INTERVAL_LABEL, pvar->ts->UIMsg);
+
+		GetDlgItemText(dlg, IDC_COMMAND_LABEL, uimsg, sizeof(uimsg));
+		GetI18nStr(SECTION, "DLG_COMMAND", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg), uimsg, pvar->ts->UILanguageFile);
+		SetDlgItemText(dlg, IDC_COMMAND_LABEL, pvar->ts->UIMsg);
+
 		SendMessage(GetDlgItem(dlg, IDC_ENABLE), BM_SETCHECK,
 		            pvar->enable?BST_CHECKED:BST_UNCHECKED, 0);
 		SetDlgItemInt(dlg, IDC_INTERVAL, pvar->interval, FALSE);
@@ -460,10 +497,16 @@
 			}
 
 			EndDialog(dlg, IDOK);
+			if (DlgFont != NULL) {
+				DeleteObject(DlgFont);
+			}
 			return TRUE;
 
 		  case IDCANCEL:
 			EndDialog(dlg, IDCANCEL);
+			if (DlgFont != NULL) {
+				DeleteObject(DlgFont);
+			}
 			return TRUE;
 		}
 		break;

Modified: trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.rc
===================================================================
--- trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.rc	2010-02-01 12:37:04 UTC (rev 3763)
+++ trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.rc	2010-02-01 15:04:35 UTC (rev 3764)
@@ -16,9 +16,9 @@
 FONT 9, "Tahoma", 400, 0, 0
 BEGIN
     CONTROL         "&Enable", IDC_ENABLE, "Button", BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP, 5, 6, 32, 9
-    LTEXT           "&Interval(sec)", IDC_STATIC, 50, 6, 40, 8, WS_GROUP
+    LTEXT           "&Interval(sec)", IDC_INTERVAL_LABEL, 50, 6, 40, 8, WS_GROUP
     EDITTEXT        IDC_INTERVAL, 100, 5, 36, 11, WS_GROUP | ES_AUTOHSCROLL | ES_NUMBER | WS_TABSTOP
-    LTEXT           "&Command", IDC_STATIC, 5, 28, 60, 10, WS_GROUP
+    LTEXT           "&Command", IDC_COMMAND_LABEL, 5, 28, 60, 10, WS_GROUP
     EDITTEXT        IDC_COMMAND, 42, 25, 94, 12, ES_AUTOHSCROLL | WS_TABSTOP
     DEFPUSHBUTTON   "OK", IDOK, 15, 50, 50, 14
     PUSHBUTTON      "Cancel", IDCANCEL, 81, 50, 50, 14

Modified: trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.vcproj
===================================================================
--- trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.vcproj	2010-02-01 12:37:04 UTC (rev 3763)
+++ trunk/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.vcproj	2010-02-01 15:04:35 UTC (rev 3764)
@@ -136,7 +136,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="..\..\teraterm\debug\ttpcmn.lib"
+				AdditionalDependencies="..\..\teraterm\release\ttpcmn.lib"
 				LinkIncremental="1"
 				GenerateDebugInformation="true"
 				SubSystem="2"

Modified: trunk/TTXSamples/TTXRecurringCommand/resource.h
===================================================================
--- trunk/TTXSamples/TTXRecurringCommand/resource.h	2010-02-01 12:37:04 UTC (rev 3763)
+++ trunk/TTXSamples/TTXRecurringCommand/resource.h	2010-02-01 15:04:35 UTC (rev 3764)
@@ -3,6 +3,8 @@
 #endif
 
 #define IDD_SETUP_RECURRINGCOMMAND              1001
-#define IDC_INTERVAL                            2001
-#define IDC_COMMAND                             2002
-#define IDC_ENABLE                              2003
+#define IDC_ENABLE                              2001
+#define IDC_INTERVAL                            2002
+#define IDC_INTERVAL_LABEL                      2003
+#define IDC_COMMAND                             2004
+#define IDC_COMMAND_LABEL                       2005

Modified: trunk/installer/release/lang/English.lng
===================================================================
--- trunk/installer/release/lang/English.lng	2010-02-01 12:37:04 UTC (rev 3763)
+++ trunk/installer/release/lang/English.lng	2010-02-01 15:04:35 UTC (rev 3764)
@@ -931,5 +931,12 @@
 
 
 [TTXRecurringCommand]
+DLG_TAHOMA_FONT=Tahoma,8,0
+
 MENU_SETUP_RECURRING=Rec&urring command
 MENU_CONTROL_RECURRING=Rec&urring command
+
+DLG_TITLE=Recurring command
+DLG_ENABLE=&Enable
+DLG_INTERVAL=&Interval(sec)
+DLG_COMMAND=&Command

Modified: trunk/installer/release/lang/German.lng
===================================================================
--- trunk/installer/release/lang/German.lng	2010-02-01 12:37:04 UTC (rev 3763)
+++ trunk/installer/release/lang/German.lng	2010-02-01 15:04:35 UTC (rev 3764)
@@ -927,5 +927,12 @@
 
 
 [TTXRecurringCommand]
+DLG_TAHOMA_FONT=Tahoma,8,0
+
 MENU_SETUP_RECURRING=Rec&urring command
 MENU_CONTROL_RECURRING=Rec&urring command
+
+DLG_TITLE=Recurring command
+DLG_ENABLE=&Enable
+DLG_INTERVAL=&Interval(sec)
+DLG_COMMAND=&Command

Modified: trunk/installer/release/lang/Japanese.lng
===================================================================
--- trunk/installer/release/lang/Japanese.lng	2010-02-01 12:37:04 UTC (rev 3763)
+++ trunk/installer/release/lang/Japanese.lng	2010-02-01 15:04:35 UTC (rev 3764)
@@ -931,5 +931,12 @@
 
 
 [TTXRecurringCommand]
+DLG_TAHOMA_FONT=‚l‚r ‚oƒSƒVƒbƒN,9,128
+
 MENU_SETUP_RECURRING=ŒJ‚è•Ô‚µƒRƒ}ƒ“ƒh(&U)
 MENU_CONTROL_RECURRING=ŒJ‚è•Ô‚µƒRƒ}ƒ“ƒh(&U)
+
+DLG_TITLE=ŒJ‚è•Ô‚µƒRƒ}ƒ“ƒh
+DLG_ENABLE=—LŒø(&E)
+DLG_INTERVAL=ŠÔŠu(•b)(&I)
+DLG_COMMAND=ƒRƒ}ƒ“ƒh(&C)



Ttssh2-commit メーリングリストの案内