[Ttssh2-commit] [5573] Eterm look-feel: 背景画像を指定するかどうかをチェックボックスで判別するようにした。

svnno****@sourc***** svnno****@sourc*****
2014年 4月 30日 (水) 21:57:38 JST


Revision: 5573
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5573
Author:   yutakapon
Date:     2014-04-30 21:57:36 +0900 (Wed, 30 Apr 2014)
Log Message:
-----------
Eterm look-feel: 背景画像を指定するかどうかをチェックボックスで判別するようにした。

・組み合わせパターン
 Eterm look-feel   Background Image   画像ファイル指定
       ✓なし             無効               無効
       ✓あり             ✓なし             無効
       ✓あり             ✓あり             有効

Modified Paths:
--------------
    trunk/teraterm/common/tt_res.h
    trunk/teraterm/teraterm/addsetting.cpp
    trunk/teraterm/teraterm/ttermpro.rc

-------------- next part --------------
Modified: trunk/teraterm/common/tt_res.h
===================================================================
--- trunk/teraterm/common/tt_res.h	2014-04-20 11:05:42 UTC (rev 5572)
+++ trunk/teraterm/common/tt_res.h	2014-04-30 12:57:36 UTC (rev 5573)
@@ -137,6 +137,7 @@
 #define IDC_CONFIRM_CHANGE_PASTE        2512
 #define IDC_CURSOR_CTRL_SEQ             2512
 #define IDC_LOG_ROTATE                  2512
+#define IDC_BGIMG_CHECK                 2512
 #define IDC_MOUSEWHEEL_SCROLL_LINE      2513
 #define IDC_WINDOW_CTRL                 2513
 #define IDC_TRANSPROGRESS               2514

Modified: trunk/teraterm/teraterm/addsetting.cpp
===================================================================
--- trunk/teraterm/teraterm/addsetting.cpp	2014-04-20 11:05:42 UTC (rev 5572)
+++ trunk/teraterm/teraterm/addsetting.cpp	2014-04-30 12:57:36 UTC (rev 5573)
@@ -771,7 +771,7 @@
 		SendDlgItemMessage(IDC_ENABLE_URL_COLOR, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
 		SendDlgItemMessage(IDC_ENABLE_ANSI_COLOR, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
 		SendDlgItemMessage(IDC_URL_UNDERLINE, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_BGIMG_LABEL, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
+		SendDlgItemMessage(IDC_BGIMG_CHECK, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
 		SendDlgItemMessage(IDC_BGIMG_EDIT, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
 		SendDlgItemMessage(IDC_BGIMG_BUTTON, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
 		SendDlgItemMessage(IDC_RESTART, WM_SETFONT, (WPARAM)DlgVisualFont, MAKELPARAM(TRUE,0));
@@ -786,9 +786,9 @@
 	GetDlgItemText(IDC_ETERM_LOOKFEEL, uimsg, sizeof(uimsg));
 	get_lang_msg("DLG_TAB_VISUAL_ETERM", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
 	SetDlgItemText(IDC_ETERM_LOOKFEEL, ts.UIMsg);
-	GetDlgItemText(IDC_BGIMG_LABEL, uimsg, sizeof(uimsg));
+	GetDlgItemText(IDC_BGIMG_CHECK, uimsg, sizeof(uimsg));
 	get_lang_msg("DLG_TAB_VISUAL_BGIMG", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(IDC_BGIMG_LABEL, ts.UIMsg);
+	SetDlgItemText(IDC_BGIMG_CHECK, ts.UIMsg);
 	GetDlgItemText(IDC_MOUSE, uimsg, sizeof(uimsg));
 	get_lang_msg("DLG_TAB_VISUAL_MOUSE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
 	SetDlgItemText(IDC_MOUSE, ts.UIMsg);
@@ -849,11 +849,20 @@
 	// Eterm look-feel\x82̔w\x8Ci\x89摜\x8Ew\x92\xE8\x81B
 	SetDlgItemText(IDC_BGIMG_EDIT, ts.BGImageFilePath);
 	if (ts.EtermLookfeel.BGEnable) {
-		GetDlgItem(IDC_BGIMG_LABEL)->EnableWindow(TRUE);
-		GetDlgItem(IDC_BGIMG_EDIT)->EnableWindow(TRUE);
-		GetDlgItem(IDC_BGIMG_BUTTON)->EnableWindow(TRUE);
+		GetDlgItem(IDC_BGIMG_CHECK)->EnableWindow(TRUE);
+
+		btn = (CButton *)GetDlgItem(IDC_BGIMG_CHECK);
+		if (strcmp(ts.EtermLookfeel.BGThemeFile, BG_THEME_IMAGEFILE) == 0) {
+			btn->SetCheck(BST_CHECKED);
+			GetDlgItem(IDC_BGIMG_EDIT)->EnableWindow(TRUE);
+			GetDlgItem(IDC_BGIMG_BUTTON)->EnableWindow(TRUE);
+		} else {
+			btn->SetCheck(BST_UNCHECKED);
+			GetDlgItem(IDC_BGIMG_EDIT)->EnableWindow(FALSE);
+			GetDlgItem(IDC_BGIMG_BUTTON)->EnableWindow(FALSE);
+		}
 	} else {
-		GetDlgItem(IDC_BGIMG_LABEL)->EnableWindow(FALSE);
+		GetDlgItem(IDC_BGIMG_CHECK)->EnableWindow(FALSE);
 		GetDlgItem(IDC_BGIMG_EDIT)->EnableWindow(FALSE);
 		GetDlgItem(IDC_BGIMG_BUTTON)->EnableWindow(FALSE);
 	}
@@ -937,13 +946,38 @@
 			// \x83`\x83F\x83b\x83N\x82\xB3\x82ꂽ\x82\xE7 Enable/Disable \x82\xF0\x83g\x83O\x83\x8B\x82\xB7\x82\xE9\x81B
 			btn = (CButton *)GetDlgItem(IDC_ETERM_LOOKFEEL);
 			if (btn->GetCheck()) {
-				GetDlgItem(IDC_BGIMG_LABEL)->EnableWindow(TRUE);
+				GetDlgItem(IDC_BGIMG_CHECK)->EnableWindow(TRUE);
+				btn = (CButton *)GetDlgItem(IDC_BGIMG_CHECK);
+				if (btn->GetCheck()) {
+					GetDlgItem(IDC_BGIMG_EDIT)->EnableWindow(TRUE);
+					GetDlgItem(IDC_BGIMG_BUTTON)->EnableWindow(TRUE);
+				} else {
+					GetDlgItem(IDC_BGIMG_EDIT)->EnableWindow(FALSE);
+					GetDlgItem(IDC_BGIMG_BUTTON)->EnableWindow(FALSE);
+				}
+			} else {
+				GetDlgItem(IDC_BGIMG_CHECK)->EnableWindow(FALSE);
+				GetDlgItem(IDC_BGIMG_EDIT)->EnableWindow(FALSE);
+				GetDlgItem(IDC_BGIMG_BUTTON)->EnableWindow(FALSE);
+
+				// \x96\xB3\x8C\x{27B0B3}\x82ꂽ\x82\xE7\x81ABGThemeFile \x82\xF0\x8C\xB3\x82ɖ߂\xB7\x81B
+				strncpy_s(ts.EtermLookfeel.BGThemeFile, BG_THEME_IMAGEFILE_DEFAULT, sizeof(ts.EtermLookfeel.BGThemeFile));
+				// \x94w\x8Ci\x89摜\x82\xE0\x96\xB3\x8C\x{27B0B7}\x82\xE9\x81B
+				SetDlgItemText(IDC_BGIMG_EDIT, "");
+			}
+			return TRUE;
+
+		case IDC_BGIMG_CHECK:
+			btn = (CButton *)GetDlgItem(IDC_BGIMG_CHECK);
+			if (btn->GetCheck()) {
 				GetDlgItem(IDC_BGIMG_EDIT)->EnableWindow(TRUE);
 				GetDlgItem(IDC_BGIMG_BUTTON)->EnableWindow(TRUE);
+
+				strncpy_s(ts.EtermLookfeel.BGThemeFile, BG_THEME_IMAGEFILE, sizeof(ts.EtermLookfeel.BGThemeFile));
 			} else {
-				GetDlgItem(IDC_BGIMG_LABEL)->EnableWindow(FALSE);
 				GetDlgItem(IDC_BGIMG_EDIT)->EnableWindow(FALSE);
 				GetDlgItem(IDC_BGIMG_BUTTON)->EnableWindow(FALSE);
+
 				// \x96\xB3\x8C\x{27B0B3}\x82ꂽ\x82\xE7\x81ABGThemeFile \x82\xF0\x8C\xB3\x82ɖ߂\xB7\x81B
 				strncpy_s(ts.EtermLookfeel.BGThemeFile, BG_THEME_IMAGEFILE_DEFAULT, sizeof(ts.EtermLookfeel.BGThemeFile));
 				// \x94w\x8Ci\x89摜\x82\xE0\x96\xB3\x8C\x{27B0B7}\x82\xE9\x81B
@@ -959,7 +993,6 @@
 				if (selDlg.DoModal() == IDOK) {
 					// \x94w\x8Ci\x89摜\x8Ew\x92肪\x88Ӑ}\x93I\x82ɍs\x82\xED\x82ꂽ\x82\xE7\x81ABGThemeFile \x82\xF0\x8CŒ艻\x82\xB7\x82\xE9\x81B
 					SetDlgItemText(IDC_BGIMG_EDIT, selDlg.GetPathName());
-					strncpy_s(ts.EtermLookfeel.BGThemeFile, BG_THEME_IMAGEFILE, sizeof(ts.EtermLookfeel.BGThemeFile));
 				}
 			}
 			return TRUE;

Modified: trunk/teraterm/teraterm/ttermpro.rc
===================================================================
--- trunk/teraterm/teraterm/ttermpro.rc	2014-04-20 11:05:42 UTC (rev 5572)
+++ trunk/teraterm/teraterm/ttermpro.rc	2014-04-30 12:57:36 UTC (rev 5573)
@@ -117,9 +117,9 @@
     CONTROL         "&Eterm lookfeel(*)",IDC_ETERM_LOOKFEEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,99,8,72,12
     LTEXT           "&Mouse cursor",IDC_MOUSE,10,22,70,8
     LISTBOX         IDC_MOUSE_CURSOR,10,32,48,35,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
-    LTEXT           "Background &Image",IDC_BGIMG_LABEL,100,22,60,8
-    EDITTEXT        IDC_BGIMG_EDIT,98,31,108,14,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_BGIMG_BUTTON,213,31,14,14
+    CONTROL         "Background &Image",IDC_BGIMG_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,20,104,10
+    EDITTEXT        IDC_BGIMG_EDIT,101,31,108,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_BGIMG_BUTTON,216,31,14,14
     LTEXT           "&Font Quality",IDC_FONT_QUALITY_LABEL,100,47,70,8
     COMBOBOX        IDC_FONT_QUALITY,100,56,80,52,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
     LTEXT           "ANSI color",IDC_ANSICOLOR,10,74,43,8



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