[Ttssh2-commit] [7593] TTXViewModeを高DIP対応

アーカイブの一覧に戻る
scmno****@osdn***** scmno****@osdn*****
2019年 4月 18日 (木) 00:08:59 JST


Revision: 7593
          https://osdn.net/projects/ttssh2/scm/svn/commits/7593
Author:   zmatsuo
Date:     2019-04-18 00:08:59 +0900 (Thu, 18 Apr 2019)
Log Message:
-----------
TTXViewModeを高DIP対応

Modified Paths:
--------------
    trunk/TTXSamples/TTXViewMode/CMakeLists.txt
    trunk/TTXSamples/TTXViewMode/TTXViewMode.c
    trunk/TTXSamples/TTXViewMode/TTXViewMode.v10.vcxproj
    trunk/TTXSamples/TTXViewMode/TTXViewMode.v11.vcxproj
    trunk/TTXSamples/TTXViewMode/TTXViewMode.v12.vcxproj
    trunk/TTXSamples/TTXViewMode/TTXViewMode.v14.vcxproj
    trunk/TTXSamples/TTXViewMode/TTXViewMode.v15.vcxproj
    trunk/TTXSamples/TTXViewMode/TTXViewMode.v16.vcxproj
    trunk/TTXSamples/TTXViewMode/TTXViewMode.v9.vcproj
    trunk/TTXSamples/TTXViewMode/TTXViewMode.vcproj

-------------- next part --------------
Modified: trunk/TTXSamples/TTXViewMode/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXViewMode/CMakeLists.txt	2019-04-17 15:08:42 UTC (rev 7592)
+++ trunk/TTXSamples/TTXViewMode/CMakeLists.txt	2019-04-17 15:08:59 UTC (rev 7593)
@@ -2,6 +2,20 @@
 
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/")
 
+set(COMMON_SRC
+  ../../teraterm/common/dlglib.h
+  ../../teraterm/common/dlglib.c
+  ../../teraterm/common/dlglib_cpp.cpp
+  ../../teraterm/common/dlglib_tmpl.cpp
+  ../../teraterm/common/ttlib.c
+  )
+
+source_group(
+  "common"
+  FILES
+  ${COMMON_SRC}
+  )
+
 set(SRC
   resource.h
   TTXViewMode.c
@@ -19,6 +33,7 @@
 add_library(
   TTXViewMode SHARED
   ${SRC}
+  ${COMMON_SRC}
   )
 
 set_target_properties(
@@ -26,3 +41,10 @@
   PROPERTIES
   PREFIX ""
   )
+
+target_link_libraries(
+  TTXViewMode
+  ttpcmn
+  #
+  gdi32
+  )

Modified: trunk/TTXSamples/TTXViewMode/TTXViewMode.c
===================================================================
--- trunk/TTXSamples/TTXViewMode/TTXViewMode.c	2019-04-17 15:08:42 UTC (rev 7592)
+++ trunk/TTXSamples/TTXViewMode/TTXViewMode.c	2019-04-17 15:08:59 UTC (rev 7593)
@@ -7,6 +7,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <windows.h>
+#include "dlglib.h"
 
 #include "compat_w95.h"
 
@@ -156,7 +157,7 @@
   
   switch (msg) {
     case WM_INITDIALOG:
-      /* nothing to do */
+      CenterWindow(dlg, GetParent(dlg));
       return TRUE;
     case WM_COMMAND:
       switch (LOWORD(wParam)) {
@@ -163,15 +164,15 @@
         case IDOK:
 	  GetDlgItemText(dlg, IDC_CURPASS, password, sizeof(password));
 	  if (strcmp(pvar->password, password) == 0) {
-	    EndDialog(dlg, IDOK);
+	    TTEndDialog(dlg, IDOK);
 	  }
 	  else {
 	    MessageBox(NULL, "Invalid Password", "Invalid Password", MB_OK | MB_ICONEXCLAMATION);
-	    EndDialog(dlg, IDCANCEL);
+	    TTEndDialog(dlg, IDCANCEL);
 	  }
 	  return TRUE;
 	case IDCANCEL:
-	  EndDialog(dlg, IDCANCEL);
+	  TTEndDialog(dlg, IDCANCEL);
 	  return TRUE;
       }
       break;
@@ -184,7 +185,7 @@
 
   switch (msg) {
     case WM_INITDIALOG:
-      /* nothing to do */
+      CenterWindow(dlg, GetParent(dlg));
       return TRUE;
     case WM_COMMAND:
       switch (LOWORD(wParam)) {
@@ -196,20 +197,20 @@
 	    if (strcmp(passwd1, passwd2) == 0) {
 	      strncpy_s(pvar->password, sizeof(pvar->password), passwd1, _TRUNCATE);
 	      MessageBox(NULL, "Password changed", "TTXViewMode", MB_OK | MB_ICONEXCLAMATION);
-	      EndDialog(dlg, IDOK);
+	      TTEndDialog(dlg, IDOK);
 	    }
 	    else {
 	      MessageBox(NULL, "New password not matched.", "TTXViewMode", MB_OK | MB_ICONEXCLAMATION);
-	      EndDialog(dlg, IDCANCEL);
+	      TTEndDialog(dlg, IDCANCEL);
 	    }
 	  }
 	  else {
 	    MessageBox(NULL, "Invalid Password", "TTXViewMode", MB_OK | MB_ICONEXCLAMATION);
-	    EndDialog(dlg, IDCANCEL);
+	    TTEndDialog(dlg, IDCANCEL);
 	  }
 	  return TRUE;
 	case IDCANCEL:
-	  EndDialog(dlg, IDCANCEL);
+	  TTEndDialog(dlg, IDCANCEL);
 	  return TRUE;
       }
       break;
@@ -222,7 +223,9 @@
     case ID_MENU_VIEWMODE:
       if (pvar->enable) {
         if (strcmp(pvar->password, "") != 0) {
-          switch (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INPUT_PASSWORD), hWin, ViewModeInputPass, (LPARAM)NULL)) {
+          SetDialogFont(pvar->ts->SetupFName, pvar->ts->UILanguageFile,
+                        "TTXViewMode", "DLG_TAHOMA_FONT");
+          switch (TTDialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INPUT_PASSWORD), hWin, ViewModeInputPass, (LPARAM)NULL)) {
             case IDOK:
               pvar->enable = FALSE;
 	      CheckMenuItem(pvar->ControlMenu, ID_MENU_VIEWMODE, MF_BYCOMMAND | MF_UNCHECKED);
@@ -247,7 +250,9 @@
       }
       return 1;
     case ID_MENU_SETPASS:
-      switch (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SET_PASSWORD), hWin, ViewModeSetPass, (LPARAM)NULL)) {
+      SetDialogFont(pvar->ts->SetupFName, pvar->ts->UILanguageFile,
+                    "TTXViewMode", "DLG_TAHOMA_FONT");
+      switch (TTDialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SET_PASSWORD), hWin, ViewModeSetPass, (LPARAM)NULL)) {
 	case IDOK:
 	  break;
 	case IDCANCEL:

Modified: trunk/TTXSamples/TTXViewMode/TTXViewMode.v10.vcxproj
===================================================================
--- trunk/TTXSamples/TTXViewMode/TTXViewMode.v10.vcxproj	2019-04-17 15:08:42 UTC (rev 7592)
+++ trunk/TTXSamples/TTXViewMode/TTXViewMode.v10.vcxproj	2019-04-17 15:08:59 UTC (rev 7593)
@@ -59,6 +59,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
@@ -75,6 +76,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>
@@ -83,6 +85,10 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\teraterm\common\dlglib.c" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_cpp.cpp" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_tmpl.cpp" />
+    <ClCompile Include="..\..\teraterm\common\ttlib.c" />
     <ClCompile Include="TTXViewMode.c" />
   </ItemGroup>
   <ItemGroup>

Modified: trunk/TTXSamples/TTXViewMode/TTXViewMode.v11.vcxproj
===================================================================
--- trunk/TTXSamples/TTXViewMode/TTXViewMode.v11.vcxproj	2019-04-17 15:08:42 UTC (rev 7592)
+++ trunk/TTXSamples/TTXViewMode/TTXViewMode.v11.vcxproj	2019-04-17 15:08:59 UTC (rev 7593)
@@ -64,6 +64,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
@@ -80,6 +81,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>
@@ -88,6 +90,10 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\teraterm\common\dlglib.c" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_cpp.cpp" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_tmpl.cpp" />
+    <ClCompile Include="..\..\teraterm\common\ttlib.c" />
     <ClCompile Include="TTXViewMode.c" />
   </ItemGroup>
   <ItemGroup>

Modified: trunk/TTXSamples/TTXViewMode/TTXViewMode.v12.vcxproj
===================================================================
--- trunk/TTXSamples/TTXViewMode/TTXViewMode.v12.vcxproj	2019-04-17 15:08:42 UTC (rev 7592)
+++ trunk/TTXSamples/TTXViewMode/TTXViewMode.v12.vcxproj	2019-04-17 15:08:59 UTC (rev 7593)
@@ -64,6 +64,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
@@ -80,6 +81,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>
@@ -88,6 +90,10 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\teraterm\common\dlglib.c" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_cpp.cpp" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_tmpl.cpp" />
+    <ClCompile Include="..\..\teraterm\common\ttlib.c" />
     <ClCompile Include="TTXViewMode.c" />
   </ItemGroup>
   <ItemGroup>

Modified: trunk/TTXSamples/TTXViewMode/TTXViewMode.v14.vcxproj
===================================================================
--- trunk/TTXSamples/TTXViewMode/TTXViewMode.v14.vcxproj	2019-04-17 15:08:42 UTC (rev 7592)
+++ trunk/TTXSamples/TTXViewMode/TTXViewMode.v14.vcxproj	2019-04-17 15:08:59 UTC (rev 7593)
@@ -64,6 +64,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
@@ -80,6 +81,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>
@@ -88,6 +90,10 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\teraterm\common\dlglib.c" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_cpp.cpp" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_tmpl.cpp" />
+    <ClCompile Include="..\..\teraterm\common\ttlib.c" />
     <ClCompile Include="TTXViewMode.c" />
   </ItemGroup>
   <ItemGroup>

Modified: trunk/TTXSamples/TTXViewMode/TTXViewMode.v15.vcxproj
===================================================================
--- trunk/TTXSamples/TTXViewMode/TTXViewMode.v15.vcxproj	2019-04-17 15:08:42 UTC (rev 7592)
+++ trunk/TTXSamples/TTXViewMode/TTXViewMode.v15.vcxproj	2019-04-17 15:08:59 UTC (rev 7593)
@@ -64,6 +64,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
@@ -80,6 +81,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>
@@ -88,6 +90,10 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\teraterm\common\dlglib.c" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_cpp.cpp" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_tmpl.cpp" />
+    <ClCompile Include="..\..\teraterm\common\ttlib.c" />
     <ClCompile Include="TTXViewMode.c" />
   </ItemGroup>
   <ItemGroup>

Modified: trunk/TTXSamples/TTXViewMode/TTXViewMode.v16.vcxproj
===================================================================
--- trunk/TTXSamples/TTXViewMode/TTXViewMode.v16.vcxproj	2019-04-17 15:08:42 UTC (rev 7592)
+++ trunk/TTXSamples/TTXViewMode/TTXViewMode.v16.vcxproj	2019-04-17 15:08:59 UTC (rev 7593)
@@ -65,6 +65,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
@@ -81,6 +82,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>
@@ -89,6 +91,10 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\teraterm\common\dlglib.c" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_cpp.cpp" />
+    <ClCompile Include="..\..\teraterm\common\dlglib_tmpl.cpp" />
+    <ClCompile Include="..\..\teraterm\common\ttlib.c" />
     <ClCompile Include="TTXViewMode.c" />
   </ItemGroup>
   <ItemGroup>

Modified: trunk/TTXSamples/TTXViewMode/TTXViewMode.v9.vcproj
===================================================================
--- trunk/TTXSamples/TTXViewMode/TTXViewMode.v9.vcproj	2019-04-17 15:08:42 UTC (rev 7592)
+++ trunk/TTXSamples/TTXViewMode/TTXViewMode.v9.vcproj	2019-04-17 15:08:59 UTC (rev 7593)
@@ -62,6 +62,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				AdditionalDependencies=""$(SolutionDir)..\teraterm\$(ConfigurationName)\ttpcmn.lib" user32.lib ole32.lib shell32.lib gdi32.lib"
 				LinkIncremental="2"
 				GenerateDebugInformation="true"
 				SubSystem="2"
@@ -135,6 +136,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				AdditionalDependencies=""$(SolutionDir)..\teraterm\$(ConfigurationName)\ttpcmn.lib" user32.lib ole32.lib shell32.lib gdi32.lib"
 				LinkIncremental="1"
 				GenerateDebugInformation="true"
 				SubSystem="2"
@@ -176,6 +178,22 @@
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 			>
 			<File
+				RelativePath="..\..\teraterm\common\dlglib.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\teraterm\common\dlglib_cpp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\teraterm\common\dlglib_tmpl.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\teraterm\common\ttlib.c"
+				>
+			</File>
+			<File
 				RelativePath="TTXViewMode.c"
 				>
 			</File>

Modified: trunk/TTXSamples/TTXViewMode/TTXViewMode.vcproj
===================================================================
--- trunk/TTXSamples/TTXViewMode/TTXViewMode.vcproj	2019-04-17 15:08:42 UTC (rev 7592)
+++ trunk/TTXSamples/TTXViewMode/TTXViewMode.vcproj	2019-04-17 15:08:59 UTC (rev 7593)
@@ -61,7 +61,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="user32.lib"
+				AdditionalDependencies=""$(SolutionDir)..\teraterm\$(ConfigurationName)\ttpcmn.lib" user32.lib ole32.lib shell32.lib gdi32.lib"
 				LinkIncremental="2"
 				GenerateDebugInformation="true"
 				SubSystem="2"
@@ -136,7 +136,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="user32.lib"
+				AdditionalDependencies=""$(SolutionDir)..\teraterm\$(ConfigurationName)\ttpcmn.lib" user32.lib ole32.lib shell32.lib gdi32.lib"
 				LinkIncremental="1"
 				GenerateDebugInformation="true"
 				SubSystem="2"
@@ -179,6 +179,22 @@
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 			>
 			<File
+				RelativePath="..\..\teraterm\common\dlglib.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\teraterm\common\dlglib_cpp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\teraterm\common\dlglib_tmpl.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\teraterm\common\ttlib.c"
+				>
+			</File>
+			<File
 				RelativePath="TTXViewMode.c"
 				>
 			</File>


Ttssh2-commit メーリングリストの案内
アーカイブの一覧に戻る