Revision: 8966 https://osdn.net/projects/ttssh2/scm/svn/commits/8966 Author: zmatsuo Date: 2020-11-02 00:27:18 +0900 (Mon, 02 Nov 2020) Log Message: ----------- Kermit 取得ダイアログをダイアログフォント変更に対応するよう修正 - GetGetFname()#ttfile.c Modified Paths: -------------- branches/proto_unicode/teraterm/teraterm/filesys.cpp branches/proto_unicode/teraterm/teraterm/filesys.h branches/proto_unicode/teraterm/ttpfile/ttfile.c -------------- next part -------------- Modified: branches/proto_unicode/teraterm/teraterm/filesys.cpp =================================================================== --- branches/proto_unicode/teraterm/teraterm/filesys.cpp 2020-11-01 14:59:13 UTC (rev 8965) +++ branches/proto_unicode/teraterm/teraterm/filesys.cpp 2020-11-01 15:27:18 UTC (rev 8966) @@ -827,7 +827,7 @@ FileVar->OpId = OpKmtSend; if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0) { - if (! (*GetGetFname)(FileVar->HMainWin,FileVar) || + if (! (*GetGetFname)(FileVar->HMainWin,FileVar, &ts) || (strlen(FileVar->FullName)==0)) { ProtoEnd(); Modified: branches/proto_unicode/teraterm/teraterm/filesys.h =================================================================== --- branches/proto_unicode/teraterm/teraterm/filesys.h 2020-11-01 14:59:13 UTC (rev 8965) +++ branches/proto_unicode/teraterm/teraterm/filesys.h 2020-11-01 15:27:18 UTC (rev 8966) @@ -40,7 +40,7 @@ typedef BOOL (PASCAL *PGetMultiFname) (PFileVar fv, PCHAR CurDir, WORD FuncId, LPWORD Option); typedef BOOL (PASCAL *PGetGetFname) - (HWND HWin, PFileVar fv); + (HWND HWin, PFileVar fv, PTTSet ts); typedef void (PASCAL *PSetFileVar) (PFileVar fv); typedef BOOL (PASCAL *PGetXFname) (HWND HWin, BOOL Receive, LPLONG Option, PFileVar fv, PCHAR CurDir); Modified: branches/proto_unicode/teraterm/ttpfile/ttfile.c =================================================================== --- branches/proto_unicode/teraterm/ttpfile/ttfile.c 2020-11-01 14:59:13 UTC (rev 8965) +++ branches/proto_unicode/teraterm/ttpfile/ttfile.c 2020-11-01 15:27:18 UTC (rev 8966) @@ -58,7 +58,6 @@ static HFONT DlgFoptFont; static HFONT DlgXoptFont; -static HFONT DlgGetfnFont; char UILanguageFile[MAX_PATH]; char FileSendFilter[128]; @@ -496,8 +495,6 @@ PFileVar fv; char TempFull[MAX_PATH]; int i, j; - LOGFONT logfont; - HFONT font; switch (Message) { case WM_INITDIALOG: @@ -504,22 +501,7 @@ fv = (PFileVar)lParam; SetWindowLongPtr(Dialog, DWLP_USER, lParam); SendDlgItemMessage(Dialog, IDC_GETFN, EM_LIMITTEXT, sizeof(TempFull)-1,0); - - font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0); - GetObject(font, sizeof(LOGFONT), &logfont); - if (get_lang_font("DLG_SYSTEM_FONT", Dialog, &logfont, &DlgGetfnFont, UILanguageFile)) { - SendDlgItemMessage(Dialog, IDC_FILENAME, WM_SETFONT, (WPARAM)DlgGetfnFont, MAKELPARAM(TRUE,0)); - SendDlgItemMessage(Dialog, IDC_GETFN, WM_SETFONT, (WPARAM)DlgGetfnFont, MAKELPARAM(TRUE,0)); - SendDlgItemMessage(Dialog, IDOK, WM_SETFONT, (WPARAM)DlgGetfnFont, MAKELPARAM(TRUE,0)); - SendDlgItemMessage(Dialog, IDCANCEL, WM_SETFONT, (WPARAM)DlgGetfnFont, MAKELPARAM(TRUE,0)); - SendDlgItemMessage(Dialog, IDC_GETFNHELP, WM_SETFONT, (WPARAM)DlgGetfnFont, MAKELPARAM(TRUE,0)); - } - else { - DlgGetfnFont = NULL; - } - SetI18nDlgStrs("Tera Term", Dialog, text_info, _countof(text_info), UILanguageFile); - return TRUE; case WM_COMMAND: @@ -534,15 +516,9 @@ strncat_s(fv->FullName,sizeof(fv->FullName),&(TempFull[j]),_TRUNCATE); } EndDialog(Dialog, 1); - if (DlgGetfnFont != NULL) { - DeleteObject(DlgGetfnFont); - } return TRUE; case IDCANCEL: EndDialog(Dialog, 0); - if (DlgGetfnFont != NULL) { - DeleteObject(DlgGetfnFont); - } return TRUE; case IDC_GETFNHELP: if (fv!=NULL) { @@ -555,11 +531,13 @@ return FALSE; } -BOOL WINAPI GetGetFname(HWND HWin, PFileVar fv) +BOOL WINAPI GetGetFname(HWND HWin, PFileVar fv, PTTSet ts) { - return (BOOL)DialogBoxParam(hInst, - MAKEINTRESOURCE(IDD_GETFNDLG), - HWin, GetFnDlg, (LPARAM)fv); + SetDialogFont(ts->DialogFontName, ts->DialogFontPoint, ts->DialogFontCharSet, + ts->UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT"); + return (BOOL)TTDialogBoxParam(hInst, + MAKEINTRESOURCE(IDD_GETFNDLG), + HWin, GetFnDlg, (LPARAM)fv); } void WINAPI SetFileVar(PFileVar fv)