Browse Source

增加记忆容差值_保存窗口位置

蘭雅sRGB 2 weeks ago
parent
commit
5987896ad1

+ 33 - 8
09_BoundaryGroup/ToolsBox.cpp

@@ -180,8 +180,10 @@ void ToolsBoxPlugin::OpenToolsBox() {
   int x = (screenWidth - w) / 2;
   int y = (screenHeight - h) / 2;
 
+  double exp = 0.0; // 默认初始容差值
+
   // 创建窗口数据实例      // 从文件加载
-  WinData win = {x, y, w, h};
+  WinData win = {x, y, w, h, exp};
   win = loadWinData("window.dat", win);
 
   // 设置对话框窗口的位置
@@ -189,6 +191,11 @@ void ToolsBoxPlugin::OpenToolsBox() {
   // 设置对话框窗口的父窗口  // #define GWL_HWNDPARENT      (-8)
   SetWindowLong(hDlgWnd, -8, (LONG)hAppWnd);
 
+  // 设置容差值 文本框的数值
+  char expbuf[64] = {0};
+  sprintf(expbuf, "%.1f", win.exp);
+  SetWindowText(::GetDlgItem(hDlgWnd, EXP_TEXT), expbuf); // 设置为需要的数值
+
   // 显示对话框窗口
   ShowWindow(hDlgWnd, SW_SHOW);
 
@@ -297,12 +304,13 @@ intptr_t CALLBACK ToolsBoxPlugin::DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, L
         int h = 98;
         SetWindowPos(hDlg, NULL, rect.left, rect.top, currentWidth, h, SWP_NOZORDER | SWP_NOACTIVATE);
         ShowWindow(::GetDlgItem(hDlg, MIN_TOOLS), SW_HIDE);
-        
+        double exp = GetTextValue(hDlg, EXP_TEXT);
+
         int x = rect.left;
         int y = rect.top;
         int w = currentWidth;
         // 保存窗口位置
-        WinData win = {x, y, w, h};
+        WinData win = {x, y, w, h, exp};
         saveWinData("window.dat", &win);
       } break;
 
@@ -311,23 +319,40 @@ intptr_t CALLBACK ToolsBoxPlugin::DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, L
         GetWindowRect(hDlg, &rect);
         int x = rect.left;
         int y = rect.top;
-        int h = 235; // 恢复宽高
-        int w = 210;
+        int h = 240; // 恢复宽高
+        int w = 220;
         SetWindowPos(hDlg, NULL, x, y, w, h, SWP_NOZORDER | SWP_NOACTIVATE);
         ShowWindow(::GetDlgItem(hDlg, MIN_TOOLS), !SW_HIDE);
         ShowWindow(::GetDlgItem(hDlg, EXPAND_TOOLS), !SW_HIDE);
+        double exp = GetTextValue(hDlg, EXP_TEXT);
 
         // 保存窗口位置
-        WinData win = {x, y, w, h};
+        WinData win = {x, y, w, h, exp};
         saveWinData("window.dat", &win);
 
       } break;
 
       case IDOK:
         break;
-      case IDCANCEL:
+
+       // 关闭CPG插件,保存窗口位置
+      case IDCANCEL:{
+
+        RECT rect;
+        GetWindowRect(hDlg, &rect);
+        int w = rect.right - rect.left;
+        int h = rect.bottom - rect.top;
+        int x = rect.left;
+        int y = rect.top;
+        double exp = GetTextValue(hDlg, EXP_TEXT);
+
+        // 保存窗口位置
+        WinData win = {x, y, w, h, exp};
+        saveWinData("window.dat", &win);
+
         EndDialog(hDlg, 0);
-        break;
+      } break;
+
       }
 
     } catch (_com_error &e) {

+ 1 - 0
09_BoundaryGroup/WinData.h

@@ -9,6 +9,7 @@ typedef struct {
     int y;  // y 坐标
     int w;  // 宽度
     int h;  // 高度
+    double exp; // 容差值
 } WinData;
 
 // 函数声明

+ 1 - 1
09_BoundaryGroup/cdrPDF2Clip.cpp

@@ -140,7 +140,7 @@ bool cdr_savepdf(corel *cdr, const char *outputFile)
     pdfst->SpotColors = cdrTrue;
     pdfst->Startup = pdfPageOnly;
     pdfst->SubsetFonts = cdrFalse;
-    pdfst->TextAsCurves = cdrFalse;
+    pdfst->TextAsCurves = cdrTrue;
     pdfst->Thumbnails = cdrFalse;
     cdr->ActiveDocument->PublishToPDF(_bstr_t(outputFile));
 

+ 0 - 36
09_BoundaryGroup/lycpg64_build_log.html

@@ -1,36 +0,0 @@
-<html>
-<head>
-<title>lycpg64构建日志</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
-<body>
-<tt>
-开始构建:<u>29-08-2024 at 23:49.51</u><br />
-构建结束于:<u>29-08-2024 at 23:49.52</u><p />
-<b>-------------- 构建: Release 在 lycpg64 中 (编译器: Microsoft Visual C++ 2022)---------------</b><br />
-cl.exe /nologo /W3 /EHsc  /Ox /DNDEBUG    /I..\TypeLibs /IC:\MSVC2022\include /IR:\09_BoundaryGroup /c BoundaryGroup.cpp /Foobj\Release\BoundaryGroup.obj<br />
-cl.exe /nologo /W3 /EHsc  /Ox /DNDEBUG    /I..\TypeLibs /IC:\MSVC2022\include /IR:\09_BoundaryGroup /c boxAutoGroup.cpp /Foobj\Release\boxAutoGroup.obj<br />
-cl.exe /nologo /W3 /EHsc  /Ox /DNDEBUG    /I..\TypeLibs /IC:\MSVC2022\include /IR:\09_BoundaryGroup /c cdrapi.cpp /Foobj\Release\cdrapi.obj<br />
-cl.exe /nologo /W3 /EHsc  /Ox /DNDEBUG    /I..\TypeLibs /IC:\MSVC2022\include /IR:\09_BoundaryGroup /c cdrapp.cpp /Foobj\Release\cdrapp.obj<br />
-cl.exe /nologo /W3 /EHsc  /Ox /DNDEBUG    /I..\TypeLibs /IC:\MSVC2022\include /IR:\09_BoundaryGroup /c cdrPDF2Clip.cpp /Foobj\Release\cdrPDF2Clip.obj<br />
-cl.exe /nologo /W3 /EHsc  /Ox /DNDEBUG    /I..\TypeLibs /IC:\MSVC2022\include /IR:\09_BoundaryGroup /c ToolsBox.cpp /Foobj\Release\ToolsBox.obj<br />
-rc.exe /IC:\MSVC2022\include /IR:\09_BoundaryGroup  -foobj\Release\ToolsBox.res ToolsBox.rc<br />
-cl.exe /nologo /W3 /EHsc  /Ox /DNDEBUG    /I..\TypeLibs /IC:\MSVC2022\include /IR:\09_BoundaryGroup /c vbadll.cpp /Foobj\Release\vbadll.obj<br />
-BoundaryGroup.cpp<br />
-boxAutoGroup.cpp<br />
-cdrapi.cpp<br />
-cdrapp.cpp<br />
-cdrPDF2Clip.cpp<br />
-ToolsBox.cpp<br />
-vbadll.cpp<br />
-Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384<br />
-Copyright (C) Microsoft Corporation.  All rights reserved.<br />
-<font color="#0000ff">ToolsBox.cpp(188): warning C4311: “类型强制转换”: 从“HWND”到“LONG”的指针截断</font><br />
-<font color="#0000ff">ToolsBox.cpp(188): warning C4302: “类型强制转换”: 从“HWND”到“LONG”截断</font><br />
-link.exe /dll /nologo /LIBPATH:C:\MSVC2022\lib /out:bin\Release\lycpg64.dll Gdi32.lib user32.lib Kernel32.lib obj\Release\BoundaryGroup.obj obj\Release\boxAutoGroup.obj obj\Release\cdrapi.obj obj\Release\cdrapp.obj obj\Release\cdrPDF2Clip.obj obj\Release\ToolsBox.obj obj\Release\vbadll.obj  obj\Release\ToolsBox.res<br />
-  正在创建库 bin\Release\lycpg64.lib 和对象 bin\Release\lycpg64.exp<br />
-输出文件为 bin\Release\lycpg64.dll,大小为 229.50 KB<br />
-<font color="#0000ff">程序退出, 返回状态码:0 (0 分, 1 秒)</font><br />
-<font color="#0000ff">0个错误, 2个警告 (0 分, 1 秒)</font><br />
-</tt>
-</body>
-</html>