[Ttssh2-commit] [7578] TTProxy 高DPI対応

scmno****@osdn***** scmno****@osdn*****
2019年 4月 12日 (金) 01:21:05 JST


Revision: 7578
          https://osdn.net/projects/ttssh2/scm/svn/commits/7578
Author:   zmatsuo
Date:     2019-04-12 01:21:05 +0900 (Fri, 12 Apr 2019)
Log Message:
-----------
TTProxy 高DPI対応

Modified Paths:
--------------
    trunk/TTProxy/ProxyWSockHook.h
    trunk/TTProxy/TTProxy.h
    trunk/TTProxy/YCL/include/YCL/Dialog.h

-------------- next part --------------
Modified: trunk/TTProxy/ProxyWSockHook.h
===================================================================
--- trunk/TTProxy/ProxyWSockHook.h	2019-04-11 16:20:51 UTC (rev 7577)
+++ trunk/TTProxy/ProxyWSockHook.h	2019-04-11 16:21:05 UTC (rev 7578)
@@ -730,7 +730,7 @@
         Window conn;
         Window erro;
         Window log;
-        HFONT DlgFont;
+//      HFONT DlgFont;
     protected:
         virtual bool dispatch(int message, int wParam, long lParam) {
             if (message == WM_COMMAND && wParam == MAKEWPARAM(IDC_REFER, BN_CLICKED)) {
@@ -765,11 +765,12 @@
         }
         virtual bool onInitDialog() {
             char uimsg[MAX_UIMSG], uitmp[MAX_UIMSG];
-            LOGFONT logfont;
-            HFONT font;
+//          LOGFONT logfont;
+//          HFONT font;
 
             Dialog::onInitDialog();
 
+#if 0
             font = (HFONT)SendMessage(WM_GETFONT, 0, 0);
             GetObject(font, sizeof(LOGFONT), &logfont);
             if (UTIL_get_lang_font("DLG_TAHOMA_FONT", HWND(), &logfont, &DlgFont)) {
@@ -800,6 +801,7 @@
             else {
                 DlgFont = NULL;
             }
+#endif
 
             GetWindowText(uitmp, sizeof(uitmp));
             UTIL_get_lang_msg("DLG_OTHER_TITLE", uimsg, sizeof(uimsg), uitmp);
@@ -904,15 +906,19 @@
 
             logfile = log.GetWindowTextLength() > 0 ? log.GetWindowText() : NULL;
 
+#if 0
             if (DlgFont != NULL) {
                 DeleteObject(DlgFont);
             }
+#endif
             Dialog::onOK();
         }
         virtual void onCancel() {
+#if 0
             if (DlgFont != NULL) {
                 DeleteObject(DlgFont);
             }
+#endif
             Dialog::onCancel();
         }
     public:
@@ -941,7 +947,7 @@
         EditBoxCtrl  user;
         EditBoxCtrl  pass;
         bool lock;
-        HFONT DlgFont;
+//      HFONT DlgFont;
     protected:
         virtual bool dispatch(int message, int wParam, long lParam) {
             if (message == WM_COMMAND) {
@@ -963,11 +969,12 @@
         }
         virtual bool onInitDialog() {
             char uimsg[MAX_UIMSG], uitmp[MAX_UIMSG];
-            LOGFONT logfont;
-            HFONT font;
+//          LOGFONT logfont;
+//          HFONT font;
 
             Dialog::onInitDialog();
 
+#if 0
             font = (HFONT)SendMessage(WM_GETFONT, 0, 0);
             GetObject(font, sizeof(LOGFONT), &logfont);
             if (UTIL_get_lang_font("DLG_TAHOMA_FONT", HWND(), &logfont, &DlgFont)) {
@@ -990,6 +997,7 @@
             else {
                 DlgFont = NULL;
             }
+#endif
 
             GetWindowText(uitmp, sizeof(uitmp));
             UTIL_get_lang_msg("DLG_SETUP_TITLE", uimsg, sizeof(uimsg), uitmp);
@@ -1081,15 +1089,19 @@
                     return;
                 }
             }
+#if 0
             if (DlgFont != NULL) {
                 DeleteObject(DlgFont);
             }
+#endif
             Dialog::onOK();
         }
         virtual void onCancel() {
+#if 0
             if (DlgFont != NULL) {
                 DeleteObject(DlgFont);
             }
+#endif
             Dialog::onCancel();
         }
         void onOptions() {
@@ -1194,7 +1206,7 @@
 
     class AboutDialog : public Dialog {
     private:
-        HFONT DlgFont;
+//      HFONT DlgFont;
         virtual bool onInitDialog() {
             String buf;
             char *buf2;
@@ -1201,9 +1213,10 @@
             const char *ver;
             int n, a, b, c, d, len;
             char uimsg[MAX_UIMSG], uimsg2[MAX_UIMSG], uimsg3[MAX_UIMSG];
-            LOGFONT logfont;
-            HFONT font;
+//          LOGFONT logfont;
+//          HFONT font;
 
+#if 0
             font = (HFONT)SendMessage(WM_GETFONT, 0, 0);
             GetObject(font, sizeof(LOGFONT), &logfont);
             if (UTIL_get_lang_font("DLG_TAHOMA_FONT", HWND(), &logfont, &DlgFont)) {
@@ -1213,6 +1226,7 @@
             else {
                 DlgFont = NULL;
             }
+#endif
 
             GetWindowText(uimsg2, sizeof(uimsg2));
             UTIL_get_lang_msg("DLG_ABOUT_TITLE", uimsg, sizeof(uimsg), uimsg2);
@@ -1244,9 +1258,11 @@
             return true;
         }
         virtual void onOK() {
+#if 0
             if (DlgFont != NULL) {
                 DeleteObject(DlgFont);
             }
+#endif
             Dialog::onOK();
         }
     public :

Modified: trunk/TTProxy/TTProxy.h
===================================================================
--- trunk/TTProxy/TTProxy.h	2019-04-11 16:20:51 UTC (rev 7577)
+++ trunk/TTProxy/TTProxy.h	2019-04-11 16:21:05 UTC (rev 7578)
@@ -249,10 +249,16 @@
 		switch (cmd) {
 		case ID_ABOUTMENU:
 			copy_UILanguageFile();
+			SetDialogFont(getInstance().ts->SetupFName,
+						  getInstance().ts->UILanguageFile,
+						  "TTProxy");
 			ProxyWSockHook::aboutDialog(hWin);
 			return 1;
 		case ID_PROXYSETUPMENU:
 			copy_UILanguageFile();
+			SetDialogFont(getInstance().ts->SetupFName,
+						  getInstance().ts->UILanguageFile,
+						  "TTProxy");
 			ProxyWSockHook::setupDialog(hWin);
 			return 1;
 		case ID_ASYNCMESSAGEBOX:

Modified: trunk/TTProxy/YCL/include/YCL/Dialog.h
===================================================================
--- trunk/TTProxy/YCL/include/YCL/Dialog.h	2019-04-11 16:20:51 UTC (rev 7577)
+++ trunk/TTProxy/YCL/include/YCL/Dialog.h	2019-04-11 16:21:05 UTC (rev 7578)
@@ -14,6 +14,8 @@
 #include <YCL/Window.h>
 #include <YCL/Hashtable.h>
 
+#include "dlglib.h"
+
 namespace yebisuya {
 
 class Dialog : virtual public Window {
@@ -109,7 +111,11 @@
 	}
 	int open(HINSTANCE instance, int resourceId, HWND owner = NULL) {
 		YCLVERIFY(prepareOpen(this) == NULL, "Another dialog has been opening yet.");
+#if 0
 		return ::DialogBoxParam(instance, MAKEINTRESOURCE(resourceId), owner, DialogProc, NULL);
+#else
+		return TTDialogBoxParam(instance, MAKEINTRESOURCE(resourceId), owner, DialogProc, NULL);
+#endif
 	}
 protected:
 	virtual bool dispatch(int message, int wparam, long lparam) {


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