Toolbar.bas 22 KB

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