Toolbar.bas 22 KB

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