MeasureActionMenu.cs 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840
  1. using Metis.Measuring;
  2. using PaintDotNet.Annotation.Enum;
  3. using PaintDotNet.Base;
  4. using PaintDotNet.Data.Param;
  5. using PaintDotNet.Measuring;
  6. using System;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using System.Globalization;
  10. using System.Windows.Forms;
  11. namespace PaintDotNet.Menus
  12. {
  13. /// <summary>
  14. /// 图像测量菜单
  15. /// </summary>
  16. internal sealed class MeasureActionMenu : PdnMenuItem
  17. {
  18. public static ArrayList ArrayList1;
  19. public static ArrayList ArrayList2;
  20. public static ArrayList ArrayList3;
  21. public static bool InitKb = true;
  22. private PdnMenuItem menuChoiseAction;
  23. private PdnMenuItem menuSelectAllAction;
  24. private PdnMenuItem menuContinuousDrawingAction;
  25. private PdnMenuItem menuClearAllAction;
  26. private ToolStripSeparator menuHelpSeparator1;
  27. private PdnMenuItem menuOpticalDensity;
  28. private PdnMenuItem menuBitmapAnalysis;
  29. private ToolStripSeparator menuHelpSeparator2;
  30. private PdnMenuItem menuLengthMeasurement;
  31. private PdnMenuItem menuMultiPointLineSegment;
  32. private PdnMenuItem menuCurveLength;
  33. private PdnMenuItem menuPointPerpendicular;
  34. private PdnMenuItem menuParallelLines;
  35. private PdnMenuItem menuPolygonMeasurement;
  36. private PdnMenuItem menuCircularMeasurement;
  37. private PdnMenuItem menuAngleMeasurement;
  38. private PdnMenuItem menuRegistrationMeasurement;
  39. private ToolStripSeparator menuHelpSeparator3;
  40. private PdnMenuItem menuRulerCalibration;
  41. private PdnMenuItem menuMeasureList;
  42. private PdnMenuItem menuTheoreticalScale;
  43. private PdnMenuItem menuGeometryMeasure;
  44. //标尺标定子菜单
  45. //标尺标定
  46. private PdnMenuItem menuSubRulerCalibration;
  47. //应用当前
  48. private PdnMenuItem menuSubApplyCurrent;
  49. //应用全部
  50. private PdnMenuItem menuSubApplyAll;
  51. //长度测量子菜单
  52. //直线
  53. private PdnMenuItem menuStraightLine;
  54. //长度
  55. private PdnMenuItem menuLengthLine;
  56. //水平线
  57. private PdnMenuItem menuHorizontalLine;
  58. //垂线
  59. private PdnMenuItem menuPerpendicular;
  60. //垂线
  61. private PdnMenuItem menuDistance;
  62. //多点线段子菜单
  63. //多点直线
  64. private PdnMenuItem menuMultipointStraightLine;
  65. //多点水平线
  66. private PdnMenuItem menuMultipointHorizontalLine;
  67. //多点线段
  68. private PdnMenuItem menuMultipointLineSegment1;
  69. //多点垂直线
  70. private PdnMenuItem menuMultipointVerticalLine;
  71. //曲线长度子菜单
  72. //折线
  73. private PdnMenuItem menuPolyline;
  74. //轨迹曲线
  75. private PdnMenuItem menuTraceCurve;
  76. //曲线
  77. private PdnMenuItem menuCurve;
  78. //点垂线子菜单
  79. //点垂线
  80. private PdnMenuItem menuPointVertical;
  81. //多点垂线
  82. private PdnMenuItem menuMultiPointVertical;
  83. //水平多点垂线
  84. private PdnMenuItem menuHorizontalMultipointVertical;
  85. //垂直多点垂线
  86. private PdnMenuItem menuVerticalMultipointVertical;
  87. //点到水平线距离
  88. private PdnMenuItem menuPointToHLine;
  89. //平行线测量子菜单
  90. //平行线
  91. private PdnMenuItem menuParallelLine;
  92. //多点平行线
  93. private PdnMenuItem menuMultipointParallel;
  94. //多点水平平行线
  95. private PdnMenuItem menuMultipointHorizontalParallelLines;
  96. //多点垂直平行线
  97. private PdnMenuItem menuMultipointVerticalParallelLines;
  98. //多边形测量子菜单
  99. //闭合曲线
  100. private PdnMenuItem menuClosedCurve;
  101. //多边形
  102. private PdnMenuItem menuPolygon;
  103. //矩形
  104. private PdnMenuItem menuRectangle;
  105. //任意矩形
  106. private PdnMenuItem menuArbitraryRectangle;
  107. //正方形
  108. private PdnMenuItem menuSquare;
  109. //任意正方形
  110. private PdnMenuItem menuArbitrarySquare;
  111. //轨迹多边形
  112. private PdnMenuItem menuTrackPolygon;
  113. //圆形测量子菜单
  114. //三点圆
  115. private PdnMenuItem menuThreePointCircle;
  116. //向内画圆
  117. private PdnMenuItem menuDrawCircleInward;
  118. //向外画圆
  119. private PdnMenuItem menuDrawCircleOutward;
  120. //直径画圆
  121. private PdnMenuItem menuDiameterCircle;
  122. //点到圆距离
  123. private PdnMenuItem menuPointToCircleDistance;
  124. //点到圆心距离
  125. private PdnMenuItem menuPointToCenterDistance;
  126. //点到圆弧距离
  127. private PdnMenuItem menuPointToArcDistance;
  128. //角度测量子菜单
  129. //三点角度
  130. private PdnMenuItem menuThreePointAngle;
  131. //四点角度
  132. private PdnMenuItem menuFourPointAngle;
  133. //三点弧
  134. private PdnMenuItem menuThreePointArc;
  135. // 对准度测量子菜单
  136. //圆心到圆心距离
  137. private PdnMenuItem menuCenterToCenterDistance;
  138. //两线中垂线距离
  139. private PdnMenuItem menuTwoLineVLDistance;
  140. /// <summary>
  141. /// 图像测量
  142. /// </summary>
  143. public MeasureActionMenu(int menuId)
  144. {
  145. InitializeComponent();
  146. this.MenuId = menuId;
  147. this.AutomaticScript = false;
  148. }
  149. protected override void OnAppWorkspaceChanged()
  150. {
  151. base.OnAppWorkspaceChanged();
  152. }
  153. private void InitializeComponent()
  154. {
  155. this.menuChoiseAction = new PdnMenuItem(ActionType.MeasureSelect);
  156. this.menuSelectAllAction = new PdnMenuItem(ActionType.SelectAllMeasure);
  157. this.menuContinuousDrawingAction = new PdnMenuItem(ActionType.ContinuousDrawingMeasure, true);
  158. this.menuClearAllAction = new PdnMenuItem(ActionType.ClearAllMeasure);
  159. this.menuHelpSeparator1 = new ToolStripSeparator();
  160. this.menuOpticalDensity = new PdnMenuItem(ActionType.OpticalDensity);
  161. this.menuBitmapAnalysis = new PdnMenuItem(ActionType.BitmapAnalysis);
  162. this.menuHelpSeparator2 = new ToolStripSeparator();
  163. this.menuLengthMeasurement = new PdnMenuItem(ActionType.LengthMeasurement);
  164. this.menuMultiPointLineSegment = new PdnMenuItem(ActionType.MultiPointLineSegment);
  165. this.menuCurveLength = new PdnMenuItem(ActionType.CurveLength);
  166. this.menuPointPerpendicular = new PdnMenuItem(ActionType.PointPerpendicular);
  167. this.menuParallelLines = new PdnMenuItem(ActionType.ParallelLines);
  168. this.menuPolygonMeasurement = new PdnMenuItem(ActionType.PolygonMeasurement);
  169. this.menuCircularMeasurement = new PdnMenuItem(ActionType.CircularMeasurement);
  170. this.menuAngleMeasurement = new PdnMenuItem(ActionType.AngleMeasurement);
  171. this.menuRegistrationMeasurement = new PdnMenuItem(ActionType.RegistrationMeasurement);
  172. this.menuHelpSeparator3 = new ToolStripSeparator();
  173. this.menuMeasureList = new PdnMenuItem(ActionType.MeasureList);
  174. this.menuRulerCalibration = new PdnMenuItem(ActionType.RulerCalibration);
  175. this.menuTheoreticalScale = new PdnMenuItem(ActionType.TheoreticalScale);
  176. this.menuSubRulerCalibration = new PdnMenuItem(ActionType.SubRulerCalibration);
  177. this.menuSubApplyCurrent = new PdnMenuItem(ActionType.SubApplyCurrent);
  178. this.menuSubApplyAll = new PdnMenuItem(ActionType.SubApplyAll);
  179. this.menuStraightLine = new PdnMenuItem(ActionType.StraightLine);
  180. this.menuLengthLine = new PdnMenuItem(ActionType.LengthLine);
  181. this.menuHorizontalLine = new PdnMenuItem(ActionType.HorizontalLine);
  182. this.menuPerpendicular = new PdnMenuItem(ActionType.Perpendicular);
  183. this.menuDistance = new PdnMenuItem(ActionType.StraightDistanceLine);
  184. this.menuMultipointStraightLine = new PdnMenuItem(ActionType.MultipointStraightLine);
  185. this.menuMultipointHorizontalLine = new PdnMenuItem(ActionType.MultipointLineSegment1);
  186. this.menuMultipointLineSegment1 = new PdnMenuItem(ActionType.MultipointHorizontalLine);
  187. this.menuMultipointVerticalLine = new PdnMenuItem(ActionType.MultipointVerticalLine);
  188. this.menuPolyline = new PdnMenuItem(ActionType.Polyline);
  189. this.menuCurve = new PdnMenuItem(ActionType.Curve);
  190. this.menuTraceCurve = new PdnMenuItem(ActionType.TraceCurve);
  191. this.menuPointVertical = new PdnMenuItem(ActionType.PointVertical);
  192. this.menuMultiPointVertical = new PdnMenuItem(ActionType.MultiPointVertical);
  193. this.menuHorizontalMultipointVertical = new PdnMenuItem(ActionType.HorizontalMultipointVertical);
  194. this.menuVerticalMultipointVertical = new PdnMenuItem(ActionType.VerticalMultipointVertical);
  195. this.menuPointToHLine = new PdnMenuItem(ActionType.menuPointToHLine);
  196. this.menuParallelLine = new PdnMenuItem(ActionType.ParallelLine);
  197. this.menuMultipointParallel = new PdnMenuItem(ActionType.MultipointParallel);
  198. this.menuMultipointHorizontalParallelLines = new PdnMenuItem(ActionType.MultipointHorizontalParallelLines);
  199. this.menuMultipointVerticalParallelLines = new PdnMenuItem(ActionType.MultipointVerticalParallelLines);
  200. this.menuClosedCurve = new PdnMenuItem(ActionType.ClosedCurve);
  201. this.menuPolygon = new PdnMenuItem(ActionType.Polygon);
  202. this.menuRectangle = new PdnMenuItem(ActionType.Rectangle);
  203. this.menuArbitraryRectangle = new PdnMenuItem(ActionType.ArbitraryRectangle);
  204. this.menuSquare = new PdnMenuItem(ActionType.Square);
  205. this.menuArbitrarySquare = new PdnMenuItem(ActionType.ArbitrarySquare);
  206. this.menuTrackPolygon = new PdnMenuItem(ActionType.TrackPolygon);
  207. this.menuThreePointCircle = new PdnMenuItem(ActionType.ThreePointCircle);
  208. this.menuDrawCircleInward = new PdnMenuItem(ActionType.DrawCircleInward);
  209. this.menuDrawCircleOutward = new PdnMenuItem(ActionType.DrawCircleOutward);
  210. this.menuDiameterCircle = new PdnMenuItem(ActionType.DiameterCircle);
  211. this.menuPointToCircleDistance = new PdnMenuItem(ActionType.PointToCircleDistance);
  212. this.menuPointToCenterDistance = new PdnMenuItem(ActionType.PointToCenterDistance);
  213. this.menuPointToArcDistance = new PdnMenuItem(ActionType.PointToArcDistance);
  214. this.menuThreePointAngle = new PdnMenuItem(ActionType.ThreePointAngle);
  215. this.menuFourPointAngle = new PdnMenuItem(ActionType.FourPointAngle);
  216. this.menuThreePointArc = new PdnMenuItem(ActionType.ThreePointArc);
  217. this.menuCenterToCenterDistance = new PdnMenuItem(ActionType.CenterToCenterDistance);
  218. this.menuTwoLineVLDistance = new PdnMenuItem(ActionType.TwoLineVLDistance);
  219. this.menuGeometryMeasure = new PdnMenuItem(ActionType.GeometryMeasure);
  220. //
  221. // 主菜单
  222. //
  223. this.DropDownItems.AddRange(new ToolStripItem[] {
  224. this.menuChoiseAction,
  225. this.menuSelectAllAction,
  226. this.menuContinuousDrawingAction,
  227. this.menuClearAllAction,
  228. this.menuHelpSeparator1,
  229. this.menuOpticalDensity,
  230. this.menuBitmapAnalysis,
  231. this.menuHelpSeparator2,
  232. this.menuLengthMeasurement,
  233. this.menuMultiPointLineSegment,
  234. this.menuCurveLength,
  235. this.menuCircularMeasurement,
  236. this.menuAngleMeasurement,
  237. this.menuRegistrationMeasurement,
  238. this.menuPointPerpendicular,
  239. this.menuParallelLines,
  240. this.menuPolygonMeasurement,
  241. this.menuHelpSeparator3,
  242. this.menuMeasureList,
  243. this.menuRulerCalibration,
  244. this.menuTheoreticalScale,
  245. this.menuGeometryMeasure
  246. });
  247. this.Name = "Menu.MeasureAction";
  248. this.Text = PdnResources.GetString("Menu.MeasureAction.Text");
  249. //
  250. // 选择
  251. //
  252. this.menuChoiseAction.NeedWaitKey = true;
  253. this.menuChoiseAction.Click += new EventHandler(MenuChoiseAction_Click);
  254. //
  255. // 全选
  256. //
  257. this.menuSelectAllAction.NeedWaitKey = true;
  258. this.menuSelectAllAction.Click += new EventHandler(MenuSelectAllAction_Click);
  259. //
  260. // 连续绘制
  261. //
  262. this.menuContinuousDrawingAction.NeedWaitKey = true;
  263. this.menuContinuousDrawingAction.Click += new EventHandler(MenuContinuousDrawingAction_Click);
  264. //
  265. // 清空元素
  266. //
  267. this.menuClearAllAction.Click += new EventHandler(MenuClearAllAction_Click);
  268. //
  269. // 光密度
  270. //
  271. this.menuOpticalDensity.NeedWaitKey = true;
  272. this.menuOpticalDensity.Click += new EventHandler(MenuOpticalDensity_Click);
  273. //
  274. // 位图分析
  275. //
  276. this.menuBitmapAnalysis.Click +=new EventHandler(BitmapAnalysis_Click);
  277. //
  278. // 长度测量
  279. //
  280. this.menuLengthMeasurement.DropDownItems.AddRange(new ToolStripItem[] {
  281. this.menuStraightLine,
  282. this.menuLengthLine,
  283. this.menuHorizontalLine,
  284. this.menuPerpendicular,
  285. this.menuDistance
  286. });
  287. //
  288. // 多点线段
  289. //
  290. this.menuMultiPointLineSegment.DropDownItems.AddRange(new ToolStripItem[] {
  291. this.menuMultipointStraightLine,
  292. this.menuMultipointLineSegment1,
  293. this.menuMultipointHorizontalLine,
  294. this.menuMultipointVerticalLine
  295. });
  296. //
  297. // 曲线长度
  298. //
  299. this.menuCurveLength.DropDownItems.AddRange(new ToolStripItem[] {
  300. this.menuPolyline,
  301. this.menuCurve,
  302. this.menuTraceCurve
  303. });
  304. //
  305. // 点垂线测量
  306. //
  307. this.menuPointPerpendicular.DropDownItems.AddRange(new ToolStripItem[] {
  308. this.menuPointVertical,
  309. this.menuMultiPointVertical,
  310. this.menuHorizontalMultipointVertical,
  311. this.menuVerticalMultipointVertical,
  312. this.menuPointToHLine
  313. });
  314. //
  315. // 平行线测量
  316. //
  317. this.menuParallelLines.DropDownItems.AddRange(new ToolStripItem[] {
  318. this.menuParallelLine,
  319. this.menuMultipointParallel,
  320. this.menuMultipointHorizontalParallelLines,
  321. this.menuMultipointVerticalParallelLines
  322. });
  323. //
  324. // 多边形测量
  325. //
  326. this.menuPolygonMeasurement.DropDownItems.AddRange(new ToolStripItem[] {
  327. this.menuClosedCurve,
  328. this.menuPolygon,
  329. this.menuRectangle,
  330. this.menuArbitraryRectangle,
  331. this.menuSquare,
  332. this.menuArbitrarySquare,
  333. this.menuTrackPolygon
  334. });
  335. //
  336. // 圆形测量
  337. //
  338. this.menuCircularMeasurement.DropDownItems.AddRange(new ToolStripItem[] {
  339. this.menuThreePointCircle,
  340. this.menuDrawCircleInward,
  341. this.menuDrawCircleOutward,
  342. this.menuDiameterCircle,
  343. this.menuPointToCircleDistance,
  344. this.menuPointToCenterDistance,
  345. this.menuPointToArcDistance
  346. });
  347. //
  348. // 角度测量
  349. //
  350. this.menuAngleMeasurement.DropDownItems.AddRange(new ToolStripItem[] {
  351. this.menuThreePointAngle,
  352. this.menuFourPointAngle,
  353. this.menuThreePointArc
  354. });
  355. this.menuRegistrationMeasurement.Image = PdnResources.GetImageResource("Icons.MenuMeasureRegistrationMeasurementIcon.png").Reference;
  356. this.menuRegistrationMeasurement.DropDownItems.AddRange(new ToolStripItem[] {
  357. this.menuCenterToCenterDistance,
  358. this.menuTwoLineVLDistance
  359. });
  360. //
  361. // 标尺标定
  362. //
  363. //this.menuRulerCalibration.NeedWaitKey = true;
  364. this.menuRulerCalibration.DropDownItems.AddRange(new ToolStripItem[] {
  365. this.menuSubRulerCalibration,
  366. this.menuSubApplyCurrent,
  367. this.menuSubApplyAll
  368. });
  369. //this.menuRulerCalibration.Click += new EventHandler(MenuRulerCalibration_Click);
  370. //
  371. // 测量列表
  372. //
  373. this.menuMeasureList.NeedWaitKey = true;
  374. this.menuMeasureList.Click += new EventHandler(MenuMeasureList_Click);
  375. //
  376. // 理论比例尺
  377. //
  378. this.menuTheoreticalScale.Click += new EventHandler(TheoreticalScale_Click);
  379. //
  380. // 以下是子菜单
  381. //
  382. //
  383. // 标尺标定(子菜单)
  384. //
  385. this.menuSubRulerCalibration.Text = PdnResources.GetString("Menu.MeasureAction.RulerCalibration.Text");
  386. this.menuSubRulerCalibration.NeedWaitKey = true;
  387. this.menuSubRulerCalibration.Click += new EventHandler(MenuRulerCalibration_Click);
  388. this.menuSubRulerCalibration.Image = PdnResources.GetImageResource("Icons.MenuRulerCalibration.png").Reference;
  389. //
  390. // 应用当前
  391. //
  392. this.menuSubApplyCurrent.Text = PdnResources.GetString("Menu.Imagement.Rulersetting.current.text");
  393. this.menuSubApplyCurrent.NeedWaitKey = true;
  394. this.menuSubApplyCurrent.Click += new EventHandler(MenuSubApplyCurrent_Click);
  395. this.menuSubApplyCurrent.Image = PdnResources.GetImageResource("Icons.MenuNow.png").Reference;
  396. //
  397. // 应用全部
  398. //
  399. this.menuSubApplyAll.Text = PdnResources.GetString("Menu.Binaryoperation.Binaryextraction.Applytoall.text");
  400. this.menuSubApplyAll.NeedWaitKey = true;
  401. this.menuSubApplyAll.Click += new EventHandler(MenuSubApplyAll_Click);
  402. this.menuSubApplyAll.Image = PdnResources.GetImageResource("Icons.MenuAll.png").Reference;
  403. //
  404. // 直线
  405. //
  406. this.menuStraightLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLine.Text");
  407. this.menuStraightLine.NeedWaitKey = true;
  408. this.menuStraightLine.Click += new EventHandler(MenuStraightLine_Click);
  409. this.menuStraightLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureLineIcon.png").Reference;
  410. //
  411. //
  412. // 距离
  413. //
  414. this.menuDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasureDistanceLine.Text");
  415. this.menuDistance.NeedWaitKey = true;
  416. this.menuDistance.Click += new EventHandler(MenuDistance_Click);
  417. this.menuDistance.Image = PdnResources.GetImageResource("Icons.MenuMeasureLineIcon.png").Reference;
  418. //
  419. // 长度
  420. //
  421. this.menuLengthLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text");
  422. this.menuLengthLine.NeedWaitKey = true;
  423. this.menuLengthLine.Click += new EventHandler(MenuLengthLine_Click);
  424. this.menuLengthLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureLengthIcon.png").Reference;
  425. //
  426. // 水平线
  427. //
  428. this.menuHorizontalLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureHLine.Text");
  429. this.menuHorizontalLine.NeedWaitKey = true;
  430. this.menuHorizontalLine.Click += new EventHandler(MenuHorizontalLine_Click);
  431. this.menuHorizontalLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureHLineIcon.png").Reference;
  432. //
  433. // 垂线
  434. //
  435. this.menuPerpendicular.Text = PdnResources.GetString("Menu.MeasureAction.MeasureVLine.Text");
  436. this.menuPerpendicular.NeedWaitKey = true;
  437. this.menuPerpendicular.Click += new EventHandler(MenuPerpendicular_Click);
  438. this.menuPerpendicular.Image = PdnResources.GetImageResource("Icons.MenuMeasureVLineIcon.png").Reference;
  439. //
  440. // 多点直线
  441. //
  442. this.menuMultipointStraightLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulLine.Text");
  443. this.menuMultipointStraightLine.NeedWaitKey = true;
  444. this.menuMultipointStraightLine.Click += new EventHandler(menuMultipointStraightLine_Click);
  445. this.menuMultipointStraightLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulLineIcon.png").Reference;
  446. //
  447. // 多点水平线
  448. //
  449. this.menuMultipointHorizontalLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulHVLine.Text");
  450. this.menuMultipointHorizontalLine.NeedWaitKey = true;
  451. this.menuMultipointHorizontalLine.Click += new EventHandler(menuMultipointHorizontalLine_Click);
  452. this.menuMultipointHorizontalLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulHVLineIcon.png").Reference;
  453. //
  454. // 多点线段
  455. //
  456. this.menuMultipointLineSegment1.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulSegment.Text");
  457. this.menuMultipointLineSegment1.NeedWaitKey = true;
  458. this.menuMultipointLineSegment1.Click += new EventHandler(menuMultipointLineSegment1_Click);
  459. this.menuMultipointLineSegment1.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulSegmentIcon.png").Reference;
  460. //
  461. // 多点垂直线
  462. //
  463. this.menuMultipointVerticalLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulVLine.Text");
  464. this.menuMultipointVerticalLine.NeedWaitKey = true;
  465. this.menuMultipointVerticalLine.Click += new EventHandler(menuMultipointVerticalLine_Click);
  466. this.menuMultipointVerticalLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulVLineIcon.png").Reference;
  467. //
  468. // 折线
  469. //
  470. this.menuPolyline.Text = PdnResources.GetString("Menu.MeasureAction.MeasureBrokenLine.Text");
  471. this.menuPolyline.NeedWaitKey = true;
  472. this.menuPolyline.Click += new EventHandler(MenuPolyline_Click);
  473. this.menuPolyline.Image = PdnResources.GetImageResource("Icons.MenuMeasureBrokenLineIcon.png").Reference;
  474. //
  475. // 轨迹曲线
  476. //
  477. this.menuTraceCurve.Text = PdnResources.GetString("Menu.MeasureAction.MeasureTraceCurve.Text");
  478. this.menuTraceCurve.NeedWaitKey = true;
  479. this.menuTraceCurve.Click += new EventHandler(MenuTraceCurve_Click);
  480. this.menuTraceCurve.Image = PdnResources.GetImageResource("Icons.MenuMeasureTraceCurveIcon.png").Reference;
  481. //
  482. // 曲线
  483. //
  484. this.menuCurve.Text = PdnResources.GetString("Menu.MeasureAction.MeasureCurveLine.Text");
  485. this.menuCurve.NeedWaitKey = true;
  486. this.menuCurve.Click += new EventHandler(MenuCurve_Click);
  487. this.menuCurve.Image = PdnResources.GetImageResource("Icons.MenuMeasureCurveLineIcon.png").Reference;
  488. //
  489. // 点垂线
  490. //
  491. this.menuPointVertical.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePLine.Text");
  492. this.menuPointVertical.NeedWaitKey = true;
  493. this.menuPointVertical.Click += new EventHandler(menuPointVertical_Click);
  494. this.menuPointVertical.Image = PdnResources.GetImageResource("Icons.MenuMeasurePLineIcon.png").Reference;
  495. //
  496. // 多点垂线
  497. //
  498. this.menuMultiPointVertical.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulPLine.Text");
  499. this.menuMultiPointVertical.NeedWaitKey = true;
  500. this.menuMultiPointVertical.Click += new EventHandler(menuMultiPointVertical_Click);
  501. this.menuMultiPointVertical.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulPLineIcon.png").Reference;
  502. //
  503. // 水平多点垂线
  504. //
  505. this.menuHorizontalMultipointVertical.Text = PdnResources.GetString("Menu.MeasureAction.MeasureHMulPLine.Text");
  506. this.menuHorizontalMultipointVertical.NeedWaitKey = true;
  507. this.menuHorizontalMultipointVertical.Click += new EventHandler(menuHorizontalMultipointVertical_Click);
  508. this.menuHorizontalMultipointVertical.Image = PdnResources.GetImageResource("Icons.MenuMeasureHMulPLineIcon.png").Reference;
  509. //
  510. // 垂直多点垂线
  511. //
  512. this.menuVerticalMultipointVertical.Text = PdnResources.GetString("Menu.MeasureAction.MeasureVMulPLine.Text");
  513. this.menuVerticalMultipointVertical.NeedWaitKey = true;
  514. this.menuVerticalMultipointVertical.Click += new EventHandler(menuVerticalMultipointVertical_Click);
  515. this.menuVerticalMultipointVertical.Image = PdnResources.GetImageResource("Icons.MenuMeasureVMulPLineIcon.png").Reference;
  516. //
  517. //
  518. //点到水平线距离
  519. //
  520. this.menuPointToHLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePointHLine.Text");
  521. this.menuPointToHLine.NeedWaitKey = true;
  522. this.menuPointToHLine.Click += new EventHandler(menuMultiPointToHLine_Click);
  523. this.menuPointToHLine.Image = PdnResources.GetImageResource("Icons.MenuMeasurePLineIcon.png").Reference;
  524. // 平行线
  525. //
  526. this.menuParallelLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureParallelLine.Text");
  527. this.menuParallelLine.NeedWaitKey = true;
  528. this.menuParallelLine.Click += new EventHandler(menuParallelLine_Click);
  529. this.menuParallelLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureParallelLineIcon.png").Reference;
  530. //
  531. // 多点平行线
  532. //
  533. this.menuMultipointParallel.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulParallelLine.Text");
  534. this.menuMultipointParallel.NeedWaitKey = true;
  535. this.menuMultipointParallel.Click += new EventHandler(menuMultipointParallel_Click);
  536. this.menuMultipointParallel.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulParallelLineIcon.png").Reference;
  537. //
  538. // 水平多点平行线
  539. //
  540. this.menuMultipointHorizontalParallelLines.Text = PdnResources.GetString("Menu.MeasureAction.MeasureHMulParallelLine.Text");
  541. this.menuMultipointHorizontalParallelLines.NeedWaitKey = true;
  542. this.menuMultipointHorizontalParallelLines.Click += new EventHandler(menuMultipointHorizontalParallelLines_Click);
  543. this.menuMultipointHorizontalParallelLines.Image = PdnResources.GetImageResource("Icons.MenuMeasureHMulParallelLineIcon.png").Reference;
  544. //
  545. // 垂直多点平行线
  546. //
  547. this.menuMultipointVerticalParallelLines.Text = PdnResources.GetString("Menu.MeasureAction.MeasureVMulParallelLine.Text");
  548. this.menuMultipointVerticalParallelLines.NeedWaitKey = true;
  549. this.menuMultipointVerticalParallelLines.Click += new EventHandler(menuMultipointVerticalParallelLines_Click);
  550. this.menuMultipointVerticalParallelLines.Image = PdnResources.GetImageResource("Icons.MenuMeasureVMulParallelLineIcon.png").Reference;
  551. //
  552. // 闭合曲线
  553. //
  554. this.menuClosedCurve.Text = PdnResources.GetString("Menu.MeasureAction.MeasureClosedCurve.Text");
  555. this.menuClosedCurve.NeedWaitKey = true;
  556. this.menuClosedCurve.Click += new EventHandler(menuClosedCurve_Click);
  557. this.menuClosedCurve.Image = PdnResources.GetImageResource("Icons.MenuMeasureClosedCurveIcon.png").Reference;
  558. //
  559. // 多边形
  560. //
  561. this.menuPolygon.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePolygon.Text");
  562. this.menuPolygon.NeedWaitKey = true;
  563. this.menuPolygon.Click += new EventHandler(menuPolygon_Click);
  564. this.menuPolygon.Image = PdnResources.GetImageResource("Icons.MenuMeasurePolygonIcon.png").Reference;
  565. //
  566. // 矩形
  567. //
  568. this.menuRectangle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureRectangle.Text");
  569. this.menuRectangle.NeedWaitKey = true;
  570. this.menuRectangle.Click += new EventHandler(menuRectangle_Click);
  571. this.menuRectangle.Image = PdnResources.GetImageResource("Icons.MenuMeasureRectangleIcon.png").Reference;
  572. //
  573. // 任意矩形
  574. //
  575. this.menuArbitraryRectangle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureRandRectangle.Text");
  576. this.menuArbitraryRectangle.NeedWaitKey = true;
  577. this.menuArbitraryRectangle.Click += new EventHandler(menuArbitraryRectangle_Click);
  578. this.menuArbitraryRectangle.Image = PdnResources.GetImageResource("Icons.MenuMeasureRandRectangleIcon.png").Reference;
  579. //
  580. // 正方形
  581. //
  582. this.menuSquare.Text = PdnResources.GetString("Menu.MeasureAction.MeasureSquare.Text");
  583. this.menuSquare.NeedWaitKey = true;
  584. this.menuSquare.Click += new EventHandler(menuSquare_Click);
  585. this.menuSquare.Image = PdnResources.GetImageResource("Icons.MenuMeasureSquareIcon.png").Reference;
  586. //
  587. // 任意正方形
  588. //
  589. this.menuArbitrarySquare.Text = PdnResources.GetString("Menu.MeasureAction.MeasureRandSquare.Text");
  590. this.menuArbitrarySquare.NeedWaitKey = true;
  591. this.menuArbitrarySquare.Click += new EventHandler(menuArbitrarySquare_Click);
  592. this.menuArbitrarySquare.Image = PdnResources.GetImageResource("Icons.MenuMeasureRandSquareIcon.png").Reference;
  593. //
  594. // 轨迹多边形
  595. //
  596. this.menuTrackPolygon.Text = PdnResources.GetString("Menu.MeasureAction.MeasureTracePolygon.Text");
  597. this.menuTrackPolygon.NeedWaitKey = true;
  598. this.menuTrackPolygon.Click += new EventHandler(menuTrackPolygon_Click);
  599. this.menuTrackPolygon.Image = PdnResources.GetImageResource("Icons.MenuMeasureTracePolygonIcon.png").Reference;
  600. //
  601. // 三点圆
  602. //
  603. this.menuThreePointCircle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureCircle.Text");
  604. this.menuThreePointCircle.NeedWaitKey = true;
  605. this.menuThreePointCircle.Click += new EventHandler(MenuThreePointCircle_Click);
  606. this.menuThreePointCircle.Image = PdnResources.GetImageResource("Icons.MenuMeasureCircleIcon.png").Reference;
  607. //
  608. // 向内画圆
  609. //
  610. this.menuDrawCircleInward.Text = PdnResources.GetString("Menu.MeasureAction.MeasureInnerCircle.Text");
  611. this.menuDrawCircleInward.NeedWaitKey = true;
  612. this.menuDrawCircleInward.Click += new EventHandler(MenuDrawCircleInward_Click);
  613. this.menuDrawCircleInward.Image = PdnResources.GetImageResource("Icons.MenuMeasureInnerCircleIcon.png").Reference;
  614. //
  615. // 向外画圆
  616. //
  617. this.menuDrawCircleOutward.Text = PdnResources.GetString("Menu.MeasureAction.MeasureOuterCircle.Text");
  618. this.menuDrawCircleOutward.NeedWaitKey = true;
  619. this.menuDrawCircleOutward.Click += new EventHandler(MenuDrawCircleOutward_Click);
  620. this.menuDrawCircleOutward.Image = PdnResources.GetImageResource("Icons.MenuMeasureOuterCircleIcon.png").Reference;
  621. //
  622. // 直径画圆
  623. //
  624. this.menuDiameterCircle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureDiameterCircle.Text");
  625. this.menuDiameterCircle.NeedWaitKey = true;
  626. this.menuDiameterCircle.Click += new EventHandler(MenuDiameterCircle_Click);
  627. this.menuDiameterCircle.Image = PdnResources.GetImageResource("Icons.MenuMeasureDiameterCircleIcon.png").Reference;
  628. //
  629. // 点到圆距离
  630. //
  631. this.menuPointToCircleDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePointEdgeSize.Text");
  632. this.menuPointToCircleDistance.NeedWaitKey = true;
  633. this.menuPointToCircleDistance.Click += new EventHandler(MenuPointToCircleDistance_Click);
  634. this.menuPointToCircleDistance.Image = PdnResources.GetImageResource("Icons.MenuMeasurePointEdgeSizeIcon.png").Reference;
  635. //
  636. // 点到圆心距离
  637. //
  638. this.menuPointToCenterDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePointCenterSize.Text");
  639. this.menuPointToCenterDistance.NeedWaitKey = true;
  640. this.menuPointToCenterDistance.Click += new EventHandler(MenuPointToCenterDistance_Click);
  641. this.menuPointToCenterDistance.Image = PdnResources.GetImageResource("Icons.MenuMeasurePointCenterSizeIcon.png").Reference;
  642. //
  643. // 点到圆弧距离
  644. //
  645. this.menuPointToArcDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePointArcSize.Text");
  646. this.menuPointToArcDistance.NeedWaitKey = true;
  647. this.menuPointToArcDistance.Click += new EventHandler(MenuPointToArcDistance_Click);
  648. this.menuPointToArcDistance.Image = PdnResources.GetImageResource("Icons.MenuMeasurePointCenterSizeIcon.png").Reference;
  649. //
  650. // 圆心到圆心距离
  651. //
  652. this.menuCenterToCenterDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasureCenterCenterSize.Text");
  653. this.menuCenterToCenterDistance.NeedWaitKey = true;
  654. this.menuCenterToCenterDistance.Click += new EventHandler(MenuCenterToCenterDistance_Click);
  655. this.menuCenterToCenterDistance.Image = PdnResources.GetImageResource("Icons.MenuMeasurePointCenterSizeIcon.png").Reference;
  656. //
  657. // 两线中垂线距离
  658. //
  659. this.menuTwoLineVLDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasureTwoLineVLDistance.Text");
  660. this.menuTwoLineVLDistance.NeedWaitKey = true;
  661. this.menuTwoLineVLDistance.Click += new EventHandler(MeasureTwoLineVLDistance_Click);
  662. this.menuTwoLineVLDistance.Image = PdnResources.GetImageResource("Icons.MenuTwoLineVLDistance.png").Reference;
  663. //
  664. // 三点角度
  665. //
  666. this.menuThreePointAngle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureThreePointAngle.Text");
  667. this.menuThreePointAngle.NeedWaitKey = true;
  668. this.menuThreePointAngle.Click += new EventHandler(menuThreePointAngle_Click);
  669. this.menuThreePointAngle.Image = PdnResources.GetImageResource("Icons.MenuMeasureThreePointAngleIcon.png").Reference;
  670. //
  671. // 四点角度
  672. //
  673. this.menuFourPointAngle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureFourPointAngle.Text");
  674. this.menuFourPointAngle.NeedWaitKey = true;
  675. this.menuFourPointAngle.Click += new EventHandler(menuFourPointAngle_Click);
  676. this.menuFourPointAngle.Image = PdnResources.GetImageResource("Icons.MenuMeasureFourPointAngleIcon.png").Reference;
  677. //
  678. // 三点弧
  679. //
  680. this.menuThreePointArc.Text = PdnResources.GetString("Menu.MeasureAction.MeasureThreePointArc.Text");
  681. this.menuThreePointArc.NeedWaitKey = true;
  682. this.menuThreePointArc.Click += new EventHandler(menuThreePointArc_Click);
  683. this.menuThreePointArc.Image = PdnResources.GetImageResource("Icons.MenuMeasureThreePointArcIcon.png").Reference;
  684. //
  685. // 几何测量
  686. //
  687. this.menuGeometryMeasure.Text = "交互测量";
  688. this.menuGeometryMeasure.Click += new EventHandler(menuGeometryMeasure_Click);
  689. this.menuGeometryMeasure.Image = PdnResources.GetImageResource("Icons.MenuMeasureThreePointArcIcon.png").Reference;
  690. //
  691. // 加载菜单的文字和icon
  692. //
  693. this.LoadNames(this.Name);
  694. this.LoadIcons();
  695. }
  696. protected override void OnDropDownOpening(EventArgs e)
  697. {
  698. this.menuContinuousDrawingAction.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure : false;
  699. this.menuMeasureList.Checked = AppWorkspace.Widgets.MeasureListDialog.Visible;
  700. this.menuRulerCalibration.Checked = AppWorkspace.Widgets.RuleListForm.Visible;
  701. this.menuOpticalDensity.Checked = AppWorkspace.Widgets.OpticalDensityDialog.Visible;
  702. this.menuGeometryMeasure.Checked = AppWorkspace.Widgets.GeometryMeasureDialog.Visible;
  703. if (AppWorkspace.ActiveDocumentWorkspace == null/* || AppWorkspace.ScriptRunning*/)
  704. {
  705. this.menuOpticalDensity.Enabled = false;
  706. this.menuBitmapAnalysis.Enabled = false;
  707. }
  708. else
  709. {
  710. this.menuOpticalDensity.Enabled = true;
  711. this.menuBitmapAnalysis.Enabled = true;
  712. }
  713. //this.RecursiveData(this.DropDownItems);
  714. base.OnDropDownOpening(e);
  715. }
  716. /// <summary>
  717. /// 选择
  718. /// </summary>
  719. /// <param name="sender"></param>
  720. /// <param name="e"></param>
  721. private void MenuChoiseAction_Click(object sender, EventArgs e)
  722. {
  723. if (AppWorkspace.ActiveDocumentWorkspace != null)
  724. {
  725. if (AppWorkspace.startScriptRecording)
  726. {
  727. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  728. }
  729. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  730. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.Pointer;
  731. }
  732. this.SetCameraPreviewActiveTool(DrawToolType.Pointer);
  733. }
  734. /// <summary>
  735. /// 全选
  736. /// </summary>
  737. /// <param name="sender"></param>
  738. /// <param name="e"></param>
  739. private void MenuSelectAllAction_Click(object sender, EventArgs e)
  740. {
  741. if (AppWorkspace.ActiveDocumentWorkspace != null)
  742. {
  743. if (AppWorkspace.startScriptRecording)
  744. {
  745. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  746. }
  747. AppWorkspace.ActiveDocumentWorkspace.GraphicsList.SelectAll();
  748. AppWorkspace.ActiveDocumentWorkspace.Refresh();
  749. }
  750. if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
  751. {
  752. AppWorkspace.cameraPreviewDialog.documentWorkspace.GraphicsList.SelectAll();
  753. AppWorkspace.cameraPreviewDialog.documentWorkspace.Refresh();
  754. }
  755. }
  756. /// <summary>
  757. /// 连续绘制
  758. /// </summary>
  759. /// <param name="sender"></param>
  760. /// <param name="e"></param>
  761. private void MenuContinuousDrawingAction_Click(object sender, EventArgs e)
  762. {
  763. if (AppWorkspace.ActiveDocumentWorkspace != null)
  764. {
  765. if (AppWorkspace.startScriptRecording)
  766. {
  767. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  768. }
  769. AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure = !AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure;
  770. AppWorkspace.continuousDrawingMeasure = AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure;
  771. for (int i = 0; i < AppWorkspace.DocumentWorkspaces.Length; i++)
  772. {
  773. AppWorkspace.DocumentWorkspaces[i].ContinuousDrawingMeasure = AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure;
  774. }
  775. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
  776. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
  777. if (!AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure
  778. && AppWorkspace.ActiveDocumentWorkspace.activeTool >= DrawToolType.MeasureLine && AppWorkspace.ActiveDocumentWorkspace.activeTool <= DrawToolType.MeasureThreePointArc)
  779. {
  780. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  781. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.Pointer;
  782. }
  783. this.menuContinuousDrawingAction.Checked = AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure;
  784. }
  785. if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
  786. {
  787. AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure = !AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure;
  788. if(AppWorkspace.ActiveDocumentWorkspace!=null) AppWorkspace.continuousDrawingMeasure = AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure;
  789. for (int i = 0; i < AppWorkspace.DocumentWorkspaces.Length; i++)
  790. {
  791. AppWorkspace.DocumentWorkspaces[i].ContinuousDrawingMeasure = AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure;
  792. }
  793. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
  794. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
  795. if (!AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure)
  796. {
  797. AppWorkspace.cameraPreviewDialog.documentWorkspace.ActiveTool = DrawToolType.Pointer;
  798. }
  799. if(AppWorkspace.ActiveDocumentWorkspace != null
  800. && AppWorkspace.ActiveDocumentWorkspace.activeTool >= DrawToolType.MeasureLine
  801. && AppWorkspace.ActiveDocumentWorkspace.activeTool <= DrawToolType.MeasureThreePointArc)
  802. {
  803. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  804. }
  805. this.menuContinuousDrawingAction.Checked = AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure;
  806. }
  807. }
  808. /// <summary>
  809. /// 清空元素
  810. /// </summary>
  811. /// <param name="sender"></param>
  812. /// <param name="e"></param>
  813. private void MenuClearAllAction_Click(object sender, EventArgs e)
  814. {
  815. if (AppWorkspace.ActiveDocumentWorkspace != null)
  816. {
  817. if (AppWorkspace.startScriptRecording)
  818. {
  819. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  820. }
  821. AppWorkspace.ActiveDocumentWorkspace.GraphicsList.Clear();
  822. AppWorkspace.ActiveDocumentWorkspace.Refresh();
  823. }
  824. if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
  825. {
  826. AppWorkspace.cameraPreviewDialog.documentWorkspace.GraphicsList.Clear();
  827. AppWorkspace.cameraPreviewDialog.documentWorkspace.Refresh();
  828. }
  829. }
  830. /// <summary>
  831. /// 长度测量->直线
  832. /// </summary>
  833. /// <param name="sender"></param>
  834. /// <param name="e"></param>
  835. private void MenuStraightLine_Click(object sender, EventArgs e)
  836. {
  837. if (AppWorkspace.ActiveDocumentWorkspace != null)
  838. {
  839. if (AppWorkspace.startScriptRecording)
  840. {
  841. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  842. }
  843. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  844. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureLine;
  845. }
  846. this.SetCameraPreviewActiveTool(DrawToolType.MeasureLine);
  847. }
  848. /// <summary>
  849. /// 长度测量->距离
  850. /// </summary>
  851. /// <param name="sender"></param>
  852. /// <param name="e"></param>
  853. private void MenuDistance_Click(object sender, EventArgs e)
  854. {
  855. if (AppWorkspace.ActiveDocumentWorkspace != null)
  856. {
  857. if (AppWorkspace.startScriptRecording)
  858. {
  859. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  860. }
  861. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  862. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureDistanceLine;
  863. }
  864. this.SetCameraPreviewActiveTool(DrawToolType.MeasureDistanceLine);
  865. }
  866. /// <summary>
  867. /// 长度测量->长度
  868. /// </summary>
  869. /// <param name="sender"></param>
  870. /// <param name="e"></param>
  871. private void MenuLengthLine_Click(object sender, EventArgs e)
  872. {
  873. if (AppWorkspace.ActiveDocumentWorkspace != null)
  874. {
  875. if (AppWorkspace.startScriptRecording)
  876. {
  877. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  878. }
  879. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  880. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureLength;
  881. }
  882. this.SetCameraPreviewActiveTool(DrawToolType.MeasureLength);
  883. }
  884. /// <summary>
  885. /// 长度测量->水平线
  886. /// </summary>
  887. /// <param name="sender"></param>
  888. /// <param name="e"></param>
  889. private void MenuHorizontalLine_Click(object sender, EventArgs e)
  890. {
  891. if (AppWorkspace.ActiveDocumentWorkspace != null)
  892. {
  893. if (AppWorkspace.startScriptRecording)
  894. {
  895. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  896. }
  897. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  898. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureHLine;
  899. }
  900. this.SetCameraPreviewActiveTool(DrawToolType.MeasureHLine);
  901. }
  902. /// <summary>
  903. /// 长度测量->垂线
  904. /// </summary>
  905. /// <param name="sender"></param>
  906. /// <param name="e"></param>
  907. private void MenuPerpendicular_Click(object sender, EventArgs e)
  908. {
  909. if (AppWorkspace.ActiveDocumentWorkspace != null)
  910. {
  911. if (AppWorkspace.startScriptRecording)
  912. {
  913. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  914. }
  915. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  916. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureVLine;
  917. }
  918. this.SetCameraPreviewActiveTool(DrawToolType.MeasureVLine);
  919. }
  920. /// <summary>
  921. /// 测量-曲线-折线
  922. /// </summary>
  923. /// <param name="sender"></param>
  924. /// <param name="e"></param>
  925. private void MenuPolyline_Click(object sender, EventArgs e)
  926. {
  927. if (AppWorkspace.ActiveDocumentWorkspace != null)
  928. {
  929. if (AppWorkspace.startScriptRecording)
  930. {
  931. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  932. }
  933. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  934. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureBrokenLine;
  935. }
  936. this.SetCameraPreviewActiveTool(DrawToolType.MeasureBrokenLine);
  937. }
  938. /// <summary>
  939. /// 曲线测量->轨迹曲线
  940. /// </summary>
  941. /// <param name="sender"></param>
  942. /// <param name="e"></param>
  943. private void MenuTraceCurve_Click(object sender, EventArgs e)
  944. {
  945. if (AppWorkspace.ActiveDocumentWorkspace != null)
  946. {
  947. if (AppWorkspace.startScriptRecording)
  948. {
  949. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  950. }
  951. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  952. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureTraceCurve;
  953. }
  954. this.SetCameraPreviewActiveTool(DrawToolType.MeasureTraceCurve);
  955. }
  956. /// <summary>
  957. /// 圆形->三点圆
  958. /// </summary>
  959. /// <param name="sender"></param>
  960. /// <param name="e"></param>
  961. private void MenuThreePointCircle_Click(object sender, EventArgs e)
  962. {
  963. if (AppWorkspace.ActiveDocumentWorkspace != null)
  964. {
  965. if (AppWorkspace.startScriptRecording)
  966. {
  967. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  968. }
  969. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  970. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureCircle;
  971. }
  972. this.SetCameraPreviewActiveTool(DrawToolType.MeasureCircle);
  973. }
  974. /// <summary>
  975. /// 圆形->向内画圆
  976. /// </summary>
  977. /// <param name="sender"></param>
  978. /// <param name="e"></param>
  979. private void MenuDrawCircleInward_Click(object sender, EventArgs e)
  980. {
  981. if (AppWorkspace.ActiveDocumentWorkspace != null)
  982. {
  983. if (AppWorkspace.startScriptRecording)
  984. {
  985. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  986. }
  987. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  988. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureInnerCircle;
  989. }
  990. this.SetCameraPreviewActiveTool(DrawToolType.MeasureInnerCircle);
  991. }
  992. /// <summary>
  993. /// 圆形->向外画圆
  994. /// </summary>
  995. /// <param name="sender"></param>
  996. /// <param name="e"></param>
  997. private void MenuDrawCircleOutward_Click(object sender, EventArgs e)
  998. {
  999. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1000. {
  1001. if (AppWorkspace.startScriptRecording)
  1002. {
  1003. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1004. }
  1005. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1006. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureOuterCircle;
  1007. }
  1008. this.SetCameraPreviewActiveTool(DrawToolType.MeasureOuterCircle);
  1009. }
  1010. /// <summary>
  1011. /// 圆形->直径画圆
  1012. /// </summary>
  1013. /// <param name="sender"></param>
  1014. /// <param name="e"></param>
  1015. private void MenuDiameterCircle_Click(object sender, EventArgs e)
  1016. {
  1017. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1018. {
  1019. if (AppWorkspace.startScriptRecording)
  1020. {
  1021. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1022. }
  1023. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1024. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureDiameterCircle;
  1025. }
  1026. this.SetCameraPreviewActiveTool(DrawToolType.MeasureDiameterCircle);
  1027. }
  1028. /// <summary>
  1029. /// 圆形->点到圆距离
  1030. /// </summary>
  1031. /// <param name="sender"></param>
  1032. /// <param name="e"></param>
  1033. private void MenuPointToCircleDistance_Click(object sender, EventArgs e)
  1034. {
  1035. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1036. {
  1037. if (AppWorkspace.startScriptRecording)
  1038. {
  1039. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1040. }
  1041. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1042. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePointEdgeSize;
  1043. }
  1044. this.SetCameraPreviewActiveTool(DrawToolType.MeasurePointEdgeSize);
  1045. }
  1046. /// <summary>
  1047. /// 圆形->点到圆心距离
  1048. /// </summary>
  1049. /// <param name="sender"></param>
  1050. /// <param name="e"></param>
  1051. private void MenuPointToCenterDistance_Click(object sender, EventArgs e)
  1052. {
  1053. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1054. {
  1055. if (AppWorkspace.startScriptRecording)
  1056. {
  1057. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1058. }
  1059. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1060. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePointCenterSize;
  1061. }
  1062. this.SetCameraPreviewActiveTool(DrawToolType.MeasurePointCenterSize);
  1063. }
  1064. /// <summary>
  1065. /// 圆形->点到圆弧距离
  1066. /// </summary>
  1067. /// <param name="sender"></param>
  1068. /// <param name="e"></param>
  1069. private void MenuPointToArcDistance_Click(object sender, EventArgs e)
  1070. {
  1071. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1072. {
  1073. if (AppWorkspace.startScriptRecording)
  1074. {
  1075. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1076. }
  1077. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1078. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePointArcSize;
  1079. }
  1080. this.SetCameraPreviewActiveTool(DrawToolType.MeasurePointArcSize);
  1081. }
  1082. /// <summary>
  1083. /// 对准度->圆心到圆心距离
  1084. /// </summary>
  1085. /// <param name="sender"></param>
  1086. /// <param name="e"></param>
  1087. private void MenuCenterToCenterDistance_Click(object sender, EventArgs e)
  1088. {
  1089. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1090. {
  1091. if (AppWorkspace.startScriptRecording)
  1092. {
  1093. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1094. }
  1095. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1096. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureCenterCenterSize;
  1097. }
  1098. this.SetCameraPreviewActiveTool(DrawToolType.MeasureCenterCenterSize);
  1099. }
  1100. /// <summary>
  1101. /// 对准度->两线中垂线距离
  1102. /// </summary>
  1103. /// <param name="sender"></param>
  1104. /// <param name="e"></param>
  1105. private void MeasureTwoLineVLDistance_Click(object sender, EventArgs e)
  1106. {
  1107. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1108. {
  1109. if (AppWorkspace.startScriptRecording)
  1110. {
  1111. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1112. }
  1113. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1114. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureTwoLineVLDistance;
  1115. }
  1116. this.SetCameraPreviewActiveTool(DrawToolType.MeasureTwoLineVLDistance);
  1117. }
  1118. /// <summary>
  1119. /// 曲线测量->曲线
  1120. /// </summary>
  1121. /// <param name="sender"></param>
  1122. /// <param name="e"></param>
  1123. private void MenuCurve_Click(object sender, EventArgs e)
  1124. {
  1125. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1126. {
  1127. if (AppWorkspace.startScriptRecording)
  1128. {
  1129. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1130. }
  1131. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1132. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureCurveLine;
  1133. }
  1134. this.SetCameraPreviewActiveTool(DrawToolType.MeasureCurveLine);
  1135. }
  1136. /// <summary>
  1137. /// 三点角度
  1138. /// </summary>
  1139. /// <param name="sender"></param>
  1140. /// <param name="e"></param>
  1141. private void menuThreePointAngle_Click(object sender, EventArgs e)
  1142. {
  1143. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1144. {
  1145. if (AppWorkspace.startScriptRecording)
  1146. {
  1147. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1148. }
  1149. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1150. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureThreePointAngle;
  1151. }
  1152. this.SetCameraPreviewActiveTool(DrawToolType.MeasureThreePointAngle);
  1153. }
  1154. /// <summary>
  1155. /// 四点角度
  1156. /// </summary>
  1157. /// <param name="sender"></param>
  1158. /// <param name="e"></param>
  1159. private void menuFourPointAngle_Click(object sender, EventArgs e)
  1160. {
  1161. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1162. {
  1163. if (AppWorkspace.startScriptRecording)
  1164. {
  1165. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1166. }
  1167. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1168. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureFourPointAngle;
  1169. }
  1170. this.SetCameraPreviewActiveTool(DrawToolType.MeasureFourPointAngle);
  1171. }
  1172. /// <summary>
  1173. /// 三点弧
  1174. /// </summary>
  1175. /// <param name="sender"></param>
  1176. /// <param name="e"></param>
  1177. private void menuThreePointArc_Click(object sander, EventArgs e)
  1178. {
  1179. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1180. {
  1181. if (AppWorkspace.startScriptRecording)
  1182. {
  1183. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1184. }
  1185. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1186. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureThreePointArc;
  1187. }
  1188. this.SetCameraPreviewActiveTool(DrawToolType.MeasureThreePointArc);
  1189. }
  1190. /// <summary>
  1191. /// 几何测量
  1192. /// </summary>
  1193. /// <param name="sender"></param>
  1194. /// <param name="e"></param>
  1195. private void menuGeometryMeasure_Click(object sander, EventArgs e)
  1196. {
  1197. //if (AppWorkspace.ActiveDocumentWorkspace != null)
  1198. //{
  1199. if (AppWorkspace.startScriptRecording)
  1200. {
  1201. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1202. }
  1203. AppWorkspace.Widgets.GeometryMeasureDialog.Visible = !AppWorkspace.Widgets.GeometryMeasureDialog.Visible;
  1204. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.GeometryMeasureDialog.Visible, "Geometry");
  1205. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.GeometryMeasureDialog.Visible, "Geometry");
  1206. this.menuGeometryMeasure.Checked = AppWorkspace.Widgets.GeometryMeasureDialog.Visible;
  1207. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1208. {
  1209. AppWorkspace.ActiveDocumentWorkspace.Focus();
  1210. }
  1211. //Form form = Application.OpenForms["GeometryMeasureDialog"];//尝试获取已经弹出的窗口对象
  1212. //FloatingFormMethod.ShowFloatForm(form, form == null ? new GeometryMeasureDialog(AppWorkspace) : null, AppWorkspace, true);
  1213. AppWorkspace.RefreshMeasureListView();
  1214. //}
  1215. }
  1216. ///<summary>
  1217. ///点垂线
  1218. ///</summary>
  1219. ///
  1220. private void menuPointVertical_Click(object sander, EventArgs e)
  1221. {
  1222. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1223. {
  1224. if (AppWorkspace.startScriptRecording)
  1225. {
  1226. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1227. }
  1228. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1229. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePLine;
  1230. }
  1231. this.SetCameraPreviewActiveTool(DrawToolType.MeasurePLine);
  1232. }
  1233. ///<summary>
  1234. ///多点垂线
  1235. ///</summary>
  1236. ///
  1237. private void menuMultiPointVertical_Click(object sander, EventArgs e)
  1238. {
  1239. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1240. {
  1241. if (AppWorkspace.startScriptRecording)
  1242. {
  1243. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1244. }
  1245. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1246. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulPLine;
  1247. }
  1248. this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulPLine);
  1249. }
  1250. ///<summary>
  1251. ///点到水平线距离
  1252. ///</summary>
  1253. ///
  1254. private void menuMultiPointToHLine_Click(object sander, EventArgs e)
  1255. {
  1256. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1257. {
  1258. if (AppWorkspace.startScriptRecording)
  1259. {
  1260. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1261. }
  1262. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1263. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePointHLine;
  1264. }
  1265. this.SetCameraPreviewActiveTool(DrawToolType.MeasurePointHLine);
  1266. }
  1267. ///<summary>
  1268. ///水平多点垂线
  1269. ///</summary>
  1270. ///
  1271. private void menuHorizontalMultipointVertical_Click(object sander, EventArgs e)
  1272. {
  1273. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1274. {
  1275. if (AppWorkspace.startScriptRecording)
  1276. {
  1277. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1278. }
  1279. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1280. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureHMulPLine;
  1281. }
  1282. this.SetCameraPreviewActiveTool(DrawToolType.MeasureHMulPLine);
  1283. }
  1284. ///<summary>
  1285. ///垂直多点垂线
  1286. ///</summary>
  1287. ///
  1288. private void menuVerticalMultipointVertical_Click(object sander, EventArgs e)
  1289. {
  1290. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1291. {
  1292. if (AppWorkspace.startScriptRecording)
  1293. {
  1294. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1295. }
  1296. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1297. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureVMulPLine;
  1298. }
  1299. this.SetCameraPreviewActiveTool(DrawToolType.MeasureVMulPLine);
  1300. }
  1301. ///<summary>
  1302. ///平行线
  1303. ///</summary>
  1304. ///
  1305. private void menuParallelLine_Click(object sander, EventArgs e)
  1306. {
  1307. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1308. {
  1309. if (AppWorkspace.startScriptRecording)
  1310. {
  1311. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1312. }
  1313. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1314. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureParallelLine;
  1315. }
  1316. this.SetCameraPreviewActiveTool(DrawToolType.MeasureParallelLine);
  1317. }
  1318. ///<summary>
  1319. ///多点平行线
  1320. ///</summary>
  1321. ///
  1322. private void menuMultipointParallel_Click(object sander, EventArgs e)
  1323. {
  1324. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1325. {
  1326. if (AppWorkspace.startScriptRecording)
  1327. {
  1328. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1329. }
  1330. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1331. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulParallelLine;
  1332. }
  1333. this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulParallelLine);
  1334. }
  1335. ///<summary>
  1336. ///水平多点平行线
  1337. ///</summary>
  1338. ///
  1339. private void menuMultipointHorizontalParallelLines_Click(object sander, EventArgs e)
  1340. {
  1341. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1342. {
  1343. if (AppWorkspace.startScriptRecording)
  1344. {
  1345. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1346. }
  1347. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1348. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureHMulParallelLine;
  1349. }
  1350. this.SetCameraPreviewActiveTool(DrawToolType.MeasureHMulParallelLine);
  1351. }
  1352. ///<summary>
  1353. ///垂直多点平行线
  1354. ///</summary>
  1355. ///
  1356. private void menuMultipointVerticalParallelLines_Click(object sander, EventArgs e)
  1357. {
  1358. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1359. {
  1360. if (AppWorkspace.startScriptRecording)
  1361. {
  1362. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1363. }
  1364. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1365. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureVMulParallelLine;
  1366. }
  1367. this.SetCameraPreviewActiveTool(DrawToolType.MeasureVMulParallelLine);
  1368. }
  1369. ///<summary>
  1370. ///闭合曲线
  1371. ///</summary>
  1372. ///
  1373. private void menuClosedCurve_Click(object sander, EventArgs e)
  1374. {
  1375. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1376. {
  1377. if (AppWorkspace.startScriptRecording)
  1378. {
  1379. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1380. }
  1381. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1382. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureClosedCurve;
  1383. }
  1384. this.SetCameraPreviewActiveTool(DrawToolType.MeasureClosedCurve);
  1385. }
  1386. ///<summary>
  1387. ///多边形
  1388. ///</summary>
  1389. ///
  1390. private void menuPolygon_Click(object sander, EventArgs e)
  1391. {
  1392. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1393. {
  1394. if (AppWorkspace.startScriptRecording)
  1395. {
  1396. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1397. }
  1398. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1399. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePolygon;
  1400. }
  1401. this.SetCameraPreviewActiveTool(DrawToolType.MeasurePolygon);
  1402. }
  1403. ///<summary>
  1404. ///矩形
  1405. ///</summary>
  1406. ///
  1407. private void menuRectangle_Click(object sander, EventArgs e)
  1408. {
  1409. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1410. {
  1411. if (AppWorkspace.startScriptRecording)
  1412. {
  1413. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1414. }
  1415. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1416. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureRectangle;
  1417. }
  1418. this.SetCameraPreviewActiveTool(DrawToolType.MeasureRectangle);
  1419. }
  1420. /// <summary>
  1421. /// 任意矩形
  1422. /// </summary>
  1423. /// <param name="sander"></param>
  1424. /// <param name="e"></param>
  1425. private void menuArbitraryRectangle_Click(object sander, EventArgs e)
  1426. {
  1427. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1428. {
  1429. if (AppWorkspace.startScriptRecording)
  1430. {
  1431. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1432. }
  1433. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1434. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureRandRectangle;
  1435. }
  1436. this.SetCameraPreviewActiveTool(DrawToolType.MeasureRandRectangle);
  1437. }
  1438. /// <summary>
  1439. /// 任意正方形
  1440. /// </summary>
  1441. /// <param name="sander"></param>
  1442. /// <param name="e"></param>
  1443. private void menuArbitrarySquare_Click(object sander, EventArgs e)
  1444. {
  1445. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1446. {
  1447. if (AppWorkspace.startScriptRecording)
  1448. {
  1449. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1450. }
  1451. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1452. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureRandSquare;
  1453. }
  1454. this.SetCameraPreviewActiveTool(DrawToolType.MeasureRandSquare);
  1455. }
  1456. ///<summary>
  1457. ///正方形
  1458. ///</summary>
  1459. ///
  1460. private void menuSquare_Click(object sander, EventArgs e)
  1461. {
  1462. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1463. {
  1464. if (AppWorkspace.startScriptRecording)
  1465. {
  1466. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1467. }
  1468. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1469. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureSquare;
  1470. }
  1471. this.SetCameraPreviewActiveTool(DrawToolType.MeasureSquare);
  1472. }
  1473. ///<summary>
  1474. ///轨迹多边形
  1475. ///</summary>
  1476. ///
  1477. private void menuTrackPolygon_Click(object sander, EventArgs e)
  1478. {
  1479. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1480. {
  1481. if (AppWorkspace.startScriptRecording)
  1482. {
  1483. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1484. }
  1485. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1486. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureTracePolygon;
  1487. }
  1488. this.SetCameraPreviewActiveTool(DrawToolType.MeasureTracePolygon);
  1489. }
  1490. ///<summary>
  1491. ///多点直线
  1492. ///</summary>
  1493. ///
  1494. private void menuMultipointStraightLine_Click(object sander, EventArgs e)
  1495. {
  1496. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1497. {
  1498. if (AppWorkspace.startScriptRecording)
  1499. {
  1500. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1501. }
  1502. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1503. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulLine;
  1504. }
  1505. this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulLine);
  1506. }
  1507. ///<summary>
  1508. ///多点线段
  1509. ///</summary>
  1510. ///
  1511. private void menuMultipointLineSegment1_Click(object sander, EventArgs e)
  1512. {
  1513. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1514. {
  1515. if (AppWorkspace.startScriptRecording)
  1516. {
  1517. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1518. }
  1519. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1520. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulSegment;
  1521. }
  1522. this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulSegment);
  1523. }
  1524. ///<summary>
  1525. ///多点水平线
  1526. ///</summary>
  1527. ///
  1528. private void menuMultipointHorizontalLine_Click(object sander, EventArgs e)
  1529. {
  1530. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1531. {
  1532. if (AppWorkspace.startScriptRecording)
  1533. {
  1534. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1535. }
  1536. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1537. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulHVLine;
  1538. }
  1539. this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulHVLine);
  1540. }
  1541. ///<summary>
  1542. ///多点垂直线
  1543. ///</summary>
  1544. ///
  1545. private void menuMultipointVerticalLine_Click(object sander, EventArgs e)
  1546. {
  1547. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1548. {
  1549. if (AppWorkspace.startScriptRecording)
  1550. {
  1551. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
  1552. }
  1553. AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1554. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulVLine;
  1555. }
  1556. this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulVLine);
  1557. }
  1558. /// <summary>
  1559. /// 标尺标定
  1560. /// </summary>
  1561. /// <param name="sender"></param>
  1562. /// <param name="e"></param>
  1563. private void MenuRulerCalibration_Click(object sender, EventArgs e)
  1564. {
  1565. AppWorkspace.Widgets.RuleListForm.Visible = !AppWorkspace.Widgets.RuleListForm.Visible;
  1566. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1567. {
  1568. if (AppWorkspace.startScriptRecording)
  1569. {
  1570. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1571. }
  1572. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.RuleListForm.Visible, "RulerCalibration");
  1573. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.RuleListForm.Visible, "RulerCalibration");
  1574. this.menuRulerCalibration.Checked = AppWorkspace.Widgets.RuleListForm.Visible;
  1575. AppWorkspace.ActiveDocumentWorkspace.Focus();
  1576. //AppWorkspace.Widgets.RuleListForm.MenuSubApplyCurrent();
  1577. }
  1578. }
  1579. /// <summary>
  1580. /// 应用当前
  1581. /// </summary>
  1582. /// <param name="sender"></param>
  1583. /// <param name="e"></param>
  1584. private void MenuSubApplyCurrent_Click(object sender, EventArgs e)
  1585. {
  1586. if (AppWorkspace.startScriptRecording)
  1587. {
  1588. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1589. }
  1590. AppWorkspace.Widgets.RuleListForm.MenuSubApplyCurrent();
  1591. }
  1592. /// <summary>
  1593. /// 应用全部
  1594. /// </summary>
  1595. /// <param name="sender"></param>
  1596. /// <param name="e"></param>
  1597. private void MenuSubApplyAll_Click(object sender, EventArgs e)
  1598. {
  1599. if (AppWorkspace.startScriptRecording)
  1600. {
  1601. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1602. }
  1603. AppWorkspace.Widgets.RuleListForm.MenuSubApplyAll();
  1604. }
  1605. /// <summary>
  1606. /// 测量列表
  1607. /// </summary>
  1608. /// <param name="sender"></param>
  1609. /// <param name="e"></param>
  1610. private void MenuMeasureList_Click(object sender, EventArgs e)
  1611. {
  1612. AppWorkspace.Widgets.MeasureListDialog.Visible = !AppWorkspace.Widgets.MeasureListDialog.Visible;
  1613. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1614. {
  1615. if (AppWorkspace.startScriptRecording)
  1616. {
  1617. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1618. }
  1619. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.MeasureListDialog.Visible, "MeasureList");
  1620. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.MeasureListDialog.Visible, "MeasureList");
  1621. this.menuMeasureList.Checked = AppWorkspace.Widgets.MeasureListDialog.Visible;
  1622. AppWorkspace.ActiveDocumentWorkspace.Focus();
  1623. }
  1624. }
  1625. /// <summary>
  1626. /// 光密度
  1627. /// </summary>
  1628. /// <param name="sender"></param>
  1629. /// <param name="e"></param>
  1630. private void MenuOpticalDensity_Click(object sender, EventArgs e)
  1631. {
  1632. AppWorkspace.Widgets.OpticalDensityDialog.Visible = !AppWorkspace.Widgets.OpticalDensityDialog.Visible;
  1633. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1634. {
  1635. if (AppWorkspace.startScriptRecording)
  1636. {
  1637. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1638. }
  1639. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.OpticalDensityDialog.Visible, "OpticalDensity");
  1640. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.OpticalDensityDialog.Visible, "OpticalDensity");
  1641. this.menuOpticalDensity.Checked = AppWorkspace.Widgets.OpticalDensityDialog.Visible;
  1642. bool canDram = true;
  1643. int count = this.AppWorkspace.ActiveDocumentWorkspace.GraphicsList.Count;
  1644. for (int i = 0; i < count; i++)
  1645. {
  1646. if (this.AppWorkspace.ActiveDocumentWorkspace.GraphicsList[i].objectType == DrawClass.Other
  1647. && this.AppWorkspace.ActiveDocumentWorkspace.GraphicsList[i].drawToolType == DrawToolType.OpticalDensityLine)
  1648. {
  1649. canDram = false;
  1650. this.AppWorkspace.ActiveDocumentWorkspace.GraphicsList[i].Selected = true;
  1651. }
  1652. }
  1653. if(canDram)
  1654. AppWorkspace.ActiveDocumentWorkspace.activeTool = DrawToolType.OpticalDensityLine;
  1655. AppWorkspace.ActiveDocumentWorkspace.Focus();
  1656. }
  1657. }
  1658. /// <summary>
  1659. /// 位图分析
  1660. /// </summary>
  1661. /// <param name="sender"></param>
  1662. /// <param name="e"></param>"
  1663. private void BitmapAnalysis_Click(object sender, EventArgs e)
  1664. {
  1665. if (AppWorkspace.ActiveDocumentWorkspace != null)
  1666. {
  1667. using (BitmapAnalysisDialog dialog = new BitmapAnalysisDialog(this.AppWorkspace))
  1668. {
  1669. if (AppWorkspace.startScriptRecording)
  1670. {
  1671. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1672. }
  1673. dialog.StartPosition = FormStartPosition.CenterParent;
  1674. dialog.ShowDialog();
  1675. }
  1676. }
  1677. else
  1678. {
  1679. MessageBox.Show(PdnResources.GetString("Menu.Pleaseopenatleastonepicturefirst.Text"));
  1680. }
  1681. }
  1682. /// <summary>
  1683. /// 理论比例尺
  1684. /// </summary>
  1685. /// <param name="sender"></param>
  1686. /// <param name="e"></param>
  1687. private void TheoreticalScale_Click(object sender, EventArgs e)
  1688. {
  1689. using (TheoreticalScaleDialog dialog = new TheoreticalScaleDialog(this.AppWorkspace,ArrayList1, ArrayList2, ArrayList3))
  1690. {
  1691. if (AppWorkspace.startScriptRecording)
  1692. {
  1693. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  1694. }
  1695. dialog.StartPosition = FormStartPosition.CenterParent;
  1696. dialog.ShowDialog();
  1697. }
  1698. }
  1699. private void SetCameraPreviewActiveTool(DrawToolType drawToolType)
  1700. {
  1701. if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
  1702. {
  1703. AppWorkspace.cameraPreviewDialog.documentWorkspace.ActiveTool = drawToolType;
  1704. }
  1705. }
  1706. private string GetCultureInfoName(CultureInfo ci)
  1707. {
  1708. CultureInfo en_US = new CultureInfo("en-US");
  1709. if (ci.Equals(en_US))
  1710. {
  1711. return GetCultureInfoName(ci.Parent);
  1712. }
  1713. else
  1714. {
  1715. return ci.NativeName;
  1716. }
  1717. }
  1718. }
  1719. }