[Ttssh2-commit] [8832] ダイアログフォント選択時、フォント選択ダイアログでキャンセルできるよう修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2020年 7月 3日 (金) 23:44:15 JST


Revision: 8832
          https://osdn.net/projects/ttssh2/scm/svn/commits/8832
Author:   zmatsuo
Date:     2020-07-03 23:44:15 +0900 (Fri, 03 Jul 2020)
Log Message:
-----------
ダイアログフォント選択時、フォント選択ダイアログでキャンセルできるよう修正

- キャンセル処理を追加
- WM_INITDIALOG で break 抜け

Modified Paths:
--------------
    trunk/teraterm/teraterm/font_pp.cpp

-------------- next part --------------
Modified: trunk/teraterm/teraterm/font_pp.cpp
===================================================================
--- trunk/teraterm/teraterm/font_pp.cpp	2020-07-03 14:44:08 UTC (rev 8831)
+++ trunk/teraterm/teraterm/font_pp.cpp	2020-07-03 14:44:15 UTC (rev 8832)
@@ -88,7 +88,7 @@
 	return FALSE;
 }
 
-static void SetupDlgFont(HWND hWnd, FontPPData *dlg_data)
+static BOOL ChooseDlgFont(HWND hWnd, FontPPData *dlg_data)
 {
 	const TTTSet *ts = dlg_data->pts;
 
@@ -109,6 +109,7 @@
 	cf.hInstance = dlg_data->hInst;
 	cf.lCustData = (LPARAM)dlg_data;
 	BOOL result = ChooseFontA(&cf);
+	return result;
 }
 
 static void EnableCodePage(HWND hWnd, BOOL enable)
@@ -185,6 +186,8 @@
 			SendDlgItemMessage(hWnd, IDC_FONT_QUALITY, CB_SETCURSEL, cur, 0);
 
 			SetFontString(hWnd, IDC_DLGFONT_EDIT, &dlg_data->DlgFont);
+
+			break;
 		}
 		case WM_NOTIFY: {
 			NMHDR *nmhdr = (NMHDR *)lp;
@@ -226,8 +229,9 @@
 				break;
 			}
 			case IDC_DLGFONT_CHOOSE | (BN_CLICKED << 16):
-				SetupDlgFont(hWnd, dlg_data);
-				SetFontString(hWnd, IDC_DLGFONT_EDIT, &dlg_data->DlgFont);
+				if (ChooseDlgFont(hWnd, dlg_data) != FALSE) {
+					SetFontString(hWnd, IDC_DLGFONT_EDIT, &dlg_data->DlgFont);
+				}
 				break;
 
 			case IDC_DLGFONT_DEFAULT | (BN_CLICKED << 16): {


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