Toolbar.bas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. VERSION 5.00
  2. Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} Toolbar
  3. Caption = "Toolbar"
  4. ClientHeight = 4230
  5. ClientLeft = 45
  6. ClientTop = 330
  7. ClientWidth = 6840
  8. OleObjectBlob = "Toolbar.frx":0000
  9. End
  10. Attribute VB_Name = "Toolbar"
  11. Attribute VB_GlobalNameSpace = False
  12. Attribute VB_Creatable = False
  13. Attribute VB_PredeclaredId = True
  14. Attribute VB_Exposed = False
  15. '// This is free and unencumbered software released into the public domain.
  16. '// For more information, please refer to https://github.com/hongwenjun
  17. #If VBA7 Then
  18. Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  19. Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
  20. Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
  21. Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  22. Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  23. Private Declare PtrSafe Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
  24. Private Declare PtrSafe Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
  25. #Else
  26. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  27. Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
  28. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
  29. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  30. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  31. Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
  32. Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
  33. #End If
  34. Private Const GWL_STYLE As Long = (-16)
  35. Private Const GWL_EXSTYLE = (-20)
  36. Private Const WS_CAPTION As Long = &HC00000
  37. Private Const WS_EX_DLGMODALFRAME = &H1&
  38. 'Constants for transparency
  39. Private Const WS_EX_LAYERED = &H80000
  40. Private Const LWA_COLORKEY = &H1 'Chroma key for fading a certain color on your Form
  41. Private Const LWA_ALPHA = &H2 'Only needed if you want to fade the entire userform
  42. Public UIL_Key As Boolean
  43. Public pic1, pic2
  44. Private Sub MakeUserFormTransparent(frm As Object, Optional Color As Variant)
  45. 'set transparencies on userform
  46. Dim formhandle As Long
  47. Dim bytOpacity As Byte
  48. formhandle = FindWindow(vbNullString, Me.Caption)
  49. If IsMissing(Color) Then Color = vbWhite 'default to vbwhite
  50. bytOpacity = 100 ' variable keeping opacity setting
  51. SetWindowLong formhandle, GWL_EXSTYLE, GetWindowLong(formhandle, GWL_EXSTYLE) Or WS_EX_LAYERED
  52. 'The following line makes only a certain color transparent so the
  53. ' background of the form and any object whose BackColor you've set to match
  54. ' vbColor (default vbWhite) will be transparent.
  55. Me.BackColor = Color
  56. SetLayeredWindowAttributes formhandle, Color, bytOpacity, LWA_COLORKEY
  57. End Sub
  58. Private Sub Change_UI_Close_Voice_Click()
  59. SaveSetting "LYVBA", "Settings", "SpeakHelp", "0"
  60. MsgBox "请给我支持!" & vbNewLine & "您的支持,我才能有动力添加更多功能." & vbNewLine & "蘭雅CorelVBA工具 永久免费开源" & vbNewLine & "主题图片文件名ToolBar.jpg 安装包中有多套皮肤选用"
  61. End Sub
  62. Private Sub UserForm_Initialize()
  63. Dim IStyle As Long
  64. Dim hWnd As Long
  65. hWnd = FindWindow("ThunderDFrame", Me.Caption)
  66. IStyle = GetWindowLong(hWnd, GWL_STYLE)
  67. IStyle = IStyle And Not WS_CAPTION
  68. SetWindowLong hWnd, GWL_STYLE, IStyle
  69. DrawMenuBar hWnd
  70. IStyle = GetWindowLong(hWnd, GWL_EXSTYLE) And Not WS_EX_DLGMODALFRAME
  71. SetWindowLong hWnd, GWL_EXSTYLE, IStyle
  72. With Me
  73. .StartUpPosition = 0
  74. .Left = Val(GetSetting("LYVBA", "Settings", "Left", "400")) ' 设置工具栏位置
  75. .Top = Val(GetSetting("LYVBA", "Settings", "Top", "55"))
  76. .Height = 30
  77. .Width = 336
  78. End With
  79. OutlineKey = True
  80. OptKey = True
  81. ' 读取角线设置
  82. Bleed.text = API.GetSet("Bleed")
  83. Line_len.text = API.GetSet("Line_len")
  84. Outline_Width.text = GetSetting("LYVBA", "Settings", "Outline_Width", "0.2")
  85. UIFile = Path & "GMS\LYVBA\ToolBar.jpg"
  86. If API.ExistsFile_UseFso(UIFile) Then
  87. UI.Picture = LoadPicture(UIFile) '换UI图
  88. Set pic1 = LoadPicture(UIFile)
  89. End If
  90. UIL = Path & "GMS\LYVBA\ToolBar1.jpg"
  91. If API.ExistsFile_UseFso(UIL) Then
  92. Set pic2 = LoadPicture(UIL)
  93. UIL_Key = True
  94. End If
  95. ' 窗口透明, 最小化只显示一个图标
  96. #If VBA7 Then
  97. MakeUserFormTransparent Me, RGB(26, 22, 35)
  98. #Else
  99. ' CorelDRAW X4 / Windows7 自用关闭透明
  100. #End If
  101. End Sub
  102. Private Sub UI_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  103. UI.Visible = False
  104. If Y > 1 And Y < 16 And UIL_Key Then
  105. UI.Picture = pic2
  106. ElseIf Y > 16 And UIL_Key Then
  107. UI.Picture = pic1
  108. End If
  109. UI.Visible = True
  110. ' Debug.Print X & " , " & Y
  111. End Sub
  112. Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  113. If Button Then
  114. mx = X: my = Y
  115. End If
  116. With Me
  117. .Height = 30
  118. End With
  119. End Sub
  120. Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  121. If Button Then
  122. Me.Left = Me.Left - mx + X
  123. Me.Top = Me.Top - my + Y
  124. End If
  125. End Sub
  126. Private Sub LOGO_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  127. If Abs(X - 14) < 14 And Abs(Y - 14) < 14 And Button = 2 Then
  128. Me.Width = 336
  129. OPEN_UI_BIG.Left = 322
  130. UI.Visible = True
  131. LOGO.Visible = False
  132. TOP_ALIGN_BT.Visible = False
  133. LEFT_ALIGN_BT.Visible = False
  134. Exit Sub
  135. ElseIf Shift = fmCtrlMask Then
  136. mx = X: my = Y
  137. Else
  138. Unload Me ' Ctrl + 鼠标 关闭工具
  139. End If
  140. End Sub
  141. Private Sub LOGO_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  142. If Button Then
  143. Me.Left = Me.Left - mx + X
  144. Me.Top = Me.Top - my + Y
  145. End If
  146. End Sub
  147. Private Sub UI_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  148. Dim c As New Color
  149. ' 定义图标坐标pos
  150. Dim pos_x As Variant, pos_y As Variant
  151. pos_y = Array(14)
  152. pos_x = Array(14, 41, 67, 94, 121, 148, 174, 201, 228, 254, 281, 308, 334, 361, 388, 415, 441, 468, 495)
  153. '// 按下Ctrl键,最优先处理工具功能
  154. If Shift = 2 Then
  155. If Abs(X - pos_x(0)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  156. '// 安全线,清除辅助线
  157. Tools.guideangle CorelDRAW.ActiveSelectionRange, 3 ' 左键 3mm 出血
  158. ElseIf Abs(X - pos_x(1)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  159. '// Adobe AI EPS INDD PDF和CorelDRAW 缩略图工具
  160. AdobeThumbnail_Click
  161. ElseIf Abs(X - pos_x(2)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  162. '// 多物件拆分线段
  163. Tools.Split_Segment
  164. ElseIf Abs(X - pos_x(3)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  165. '// 智能拆字
  166. Tools.Take_Apart_Character
  167. ElseIf Abs(X - pos_x(4)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  168. '// 暂时空
  169. ElseIf Abs(X - pos_x(5)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  170. '// 暂时空
  171. ElseIf Abs(X - pos_x(6)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  172. '// 木头人智能群组,异形群组
  173. autogroup("group", 1).CreateSelection
  174. ElseIf Abs(X - pos_x(8)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  175. '// CTRL扩展工具栏
  176. Me.Height = 30 + 45
  177. ElseIf Abs(X - pos_x(9)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  178. ' 文本转曲 参数 all=1 ,支持框选和图框剪裁内的文本
  179. ' Tools.TextShape_ConvertToCurves 1
  180. End If
  181. Exit Sub
  182. End If
  183. '// 鼠标右键 扩展键按钮优先 收缩工具栏 标记范围框 居中页面 尺寸取整数 单色黑中线标记 扩展工具栏 排列工具 扩展工具栏收缩
  184. If Button = 2 Then
  185. If Abs(X - pos_x(0)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  186. '// 收缩工具栏
  187. Me.Width = 30: Me.Height = 30
  188. UI.Visible = False: LOGO.Visible = True
  189. ElseIf Abs(X - pos_x(1)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  190. '// 居中页面
  191. Tools.Align_Page_Center
  192. ElseIf Abs(X - pos_x(2)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  193. '// 标记范围框
  194. Tools.Mark_Range_Box
  195. ElseIf Abs(X - pos_x(3)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  196. '// 批量设置物件尺寸整数
  197. Tools.Size_to_Integer
  198. '//分分合合把几个功能按键合并到一起,定义到右键上
  199. ElseIf Abs(X - pos_x(4)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  200. '// Tools.分分合合
  201. ElseIf Abs(X - pos_x(5)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  202. '// 自动中线色阶条 黑白
  203. AutoColorMark.Auto_ColorMark_K
  204. ElseIf Abs(X - pos_x(6)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  205. '// 智能群组
  206. SmartGroup.Smart_Group API.Create_Tolerance
  207. ElseIf Abs(X - pos_x(8)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  208. '// 右键扩展工具栏
  209. Me.Height = 30 + 45
  210. ElseIf Abs(X - pos_x(9)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  211. '// 文本统计信息
  212. Application.FrameWork.Automation.InvokeItem "bf3bd8fe-ca26-4fe0-91b0-3b5c99786fb6"
  213. ElseIf Abs(X - pos_x(10)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  214. '// 右键排列工具
  215. TOP_ALIGN_BT.Visible = True
  216. LEFT_ALIGN_BT.Visible = True
  217. ElseIf Abs(X - pos_x(11)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  218. '// 右键扩展工具栏收缩
  219. Me.Height = 30
  220. End If
  221. Exit Sub
  222. End If
  223. '// 鼠标左键 单击按钮功能 按工具栏上图标正常功能
  224. If Abs(X - pos_x(0)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  225. '// 裁切线: 批量物件裁切线
  226. CutLines.Batch_CutLines
  227. ElseIf Abs(X - pos_x(1)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  228. '// 剪贴板尺寸建立矩形
  229. ClipbRectangle.Build_Rectangle
  230. ElseIf Abs(X - pos_x(2)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  231. '// 单线条转裁切线 - 放置到页面四边
  232. CutLines.SelectLine_to_Cropline
  233. ElseIf Abs(X - pos_x(3)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  234. '// 拼版.Arrange
  235. Arrange.Arrange
  236. ElseIf Abs(X - pos_x(4)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  237. '// 拼版裁切线
  238. CutLines.Draw_Lines
  239. ElseIf Abs(X - pos_x(5)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  240. '// 自动中线色阶条 彩色
  241. AutoColorMark.Auto_ColorMark
  242. ElseIf Abs(X - pos_x(6)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  243. '// 智能群组 没容差
  244. SmartGroup.Smart_Group
  245. ElseIf Abs(X - pos_x(7)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  246. CQL_FIND_UI.Show 0
  247. ElseIf Abs(X - pos_x(8)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  248. Replace_UI.Show 0
  249. ElseIf Abs(X - pos_x(9)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  250. ' 简单文本转曲
  251. Tools.TextShape_ConvertToCurves 0
  252. ElseIf Abs(X - pos_x(10)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  253. '// 扩展工具栏
  254. Me.Height = 30 + 45
  255. Speak_Msg "左右键有不同功能"
  256. ElseIf Abs(X - pos_x(11)) < 14 And Abs(Y - pos_y(0)) < 14 Then
  257. If Me.Height > 30 Then
  258. Me.Height = 30
  259. Else
  260. '// 最小化
  261. Me.Width = 30
  262. Me.Height = 30
  263. OPEN_UI_BIG.Left = 31
  264. UI.Visible = False
  265. LOGO.Visible = True
  266. ' 保存工具条位置 Left 和 Top
  267. SaveSetting "LYVBA", "Settings", "Left", Me.Left
  268. SaveSetting "LYVBA", "Settings", "Top", Me.Top
  269. Speak_Msg "左键缩小 右键收缩"
  270. End If
  271. End If
  272. End Sub
  273. Private Sub X_EXIT_Click()
  274. Unload Me ' 关闭
  275. End Sub
  276. '// 多页合并工具,已经合并到主线工具
  277. ' Private Sub 调用多页合并工具()
  278. ' Dim value As Integer
  279. ' value = GMSManager.RunMacro("合并多页工具", "合并多页运行.run")
  280. ' End Sub
  281. '''/// 贪心商人和好玩工具等 ///'''
  282. Private Sub Cdr_Nodes_BT_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  283. If Button = 2 Then
  284. TSP.Nodes_To_TSP
  285. ElseIf Shift = fmCtrlMask Then
  286. TSP.CDR_TO_TSP
  287. Else
  288. ' Ctrl + 鼠标 空
  289. End If
  290. End Sub
  291. Private Sub Cdr_Nodes_BT_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  292. TSP_L1.ForeColor = RGB(0, 150, 255)
  293. End Sub
  294. Private Sub START_TSP_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  295. TSP_L2.ForeColor = RGB(0, 150, 255)
  296. End Sub
  297. Private Sub PATH_TO_TSP_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  298. TSP_L3.ForeColor = RGB(0, 150, 255)
  299. End Sub
  300. Private Sub TSP2DRAW_LINE_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  301. TSP_L4.ForeColor = RGB(0, 150, 255)
  302. End Sub
  303. Private Sub TSP2DRAW_LINE_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  304. If Button = 2 Then
  305. TSP.TSP_TO_DRAW_LINE
  306. ElseIf Shift = fmCtrlMask Then
  307. TSP.TSP_TO_DRAW_LINES
  308. Else
  309. ' Ctrl + 鼠标 空
  310. End If
  311. End Sub
  312. Private Sub START_TSP_Click()
  313. TSP.START_TSP
  314. End Sub
  315. Private Sub PATH_TO_TSP_Click()
  316. TSP.MAKE_TSP
  317. End Sub
  318. Private Sub BITMAP_BUILD_Click()
  319. Tools.Python_BITMAP
  320. End Sub
  321. Private Sub BITMAP_BUILD2_Click()
  322. Tools.Python_BITMAP2
  323. End Sub
  324. Private Sub BITMAP_MAKE_DOTS_Click()
  325. TSP.BITMAP_MAKE_DOTS
  326. End Sub
  327. '''/// Python脚本和二维码等 ///'''
  328. Private Sub Organize_Size_Click()
  329. Tools.Python_Organize_Size
  330. End Sub
  331. Private Sub Get_Number_Click()
  332. Tools.Python_Get_Barcode_Number
  333. End Sub
  334. Private Sub Make_QRCode_Click()
  335. Tools.Python_Make_QRCode
  336. Tools.QRCode_replace
  337. End Sub
  338. Private Sub QR2Vector_Click()
  339. Tools.QRCode_to_Vector
  340. End Sub
  341. Private Sub OPEN_UI_BIG_Click()
  342. Unload Me
  343. MsgBox "请给我支持!" & vbNewLine & "您的支持,我才能有动力添加更多功能." & vbNewLine & "蘭雅CorelVBA工具 永久免费开源" _
  344. & vbNewLine & "源码网址:" & vbNewLine & "https://github.com/hongwenjun/corelvba"
  345. End Sub
  346. Private Sub Settings_Click()
  347. If 0 < Val(Bleed.text) * Val(Line_len.text) < 100 Then
  348. SaveSetting "LYVBA", "Settings", "Bleed", Bleed.text
  349. SaveSetting "LYVBA", "Settings", "Line_len", Line_len.text
  350. SaveSetting "LYVBA", "Settings", "Outline_Width", Outline_Width.text
  351. End If
  352. ' 保存工具条位置 Left 和 Top
  353. SaveSetting "LYVBA", "Settings", "Left", Me.Left
  354. SaveSetting "LYVBA", "Settings", "Top", Me.Top
  355. Me.Height = 30
  356. End Sub
  357. '''///////// 图标鼠标左右点击功能调用 /////////'''
  358. Private Sub Tools_Icon_Click()
  359. ' 调用语句
  360. i = GMSManager.RunMacro("CorelDRAW_VBA", "学习CorelVBA.start")
  361. End Sub
  362. '''//// 选择多物件,组合然后拆分线段,为角线爬虫准备 ////'''
  363. Private Sub Split_Segment_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  364. If Button = 2 Then
  365. MsgBox "鼠标右键,功能待定"
  366. Exit Sub
  367. End If
  368. If Button Then
  369. Tools.Split_Segment
  370. End If
  371. End Sub
  372. Private Sub Split_Segment_Copy_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  373. If Button = 2 Then
  374. MsgBox "左键拆分线段,Ctrl合并线段"
  375. ElseIf Shift = fmCtrlMask Then
  376. Tools.Split_Segment
  377. Else
  378. ActiveSelection.CustomCommand "ConvertTo", "JoinCurves"
  379. Application.Refresh
  380. End If
  381. Speak_Msg "拆分线段,Ctrl合并线段"
  382. End Sub
  383. '''//// CorelDRAW 与 Adobe_Illustrator 剪贴板转换 ////'''
  384. Private Sub Adobe_Illustrator_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  385. Dim value As Integer
  386. If Button = 2 Then
  387. value = GMSManager.RunMacro("AIClipboard", "CopyPaste.PasteAIFormat")
  388. Exit Sub
  389. End If
  390. If Button Then
  391. value = GMSManager.RunMacro("AIClipboard", "CopyPaste.CopyAIFormat")
  392. MsgBox "CorelDRAW 与 Adobe_Illustrator 剪贴板转换" & vbNewLine & "鼠标左键复制,鼠标右键粘贴"
  393. End If
  394. End Sub
  395. '''//// 标记画框 支持容差 ////'''
  396. Private Sub Mark_CreateRectangle_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  397. If Button = 2 Then
  398. Tools.Mark_CreateRectangle True
  399. ElseIf Shift = fmCtrlMask Then
  400. Tools.Mark_CreateRectangle False
  401. Else
  402. Create_Tolerance
  403. End If
  404. Speak_Msg "标记画框 右键支持容差"
  405. End Sub
  406. '''//// 一键拆开多行组合的文字字符 ////'''
  407. Private Sub Batch_Combine_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  408. If Button = 2 Then
  409. Tools.Batch_Combine
  410. ElseIf Shift = fmCtrlMask Then
  411. Tools.Take_Apart_Character
  412. Else
  413. Create_Tolerance
  414. End If
  415. Speak_Msg "智能拆字"
  416. End Sub
  417. '''//// 简单一刀切 ////'''
  418. Private Sub Single_Line_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  419. If Button = 2 Then
  420. Tools.Single_Line_Vertical
  421. ElseIf Shift = fmCtrlMask Then
  422. Tools.Single_Line
  423. Else
  424. Tools.Single_Line_LastNode
  425. End If
  426. Speak_Msg "简单一刀切"
  427. End Sub
  428. '''//// 傻瓜火车排列 ////'''
  429. Private Sub TOP_ALIGN_BT_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  430. If Button = 2 Then
  431. Tools.傻瓜火车排列 3#
  432. ElseIf Shift = fmCtrlMask Then
  433. Tools.傻瓜火车排列 0#
  434. Else
  435. Tools.傻瓜火车排列 Set_Space_Width
  436. End If
  437. End Sub
  438. '''//// 傻瓜阶梯排列 ////'''
  439. Private Sub LEFT_ALIGN_BT_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  440. If Button = 2 Then
  441. Tools.傻瓜阶梯排列 3#
  442. ElseIf Shift = fmCtrlMask Then
  443. Tools.傻瓜阶梯排列 0#
  444. Else
  445. Tools.傻瓜阶梯排列 Set_Space_Width
  446. End If
  447. End Sub
  448. '''//// 左键-多页合并一页工具 右键-批量多页居中 ////'''
  449. Private Sub UniteOne_BT_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  450. If Button = 2 Then
  451. Tools.批量多页居中
  452. ElseIf Shift = fmCtrlMask Then
  453. UniteOne.Show 0
  454. Speak_Msg "多页合并一页"
  455. Else
  456. ' Ctrl + 鼠标 空
  457. End If
  458. End Sub
  459. '''//// Adobe AI EPS INDD PDF和CorelDRAW 缩略图工具 ////'''
  460. Private Sub AdobeThumbnail_Click()
  461. Dim h As Long, r As Long
  462. mypath = Path & "GMS\262235.xyz\"
  463. App = mypath & "GuiAdobeThumbnail.exe"
  464. h = FindWindow(vbNullString, "CorelVBA 青年节 By 蘭雅sRGB")
  465. i = ShellExecute(h, "", App, "", mypath, 1)
  466. End Sub
  467. '''//// 快速颜色选择 ////'''
  468. Private Sub Quick_Color_Select_Click()
  469. Tools.quickColorSelect
  470. End Sub
  471. Private Sub Cut_Cake_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  472. If Button = 2 Then
  473. Tools.divideVertically
  474. ElseIf Shift = fmCtrlMask Then
  475. Tools.divideHorizontally
  476. Else
  477. ' Ctrl + 鼠标 空
  478. End If
  479. End Sub
  480. '// 安全辅助线功能,三键控制,讨厌辅助线的也可以用来删除辅助线
  481. Private Sub Safe_Guideangle_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  482. If Button = 2 Then
  483. Tools.guideangle ActiveSelectionRange, 0# ' 右键0距离贴紧
  484. ElseIf Shift = fmCtrlMask Then
  485. Tools.guideangle ActiveSelectionRange, 3 ' 左键 3mm 出血
  486. Else
  487. Tools.guideangle ActiveSelectionRange, -Set_Space_Width ' Ctrl + 鼠标左键 自定义间隔
  488. End If
  489. End Sub
  490. '// 标准尺寸,左键右键Ctrl三键控制,调用三种样式
  491. Private Sub btn_makesizes_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  492. If Button = 2 Then
  493. Make_SIZE.Show 0 ' 右键
  494. ElseIf Shift = fmCtrlMask Then
  495. #If VBA7 Then
  496. Woodman.Show 0
  497. #Else ' X4 使用
  498. Make_SIZE.Show 0
  499. #End If
  500. Else
  501. Tools.Simple_Label_Numbers ' Ctrl + 鼠标 批量简单数字标注
  502. End If
  503. End Sub
  504. '// 批量转图片和导出图片文件
  505. Private Sub Photo_Form_Click()
  506. PhotoForm.Show 0
  507. End Sub
  508. '// 修复圆角缺角到直角
  509. Private Sub btn_corners_off_Click()
  510. Tools.corner_off
  511. End Sub
  512. Private Sub SortCount_Click()
  513. Tools.按面积排列 30
  514. End Sub
  515. Private Sub LevelRuler_Click()
  516. Tools.角度转平
  517. End Sub
  518. Private Sub MirrorLine_Click()
  519. Tools.参考线镜像
  520. End Sub
  521. Private Sub AutoRotate_Click()
  522. Tools.自动旋转角度
  523. End Sub
  524. Private Sub SwapShape_Click()
  525. Tools.交换对象
  526. End Sub
  527. '// 小工具快速启动
  528. Private Sub Open_Calc_Click()
  529. Launcher.START_Calc
  530. End Sub
  531. Private Sub Open_Notepad_Click()
  532. Launcher.START_Notepad
  533. End Sub
  534. Private Sub ImageReader_Click()
  535. Launcher.START_Barcode_ImageReader
  536. End Sub
  537. Private Sub Video_Camera_Click()
  538. Launcher.START_Bandicam
  539. End Sub
  540. Private Sub myfonts_Click()
  541. Launcher.START_whatthefont
  542. End Sub
  543. Private Sub VectorMagic_Click()
  544. Launcher.START_Vector_Magic
  545. End Sub
  546. Private Sub waifu2x_Click()
  547. Launcher.START_waifu2x
  548. End Sub