MeasureSettingDialog.cs 139 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331
  1. using PaintDotNet.Annotation.Enum;
  2. using PaintDotNet.Annotation.relationModel;
  3. using PaintDotNet.Base.SettingModel;
  4. using PaintDotNet.Base.CommTool;
  5. using System;
  6. using System.Collections;
  7. using System.Collections.Generic;
  8. using System.Drawing;
  9. using System.IO;
  10. using System.Windows.Forms;
  11. using PaintDotNet.Annotation;
  12. using PaintDotNet.Base;
  13. namespace PaintDotNet.Setting
  14. {
  15. internal class MeasureSettingDialog : PdnBaseForm
  16. {
  17. /// <summary>
  18. /// 测量一二级关系
  19. /// </summary>
  20. private static List<MeasureRelationModel> list;
  21. /// <summary>
  22. /// 当前选中的二级标注
  23. /// </summary>
  24. private DrawToolType drawToolType;
  25. /// <summary>
  26. /// 测量的样式
  27. /// </summary>
  28. private MeasureStyleModel measureStyleModel = Startup.instance.measureStyleModel;
  29. /// <summary>
  30. /// 主配置文件的model
  31. /// </summary>
  32. private ConfigModel configModel = Startup.instance.configModel;
  33. /// <summary>
  34. /// 操作区控件
  35. /// </summary>
  36. private GroupBox groupBox1;
  37. private Label label1;
  38. private ComboBox comboBox1;
  39. private Button button4;
  40. private Button button3;
  41. private Button button2;
  42. private Panel panel1;
  43. private ListBox listBox1;
  44. private GroupBox groupBox3;
  45. private GroupBox groupBox2;
  46. private GroupBox groupBox4;
  47. private ConfigModel config = Startup.instance.configModel;
  48. /// <summary>
  49. /// 设置区控件
  50. /// </summary>
  51. private System.Windows.Forms.Label label11;
  52. private System.Windows.Forms.ComboBox comboBox11;
  53. private System.Windows.Forms.Label label21;
  54. private System.Windows.Forms.Label label31;
  55. private System.Windows.Forms.Panel textPanel;
  56. private System.Windows.Forms.Panel linePanel;
  57. private System.Windows.Forms.Label label41;
  58. private System.Windows.Forms.Label label51;
  59. private System.Windows.Forms.Label label61;
  60. private System.Windows.Forms.Label label71;
  61. /// <summary>
  62. /// 测量样式
  63. /// </summary>
  64. private NumericUpDown numericUpDown21;
  65. private ComboBox comboBox21;
  66. private NumericUpDown numericUpDown11;
  67. private NumericUpDown numericUpDown71;
  68. private Button button5;
  69. /// <summary>
  70. /// 字体列表
  71. /// </summary>
  72. ArrayList fontsItems = new ArrayList();
  73. /// <summary>
  74. /// 另存为弹出框显示
  75. /// </summary>
  76. private CreateNameDialog dialog;
  77. /// <summary>
  78. /// 操作样式下拉数据
  79. /// </summary>
  80. private List<string> files = new List<string>();
  81. /// <summary>
  82. /// 另存为文件名
  83. /// </summary>
  84. private string newName;
  85. /// <summary>
  86. /// 选中的测量类型
  87. /// </summary>
  88. private int selectId;
  89. PaintDotNet.ColorsForm colorsForm;
  90. PaintDotNet.ColorsForm colorsForm1;
  91. private Panel panel2;
  92. private ComboBox comboBox2;
  93. private Label label2;
  94. private Panel panel3;
  95. private ComboBox comboBox4;
  96. private Label label4;
  97. private ComboBox comboBox3;
  98. private ComboBox comboBox91;
  99. private Label label3;
  100. private Button button6;
  101. private NumericUpDown numericUpDown1;
  102. private Label label5;
  103. private ComboBox comboBox5;
  104. private Label label6;
  105. private int initflag = 0;
  106. private AppWorkspace appWorkspace;
  107. private System.Windows.Forms.Label label91;
  108. public MeasureSettingDialog(AppWorkspace appWorkspace)
  109. {
  110. if (list == null)
  111. {
  112. list = InvariantData.GetMeasureRelations();
  113. }
  114. this.appWorkspace = appWorkspace;
  115. InitializeComponent();
  116. InitializeLanguageText();
  117. InitializeComponent2();
  118. //绑定线样式数据
  119. this.comboBox21.Items.AddRange(InvariantData.dashStyles);
  120. InitializeData();
  121. }
  122. private void InitializeLanguageText()
  123. {
  124. this.label1.Text = PdnResources.GetString("Menu.Currentoperationstyle.text") + ":";
  125. this.button4.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
  126. this.button3.Text = PdnResources.GetString("Menu.File.SaveAs.Text");
  127. this.button2.Text = PdnResources.GetString("Menu.File.Save.Text");
  128. this.groupBox2.Text = PdnResources.GetString("Menu.Setting.Text");
  129. this.groupBox4.Text = PdnResources.GetString("Menu.Setting.Text");
  130. this.comboBox3.Items.AddRange(new object[] {
  131. PdnResources.GetString("Menu.Upperleft.text"),
  132. PdnResources.GetString("Menu.Uppermiddle.Text"),
  133. PdnResources.GetString("Menu.Upperright.text"),
  134. PdnResources.GetString("Menu.Lowerleft.text"),
  135. PdnResources.GetString("Menu.Themiddleandlower.Text"),
  136. PdnResources.GetString("Menu.Lowerright.text")});
  137. this.comboBox91.Items.AddRange(new object[] {
  138. "度",
  139. "密位"});
  140. this.comboBox4.Items.AddRange(new object[] {
  141. PdnResources.GetString("Menu.Upperleft.text"),
  142. PdnResources.GetString("Menu.Uppermiddle.Text"),
  143. PdnResources.GetString("Menu.Upperright.text"),
  144. PdnResources.GetString("Menu.Lowerleft.text"),
  145. PdnResources.GetString("Menu.Themiddleandlower.Text"),
  146. PdnResources.GetString("Menu.Lowerright.text")});
  147. this.label4.Text = PdnResources.GetString("Menu.Set.Rulersettings.Textposition.text") + "(" + PdnResources.GetString("Menu.Generalanalysis.Integrator.point.text") + "):";
  148. this.label3.Text = PdnResources.GetString("Menu.Textpositionli.Text") + ":";
  149. this.label2.Text = PdnResources.GetString("Menu.Set.Rulersettings.Textposition.text") + ":";
  150. this.label61.Text = PdnResources.GetString("Menu.Linestyle.Text") + ":";
  151. this.label51.Text = PdnResources.GetString("Menu.Set.Rulersettings.Linewidth.text") + ":";
  152. this.label41.Text = PdnResources.GetString("Menu.Set.Rulersettings.Linecolor.text") + ":";
  153. this.label31.Text = PdnResources.GetString("Menu.Textcolor.text") + ":";
  154. this.label21.Text = PdnResources.GetString("Menu.Set.Rulersettings.Fontsize.text") + ":";
  155. this.label11.Text = PdnResources.GetString("Menu.Textfont.text") + ":";
  156. this.button6.Text = PdnResources.GetString("Menu.File.SaveAll.Text");
  157. this.groupBox3.Text = PdnResources.GetString("Menu.Type.text");
  158. this.Text = PdnResources.GetString("Menu.Setting.MeasureSetting.Text");
  159. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  160. }
  161. private void InitializeComponent() {
  162. this.groupBox1 = new System.Windows.Forms.GroupBox();
  163. this.label1 = new System.Windows.Forms.Label();
  164. this.comboBox1 = new System.Windows.Forms.ComboBox();
  165. this.button4 = new System.Windows.Forms.Button();
  166. this.button3 = new System.Windows.Forms.Button();
  167. this.button2 = new System.Windows.Forms.Button();
  168. this.panel1 = new System.Windows.Forms.Panel();
  169. this.groupBox2 = new System.Windows.Forms.GroupBox();
  170. this.comboBox5 = new System.Windows.Forms.ComboBox();
  171. this.label6 = new System.Windows.Forms.Label();
  172. this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
  173. this.label5 = new System.Windows.Forms.Label();
  174. this.panel3 = new System.Windows.Forms.Panel();
  175. this.comboBox4 = new System.Windows.Forms.ComboBox();
  176. this.label4 = new System.Windows.Forms.Label();
  177. this.comboBox3 = new System.Windows.Forms.ComboBox();
  178. this.comboBox91 = new System.Windows.Forms.ComboBox();
  179. this.label3 = new System.Windows.Forms.Label();
  180. this.label91 = new System.Windows.Forms.Label();
  181. this.panel2 = new System.Windows.Forms.Panel();
  182. this.comboBox2 = new System.Windows.Forms.ComboBox();
  183. this.label2 = new System.Windows.Forms.Label();
  184. this.numericUpDown11 = new System.Windows.Forms.NumericUpDown();
  185. this.comboBox21 = new System.Windows.Forms.ComboBox();
  186. this.numericUpDown21 = new System.Windows.Forms.NumericUpDown();
  187. this.label61 = new System.Windows.Forms.Label();
  188. this.label51 = new System.Windows.Forms.Label();
  189. this.linePanel = new System.Windows.Forms.Panel();
  190. this.label41 = new System.Windows.Forms.Label();
  191. this.textPanel = new System.Windows.Forms.Panel();
  192. this.label31 = new System.Windows.Forms.Label();
  193. this.label21 = new System.Windows.Forms.Label();
  194. this.comboBox11 = new System.Windows.Forms.ComboBox();
  195. this.label11 = new System.Windows.Forms.Label();
  196. this.groupBox4 = new System.Windows.Forms.GroupBox();
  197. this.label71 = new System.Windows.Forms.Label();
  198. this.numericUpDown71 = new System.Windows.Forms.NumericUpDown();
  199. this.button6 = new System.Windows.Forms.Button();
  200. this.listBox1 = new System.Windows.Forms.ListBox();
  201. this.groupBox3 = new System.Windows.Forms.GroupBox();
  202. this.button5 = new System.Windows.Forms.Button();
  203. this.groupBox1.SuspendLayout();
  204. this.groupBox2.SuspendLayout();
  205. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
  206. this.panel3.SuspendLayout();
  207. this.panel2.SuspendLayout();
  208. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown11)).BeginInit();
  209. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown21)).BeginInit();
  210. this.groupBox4.SuspendLayout();
  211. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown71)).BeginInit();
  212. this.groupBox3.SuspendLayout();
  213. this.SuspendLayout();
  214. //
  215. // groupBox1
  216. //
  217. this.groupBox1.Controls.Add(this.label1);
  218. this.groupBox1.Controls.Add(this.comboBox1);
  219. this.groupBox1.Controls.Add(this.button4);
  220. this.groupBox1.Controls.Add(this.button3);
  221. this.groupBox1.Controls.Add(this.button2);
  222. this.groupBox1.Location = new System.Drawing.Point(137, 12);
  223. this.groupBox1.Name = "groupBox1";
  224. this.groupBox1.Size = new System.Drawing.Size(716, 58);
  225. this.groupBox1.TabIndex = 3;
  226. this.groupBox1.TabStop = false;
  227. this.groupBox1.Text = "操作";
  228. //
  229. // label1
  230. //
  231. this.label1.AutoSize = true;
  232. this.label1.Location = new System.Drawing.Point(172, 25);
  233. this.label1.Name = "label1";
  234. this.label1.Size = new System.Drawing.Size(0, 12);
  235. this.label1.TabIndex = 5;
  236. //
  237. // comboBox1
  238. //
  239. this.comboBox1.FormattingEnabled = true;
  240. this.comboBox1.Location = new System.Drawing.Point(351, 21);
  241. this.comboBox1.Name = "comboBox1";
  242. this.comboBox1.Size = new System.Drawing.Size(116, 20);
  243. this.comboBox1.TabIndex = 4;
  244. this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
  245. //
  246. // button4
  247. //
  248. this.button4.Location = new System.Drawing.Point(473, 20);
  249. this.button4.Name = "button4";
  250. this.button4.Size = new System.Drawing.Size(75, 23);
  251. this.button4.TabIndex = 3;
  252. this.button4.Text = "删除";
  253. this.button4.UseVisualStyleBackColor = true;
  254. this.button4.Click += new System.EventHandler(this.Button4_Click);
  255. //
  256. // button3
  257. //
  258. this.button3.Location = new System.Drawing.Point(554, 20);
  259. this.button3.Name = "button3";
  260. this.button3.Size = new System.Drawing.Size(75, 23);
  261. this.button3.TabIndex = 2;
  262. this.button3.Text = "另存为";
  263. this.button3.UseVisualStyleBackColor = true;
  264. this.button3.Click += new System.EventHandler(this.Button3_Click);
  265. //
  266. // button2
  267. //
  268. this.button2.Location = new System.Drawing.Point(635, 20);
  269. this.button2.Name = "button2";
  270. this.button2.Size = new System.Drawing.Size(75, 23);
  271. this.button2.TabIndex = 1;
  272. this.button2.Text = "保存";
  273. this.button2.UseVisualStyleBackColor = true;
  274. this.button2.Click += new System.EventHandler(this.Button2_Click);
  275. //
  276. // panel1
  277. //
  278. this.panel1.Location = new System.Drawing.Point(137, 76);
  279. this.panel1.Name = "panel1";
  280. this.panel1.Size = new System.Drawing.Size(633, 36);
  281. this.panel1.TabIndex = 8;
  282. //
  283. // groupBox2
  284. //
  285. this.groupBox2.Controls.Add(this.comboBox5);
  286. this.groupBox2.Controls.Add(this.label6);
  287. this.groupBox2.Controls.Add(this.numericUpDown1);
  288. this.groupBox2.Controls.Add(this.label5);
  289. this.groupBox2.Controls.Add(this.panel3);
  290. this.groupBox2.Controls.Add(this.panel2);
  291. this.groupBox2.Controls.Add(this.numericUpDown11);
  292. this.groupBox2.Controls.Add(this.comboBox21);
  293. this.groupBox2.Controls.Add(this.numericUpDown21);
  294. this.groupBox2.Controls.Add(this.label61);
  295. this.groupBox2.Controls.Add(this.label51);
  296. this.groupBox2.Controls.Add(this.linePanel);
  297. this.groupBox2.Controls.Add(this.label41);
  298. this.groupBox2.Controls.Add(this.textPanel);
  299. this.groupBox2.Controls.Add(this.label31);
  300. this.groupBox2.Controls.Add(this.label91);
  301. this.groupBox2.Controls.Add(this.comboBox91);
  302. this.groupBox2.Controls.Add(this.label21);
  303. this.groupBox2.Controls.Add(this.comboBox11);
  304. this.groupBox2.Controls.Add(this.label11);
  305. this.groupBox2.Location = new System.Drawing.Point(137, 118);
  306. this.groupBox2.Name = "groupBox2";
  307. this.groupBox2.Size = new System.Drawing.Size(716, 235);
  308. this.groupBox2.TabIndex = 6;
  309. this.groupBox2.TabStop = false;
  310. this.groupBox2.Text = "设置";
  311. //
  312. // comboBox5
  313. //
  314. this.comboBox5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  315. this.comboBox5.FormattingEnabled = true;
  316. this.comboBox5.Items.AddRange(new object[] {
  317. "随线",
  318. "水平"});
  319. this.comboBox5.Location = new System.Drawing.Point(342, 46);
  320. this.comboBox5.Name = "comboBox5";
  321. this.comboBox5.Size = new System.Drawing.Size(122, 20);
  322. this.comboBox5.TabIndex = 20;
  323. //
  324. // label6
  325. //
  326. this.label6.AutoSize = true;
  327. this.label6.Location = new System.Drawing.Point(265, 50);
  328. this.label6.Name = "label6";
  329. this.label6.Size = new System.Drawing.Size(65, 12);
  330. this.label6.TabIndex = 19;
  331. this.label6.Text = "文字方向:";
  332. //
  333. // numericUpDown1
  334. //
  335. this.numericUpDown1.Location = new System.Drawing.Point(342, 19);
  336. this.numericUpDown1.Name = "numericUpDown1";
  337. this.numericUpDown1.Size = new System.Drawing.Size(152, 21);
  338. this.numericUpDown1.TabIndex = 18;
  339. //
  340. // label5
  341. //
  342. this.label5.AutoSize = true;
  343. this.label5.Location = new System.Drawing.Point(265, 23);
  344. this.label5.Name = "label5";
  345. this.label5.Size = new System.Drawing.Size(65, 12);
  346. this.label5.TabIndex = 17;
  347. this.label5.Text = "垂线长度:";
  348. //
  349. // panel3
  350. //
  351. this.panel3.Controls.Add(this.comboBox4);
  352. this.panel3.Controls.Add(this.label4);
  353. this.panel3.Controls.Add(this.comboBox3);
  354. this.panel3.Controls.Add(this.label3);
  355. this.panel3.Location = new System.Drawing.Point(9, 175);
  356. this.panel3.Name = "panel3";
  357. this.panel3.Size = new System.Drawing.Size(236, 57);
  358. this.panel3.TabIndex = 16;
  359. //
  360. // comboBox4
  361. //
  362. this.comboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  363. this.comboBox4.FormattingEnabled = true;
  364. this.comboBox4.Location = new System.Drawing.Point(112, 30);
  365. this.comboBox4.Name = "comboBox4";
  366. this.comboBox4.Size = new System.Drawing.Size(122, 20);
  367. this.comboBox4.TabIndex = 17;
  368. //
  369. // label4
  370. //
  371. this.label4.AutoSize = true;
  372. this.label4.Location = new System.Drawing.Point(5, 34);
  373. this.label4.Name = "label4";
  374. this.label4.Size = new System.Drawing.Size(89, 12);
  375. this.label4.TabIndex = 16;
  376. this.label4.Text = "文字位置(点):";
  377. //
  378. // comboBox3
  379. //
  380. this.comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  381. this.comboBox3.FormattingEnabled = true;
  382. this.comboBox3.Location = new System.Drawing.Point(112, 4);
  383. this.comboBox3.Name = "comboBox3";
  384. this.comboBox3.Size = new System.Drawing.Size(122, 20);
  385. this.comboBox3.TabIndex = 15;
  386. //
  387. // comboBox91
  388. //
  389. this.comboBox91.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  390. this.comboBox91.FormattingEnabled = true;
  391. this.comboBox91.Location = new System.Drawing.Point(91, 179);
  392. this.comboBox91.Name = "comboBox91";
  393. this.comboBox91.Size = new System.Drawing.Size(152, 20);
  394. this.comboBox91.TabIndex = 15;
  395. //
  396. // label3
  397. //
  398. this.label3.AutoSize = true;
  399. this.label3.Location = new System.Drawing.Point(5, 7);
  400. this.label3.Name = "label3";
  401. this.label3.Size = new System.Drawing.Size(89, 12);
  402. this.label3.TabIndex = 14;
  403. this.label3.Text = "文字位置(线):";
  404. //
  405. // labe91
  406. //
  407. this.label91.AutoSize = true;
  408. this.label91.Location = new System.Drawing.Point(14, 182);
  409. this.label91.Name = "labe91";
  410. this.label91.Size = new System.Drawing.Size(89, 12);
  411. this.label91.TabIndex = 14;
  412. this.label91.Text = "角度单位:";
  413. //
  414. // panel2
  415. //
  416. this.panel2.Controls.Add(this.comboBox2);
  417. this.panel2.Controls.Add(this.label2);
  418. this.panel2.Location = new System.Drawing.Point(9, 175);
  419. this.panel2.Name = "panel2";
  420. this.panel2.Size = new System.Drawing.Size(236, 57);
  421. this.panel2.TabIndex = 15;
  422. //
  423. // comboBox2
  424. //
  425. this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  426. this.comboBox2.FormattingEnabled = true;
  427. this.comboBox2.Location = new System.Drawing.Point(82, 3);
  428. this.comboBox2.Name = "comboBox2";
  429. this.comboBox2.Size = new System.Drawing.Size(152, 20);
  430. this.comboBox2.TabIndex = 15;
  431. //
  432. // label2
  433. //
  434. this.label2.AutoSize = true;
  435. this.label2.Location = new System.Drawing.Point(5, 7);
  436. this.label2.Name = "label2";
  437. this.label2.Size = new System.Drawing.Size(0, 12);
  438. this.label2.TabIndex = 14;
  439. //
  440. // numericUpDown11
  441. //
  442. this.numericUpDown11.Location = new System.Drawing.Point(91, 125);
  443. this.numericUpDown11.Name = "numericUpDown11";
  444. this.numericUpDown11.Size = new System.Drawing.Size(152, 21);
  445. this.numericUpDown11.TabIndex = 14;
  446. //
  447. // comboBox21
  448. //
  449. this.comboBox21.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  450. this.comboBox21.FormattingEnabled = true;
  451. this.comboBox21.Location = new System.Drawing.Point(91, 151);
  452. this.comboBox21.Name = "comboBox21";
  453. this.comboBox21.Size = new System.Drawing.Size(152, 20);
  454. this.comboBox21.TabIndex = 13;
  455. //
  456. // numericUpDown21
  457. //
  458. this.numericUpDown21.Location = new System.Drawing.Point(91, 46);
  459. this.numericUpDown21.Name = "numericUpDown21";
  460. this.numericUpDown21.Size = new System.Drawing.Size(152, 21);
  461. this.numericUpDown21.TabIndex = 12;
  462. //
  463. // label61
  464. //
  465. this.label61.AutoSize = true;
  466. this.label61.Location = new System.Drawing.Point(13, 155);
  467. this.label61.Name = "label61";
  468. this.label61.Size = new System.Drawing.Size(65, 12);
  469. this.label61.TabIndex = 9;
  470. this.label61.Text = "线条样式:";
  471. //
  472. // label51
  473. //
  474. this.label51.AutoSize = true;
  475. this.label51.Location = new System.Drawing.Point(13, 128);
  476. this.label51.Name = "label51";
  477. this.label51.Size = new System.Drawing.Size(65, 12);
  478. this.label51.TabIndex = 8;
  479. this.label51.Text = "线条宽度:";
  480. //
  481. // linePanel
  482. //
  483. this.linePanel.BackColor = System.Drawing.SystemColors.Window;
  484. this.linePanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  485. this.linePanel.Location = new System.Drawing.Point(91, 99);
  486. this.linePanel.Name = "linePanel";
  487. this.linePanel.Size = new System.Drawing.Size(152, 20);
  488. this.linePanel.TabIndex = 7;
  489. this.linePanel.Click += new System.EventHandler(this.lineColorPanel_Click);
  490. //
  491. // label41
  492. //
  493. this.label41.AutoSize = true;
  494. this.label41.Location = new System.Drawing.Point(13, 99);
  495. this.label41.Name = "label41";
  496. this.label41.Size = new System.Drawing.Size(65, 12);
  497. this.label41.TabIndex = 6;
  498. this.label41.Text = "线条颜色:";
  499. //
  500. // textPanel
  501. //
  502. this.textPanel.BackColor = System.Drawing.SystemColors.Window;
  503. this.textPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  504. this.textPanel.Location = new System.Drawing.Point(91, 73);
  505. this.textPanel.Name = "textPanel";
  506. this.textPanel.Size = new System.Drawing.Size(152, 20);
  507. this.textPanel.TabIndex = 5;
  508. this.textPanel.Click += new System.EventHandler(this.textColorPanel_Click);
  509. //
  510. // label31
  511. //
  512. this.label31.AutoSize = true;
  513. this.label31.Location = new System.Drawing.Point(13, 76);
  514. this.label31.Name = "label31";
  515. this.label31.Size = new System.Drawing.Size(65, 12);
  516. this.label31.TabIndex = 4;
  517. this.label31.Text = "文字颜色:";
  518. //
  519. // label21
  520. //
  521. this.label21.AutoSize = true;
  522. this.label21.Location = new System.Drawing.Point(13, 50);
  523. this.label21.Name = "label21";
  524. this.label21.Size = new System.Drawing.Size(65, 12);
  525. this.label21.TabIndex = 2;
  526. this.label21.Text = "文字字号:";
  527. //
  528. // comboBox11
  529. //
  530. this.comboBox11.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  531. this.comboBox11.FormattingEnabled = true;
  532. this.comboBox11.Location = new System.Drawing.Point(91, 20);
  533. this.comboBox11.Name = "comboBox11";
  534. this.comboBox11.Size = new System.Drawing.Size(152, 20);
  535. this.comboBox11.TabIndex = 1;
  536. //
  537. // label11
  538. //
  539. this.label11.AutoSize = true;
  540. this.label11.Location = new System.Drawing.Point(13, 23);
  541. this.label11.Name = "label11";
  542. this.label11.Size = new System.Drawing.Size(65, 12);
  543. this.label11.TabIndex = 0;
  544. this.label11.Text = "文字字体:";
  545. //
  546. // groupBox4
  547. //
  548. this.groupBox4.Controls.Add(this.label71);
  549. this.groupBox4.Controls.Add(this.numericUpDown71);
  550. this.groupBox4.Location = new System.Drawing.Point(137, 76);
  551. this.groupBox4.Name = "groupBox4";
  552. this.groupBox4.Size = new System.Drawing.Size(716, 277);
  553. this.groupBox4.TabIndex = 6;
  554. this.groupBox4.TabStop = false;
  555. this.groupBox4.Text = "设置";
  556. this.groupBox4.Visible = false;
  557. //
  558. // label71
  559. //
  560. this.label71.AutoSize = true;
  561. this.label71.Location = new System.Drawing.Point(13, 23);
  562. this.label71.Name = "label71";
  563. this.label71.Size = new System.Drawing.Size(77, 12);
  564. this.label71.TabIndex = 0;
  565. this.label71.Text = "标记点大小:";
  566. //
  567. // numericUpDown71
  568. //
  569. this.numericUpDown71.Location = new System.Drawing.Point(91, 23);
  570. this.numericUpDown71.Maximum = new decimal(new int[] {
  571. 100000,
  572. 0,
  573. 0,
  574. 0});
  575. this.numericUpDown71.Name = "numericUpDown71";
  576. this.numericUpDown71.Size = new System.Drawing.Size(152, 21);
  577. this.numericUpDown71.TabIndex = 14;
  578. //
  579. // button6
  580. //
  581. this.button6.Location = new System.Drawing.Point(778, 76);
  582. this.button6.Name = "button6";
  583. this.button6.Size = new System.Drawing.Size(75, 23);
  584. this.button6.TabIndex = 17;
  585. this.button6.Text = "保存全部";
  586. this.button6.UseVisualStyleBackColor = true;
  587. this.button6.Click += new System.EventHandler(this.button6_Click);
  588. //
  589. // listBox1
  590. //
  591. this.listBox1.FormattingEnabled = true;
  592. this.listBox1.ItemHeight = 12;
  593. this.listBox1.Location = new System.Drawing.Point(6, 20);
  594. this.listBox1.Name = "listBox1";
  595. this.listBox1.Size = new System.Drawing.Size(103, 316);
  596. this.listBox1.TabIndex = 0;
  597. this.listBox1.SelectedValueChanged += new System.EventHandler(this.listBox1_SelectedValueChanged);
  598. //
  599. // groupBox3
  600. //
  601. this.groupBox3.Controls.Add(this.listBox1);
  602. this.groupBox3.Location = new System.Drawing.Point(12, 12);
  603. this.groupBox3.Name = "groupBox3";
  604. this.groupBox3.Size = new System.Drawing.Size(115, 341);
  605. this.groupBox3.TabIndex = 9;
  606. this.groupBox3.TabStop = false;
  607. this.groupBox3.Text = "类型";
  608. //
  609. // button5
  610. //
  611. this.button5.Location = new System.Drawing.Point(0, 0);
  612. this.button5.Name = "button5";
  613. this.button5.Size = new System.Drawing.Size(75, 23);
  614. this.button5.TabIndex = 0;
  615. //
  616. // MeasureSettingDialog
  617. //
  618. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  619. this.ClientSize = new System.Drawing.Size(865, 358);
  620. this.Controls.Add(this.button6);
  621. this.Controls.Add(this.groupBox3);
  622. this.Controls.Add(this.panel1);
  623. this.Controls.Add(this.groupBox4);
  624. this.Controls.Add(this.groupBox2);
  625. this.Controls.Add(this.groupBox1);
  626. this.Name = "MeasureSettingDialog";
  627. this.Text = "测量设置";
  628. this.Controls.SetChildIndex(this.groupBox1, 0);
  629. this.Controls.SetChildIndex(this.groupBox2, 0);
  630. this.Controls.SetChildIndex(this.groupBox4, 0);
  631. this.Controls.SetChildIndex(this.panel1, 0);
  632. this.Controls.SetChildIndex(this.groupBox3, 0);
  633. this.Controls.SetChildIndex(this.button6, 0);
  634. this.groupBox1.ResumeLayout(false);
  635. this.groupBox1.PerformLayout();
  636. this.groupBox2.ResumeLayout(false);
  637. this.groupBox2.PerformLayout();
  638. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
  639. this.panel3.ResumeLayout(false);
  640. this.panel3.PerformLayout();
  641. this.panel2.ResumeLayout(false);
  642. this.panel2.PerformLayout();
  643. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown11)).EndInit();
  644. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown21)).EndInit();
  645. this.groupBox4.ResumeLayout(false);
  646. this.groupBox4.PerformLayout();
  647. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown71)).EndInit();
  648. this.groupBox3.ResumeLayout(false);
  649. this.ResumeLayout(false);
  650. }
  651. #region InitializeComponent2
  652. /// <summary>
  653. /// 初始化组件
  654. /// </summary>
  655. private void InitializeComponent2()
  656. {
  657. this.colorsForm = new ColorsForm();
  658. this.colorsForm.StartPosition = FormStartPosition.CenterScreen;
  659. this.colorsForm.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  660. this.colorsForm1 = new ColorsForm();
  661. this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
  662. this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  663. }
  664. #endregion
  665. /// <summary>
  666. /// 初始化数据
  667. /// </summary>
  668. private void InitializeData()
  669. {
  670. this.listBox1.Items.Clear();
  671. //绑定左侧listbox数据
  672. foreach (MeasureRelationModel model in list)
  673. {
  674. if(model.id>0)
  675. this.listBox1.Items.Add(model.name);
  676. }
  677. this.listBox1.SelectedIndex = 0;
  678. this.fontsItems.Clear();
  679. //绑定字体数据
  680. System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
  681. foreach (FontFamily fontFamily in fonts.Families)
  682. {
  683. fontsItems.Add(fontFamily.Name);
  684. }
  685. this.comboBox11.DataSource = fontsItems;
  686. //绑定样式默认数据
  687. this.comboBox11.Text = this.measureStyleModel.measureLine.font;
  688. this.numericUpDown21.Value = this.measureStyleModel.measureLine.fontSize;
  689. this.textPanel.BackColor = Color.FromArgb(this.measureStyleModel.measureLine.textColor);
  690. this.linePanel.BackColor = Color.FromArgb(this.measureStyleModel.measureLine.lineColor);
  691. this.numericUpDown11.Value = this.measureStyleModel.measureLine.lineWidth;
  692. this.comboBox21.SelectedIndex = this.measureStyleModel.measureLine.lineStyle;
  693. this.comboBox2.SelectedIndex = this.measureStyleModel.measureLine.linePosition;
  694. this.numericUpDown1.Value = this.measureStyleModel.measureLine.vLineLength;
  695. this.numericUpDown71.Value = this.config.MarkpointWidth;
  696. //绑定样式下拉 todo
  697. if (initflag++ == 0) {
  698. InitializeStyleName();
  699. }
  700. }
  701. /// <summary>
  702. /// 左侧listbox选择事件
  703. /// </summary>
  704. /// <param name="sender"></param>
  705. /// <param name="e"></param>
  706. private void listBox1_SelectedValueChanged(object sender, EventArgs e)
  707. {
  708. //首先更新右侧分类部分
  709. UpdateRightCatalog();
  710. //更新右侧设置界面
  711. UpdateRightSettingUI();
  712. //刷新右侧预览
  713. UpdateRightPreview();
  714. }
  715. /// <summary>
  716. /// 更新右侧分类
  717. /// </summary>
  718. private void UpdateRightCatalog()
  719. {
  720. this.panel1.Controls.Clear();
  721. MeasureRelationModel model = list[this.listBox1.SelectedIndex + 1];
  722. this.selectId = model.id;
  723. if (this.selectId == 10)
  724. {
  725. groupBox2.Visible = false;
  726. groupBox4.Visible = true;
  727. panel1.Visible = false;
  728. button6.Visible = false;
  729. comboBox1.Visible = false;
  730. button4.Visible = false;
  731. button3.Visible = false;
  732. label1.Visible = false;
  733. }
  734. else {
  735. groupBox2.Visible = true;
  736. groupBox4.Visible = false;
  737. panel1.Visible = true;
  738. button6.Visible = true;
  739. comboBox1.Visible = true;
  740. button4.Visible = true;
  741. button3.Visible = true;
  742. label1.Visible = true;
  743. }
  744. int postion = 0;
  745. foreach (MeasureRelationModel.ChildLabel child in model.childLabel)
  746. {
  747. if((int)child.drawToolType > 0)
  748. {
  749. Button button = new Button();
  750. button.Size = new Size(75, 23);
  751. button.Location = new Point(postion * 75 + 5, 0);
  752. button.Text = child.name;
  753. button.Tag = child;
  754. button.Click += new EventHandler(ChildButton_Click);
  755. this.panel1.Controls.Add(button);
  756. if (postion == 0)
  757. {
  758. this.drawToolType = child.drawToolType;
  759. button.Focus();
  760. }
  761. postion++;
  762. }
  763. }
  764. }
  765. /// <summary>
  766. /// 二级分类按钮点击事件
  767. /// </summary>
  768. /// <param name="sender"></param>
  769. /// <param name="e"></param>
  770. private void ChildButton_Click(object sender, EventArgs e)
  771. {
  772. Button button = (Button)sender;
  773. MeasureRelationModel.ChildLabel child = (MeasureRelationModel.ChildLabel)button.Tag;
  774. this.drawToolType = child.drawToolType;
  775. this.UpdateRightSettingUI();
  776. }
  777. # region 更新右侧设置
  778. /// <summary>
  779. /// 更新右侧设置
  780. /// </summary>
  781. private void UpdateRightSettingUI()
  782. {
  783. switch (this.drawToolType)
  784. {
  785. case DrawToolType.MeasureLine: //长度测量直线
  786. MeasureStyleModel.MeasureLine measureLine = this.measureStyleModel.measureLine;
  787. this.panel2.Visible = true;
  788. this.panel3.Visible = false;
  789. this.label5.Visible = true;
  790. this.label6.Visible = true;
  791. this.comboBox5.Visible = true;
  792. this.numericUpDown1.Visible = true;
  793. this.label91.Visible = false;
  794. this.comboBox91.Visible = false;
  795. UpdataFontPosition(false);
  796. this.UpdateMeasureStyleData(measureLine.font, measureLine.fontSize, measureLine.textColor, measureLine.lineColor, measureLine.lineWidth, measureLine.lineStyle, measureLine.linePosition, 0, 0, measureLine.vLineLength,measureLine.followLine);
  797. break;
  798. case DrawToolType.MeasureDistanceLine: //长度测量距离
  799. MeasureStyleModel.MeasureDistanceLine measureDistanceLine = this.measureStyleModel.measureDistanceLine;
  800. this.panel2.Visible = true;
  801. this.panel3.Visible = false;
  802. this.label5.Visible = false;
  803. this.numericUpDown1.Visible = false;
  804. this.label6.Visible = false;
  805. this.comboBox5.Visible = false;
  806. this.label91.Visible = false;
  807. this.comboBox91.Visible = false;
  808. UpdataFontPosition(false);
  809. this.UpdateMeasureStyleData(measureDistanceLine.font, measureDistanceLine.fontSize, measureDistanceLine.textColor, measureDistanceLine.lineColor, measureDistanceLine.lineWidth, measureDistanceLine.lineStyle, measureDistanceLine.linePosition, 0, 0, -1);
  810. break;
  811. case DrawToolType.MeasureLength: //长度测量->长度
  812. MeasureStyleModel.MeasureLength measureLength = this.measureStyleModel.measureLength;
  813. this.panel2.Visible = true;
  814. this.panel3.Visible = false;
  815. this.label5.Visible = false;
  816. this.numericUpDown1.Visible = false;
  817. this.label6.Visible = false;
  818. this.comboBox5.Visible = false;
  819. this.label91.Visible = false;
  820. this.comboBox91.Visible = false;
  821. UpdataFontPosition(false);
  822. this.UpdateMeasureStyleData(measureLength.font, measureLength.fontSize, measureLength.textColor, measureLength.lineColor, measureLength.lineWidth, measureLength.lineStyle, measureLength.linePosition, 0, 0, -1);
  823. break;
  824. case DrawToolType.MeasureHLine: //长度测量->水平线
  825. MeasureStyleModel.MeasureHLine measureHLine = this.measureStyleModel.measureHLine;
  826. this.panel2.Visible = true;
  827. this.panel3.Visible = false;
  828. this.label5.Visible = true;
  829. this.numericUpDown1.Visible = true;
  830. this.label6.Visible = false;
  831. this.comboBox5.Visible = false;
  832. this.label91.Visible = false;
  833. this.comboBox91.Visible = false;
  834. UpdataFontPosition(false);
  835. this.UpdateMeasureStyleData(measureHLine.font, measureHLine.fontSize, measureHLine.textColor, measureHLine.lineColor, measureHLine.lineWidth, measureHLine.lineStyle, measureHLine.linePosition, 0, 0, measureHLine.vLineLength);
  836. break;
  837. case DrawToolType.MeasureVLine: //长度测量->垂线
  838. MeasureStyleModel.MeasureVLine measureVLine = this.measureStyleModel.measureVLine;
  839. this.panel2.Visible = true;
  840. this.panel3.Visible = false;
  841. this.label5.Visible = true;
  842. this.numericUpDown1.Visible = true;
  843. this.label6.Visible = true;
  844. this.comboBox5.Visible = true;
  845. this.label91.Visible = false;
  846. this.comboBox91.Visible = false;
  847. UpdataFontPosition(false);
  848. this.UpdateMeasureStyleData(measureVLine.font, measureVLine.fontSize, measureVLine.textColor, measureVLine.lineColor, measureVLine.lineWidth, measureVLine.lineStyle, measureVLine.linePosition, 0, 0, measureVLine.vLineLength, measureVLine.followLine);
  849. break;
  850. case DrawToolType.MeasureMulLine: //多点线段->多点直线
  851. MeasureStyleModel.MeasureMulLine measureMulLine = this.measureStyleModel.measureMulLine;
  852. this.panel3.Visible = true;
  853. this.panel2.Visible = false;
  854. this.label5.Visible = true;
  855. this.numericUpDown1.Visible = true;
  856. this.label6.Visible = false;
  857. this.comboBox5.Visible = false;
  858. this.label91.Visible = false;
  859. this.comboBox91.Visible = false;
  860. this.UpdateMeasureStyleData(measureMulLine.font, measureMulLine.fontSize, measureMulLine.textColor, measureMulLine.lineColor, measureMulLine.lineWidth, measureMulLine.lineStyle, 0, measureMulLine.linePositionL, measureMulLine.linePositionP, measureMulLine.vLineLength);
  861. break;
  862. case DrawToolType.MeasureMulHVLine: //多点线段->多点水平线
  863. MeasureStyleModel.MeasureMulHVLine measureMulHVLine = this.measureStyleModel.measureMulHVLine;
  864. this.panel3.Visible = true;
  865. this.panel2.Visible = false;
  866. this.label5.Visible = true;
  867. this.numericUpDown1.Visible = true;
  868. this.label6.Visible = false;
  869. this.comboBox5.Visible = false;
  870. this.label91.Visible = false;
  871. this.comboBox91.Visible = false;
  872. this.UpdateMeasureStyleData(measureMulHVLine.font, measureMulHVLine.fontSize, measureMulHVLine.textColor, measureMulHVLine.lineColor, measureMulHVLine.lineWidth, measureMulHVLine.lineStyle, 0, measureMulHVLine.linePositionL, measureMulHVLine.linePositionP, measureMulHVLine.vLineLength);
  873. break;
  874. case DrawToolType.MeasureMulSegment: //多点线段->多点线段
  875. MeasureStyleModel.MeasureMulSegment measureMulSegment = this.measureStyleModel.measureMulSegment;
  876. this.panel3.Visible = true;
  877. this.panel2.Visible = false;
  878. this.label5.Visible = true;
  879. this.numericUpDown1.Visible = true;
  880. this.label6.Visible = false;
  881. this.comboBox5.Visible = false;
  882. this.label91.Visible = false;
  883. this.comboBox91.Visible = false;
  884. this.UpdateMeasureStyleData(measureMulSegment.font, measureMulSegment.fontSize, measureMulSegment.textColor, measureMulSegment.lineColor, measureMulSegment.lineWidth, measureMulSegment.lineStyle, 0, measureMulSegment.linePositionL, measureMulSegment.linePositionP, measureMulSegment.vLineLength);
  885. break;
  886. case DrawToolType.MeasureMulVLine: //多点线段->多点垂直线
  887. MeasureStyleModel.MeasureMulVLine measureMulVLine = this.measureStyleModel.measureMulVLine;
  888. this.panel3.Visible = true;
  889. this.panel2.Visible = false;
  890. this.label5.Visible = true;
  891. this.numericUpDown1.Visible = true;
  892. this.label6.Visible = true;
  893. this.comboBox5.Visible = true;
  894. this.label91.Visible = false;
  895. this.comboBox91.Visible = false;
  896. this.UpdateMeasureStyleData(measureMulVLine.font, measureMulVLine.fontSize, measureMulVLine.textColor, measureMulVLine.lineColor, measureMulVLine.lineWidth, measureMulVLine.lineStyle, 0, measureMulVLine.linePositionL, measureMulVLine.linePositionP, measureMulVLine.vLineLength, measureMulVLine.followLine);
  897. break;
  898. case DrawToolType.MeasureBrokenLine: //曲线长度->折线
  899. MeasureStyleModel.MeasureBrokenLine measureBrokenLine = this.measureStyleModel.measureBrokenLine;
  900. this.panel2.Visible = true;
  901. this.panel3.Visible = false;
  902. this.label5.Visible = false;
  903. this.numericUpDown1.Visible = false;
  904. this.label6.Visible = false;
  905. this.comboBox5.Visible = false;
  906. this.label91.Visible = false;
  907. this.comboBox91.Visible = false;
  908. UpdataFontPosition(true);
  909. this.UpdateMeasureStyleData(measureBrokenLine.font, measureBrokenLine.fontSize, measureBrokenLine.textColor, measureBrokenLine.lineColor, measureBrokenLine.lineWidth, measureBrokenLine.lineStyle, measureBrokenLine.linePosition, 0, 0, -1);
  910. break;
  911. case DrawToolType.MeasureTraceCurve: //曲线长度->轨迹曲线
  912. MeasureStyleModel.MeasureTraceCurve measureTraceCurve = this.measureStyleModel.measureTraceCurve;
  913. this.panel2.Visible = true;
  914. this.panel3.Visible = false;
  915. this.label5.Visible = false;
  916. this.numericUpDown1.Visible = false;
  917. this.label6.Visible = false;
  918. this.comboBox5.Visible = false;
  919. this.label91.Visible = false;
  920. this.comboBox91.Visible = false;
  921. UpdataFontPosition(true);
  922. this.UpdateMeasureStyleData(measureTraceCurve.font, measureTraceCurve.fontSize, measureTraceCurve.textColor, measureTraceCurve.lineColor, measureTraceCurve.lineWidth, measureTraceCurve.lineStyle, measureTraceCurve.linePosition, 0, 0, -1);
  923. break;
  924. case DrawToolType.MeasureCurveLine: //曲线长度->曲线
  925. MeasureStyleModel.MeasureCurveLine measureCurveLine = this.measureStyleModel.measureCurveLine;
  926. this.panel2.Visible = true;
  927. this.panel3.Visible = false;
  928. this.label5.Visible = false;
  929. this.numericUpDown1.Visible = false;
  930. this.label6.Visible = false;
  931. this.comboBox5.Visible = false;
  932. this.label91.Visible = false;
  933. this.comboBox91.Visible = false;
  934. UpdataFontPosition(true);
  935. this.UpdateMeasureStyleData(measureCurveLine.font, measureCurveLine.fontSize, measureCurveLine.textColor, measureCurveLine.lineColor, measureCurveLine.lineWidth, measureCurveLine.lineStyle, measureCurveLine.linePosition, 0, 0, -1);
  936. break;
  937. case DrawToolType.MeasurePLine: //点垂线->点垂线
  938. MeasureStyleModel.MeasurePLine measurePLine = this.measureStyleModel.measurePLine;
  939. this.panel3.Visible = true;
  940. this.panel2.Visible = false;
  941. this.label5.Visible = false;
  942. this.numericUpDown1.Visible = false;
  943. this.label6.Visible = false;
  944. this.comboBox5.Visible = false;
  945. this.label91.Visible = false;
  946. this.comboBox91.Visible = false;
  947. this.UpdateMeasureStyleData(measurePLine.font, measurePLine.fontSize, measurePLine.textColor, measurePLine.lineColor, measurePLine.lineWidth, measurePLine.lineStyle, 0, measurePLine.linePositionL, measurePLine.linePositionP, -1);
  948. break;
  949. case DrawToolType.MeasureMulPLine: //点垂线->多点垂线
  950. MeasureStyleModel.MeasureMulPLine measureMulPLine = this.measureStyleModel.measureMulPLine;
  951. this.panel3.Visible = true;
  952. this.panel2.Visible = false;
  953. this.label5.Visible = false;
  954. this.numericUpDown1.Visible = false;
  955. this.label6.Visible = false;
  956. this.comboBox5.Visible = false;
  957. this.label91.Visible = false;
  958. this.comboBox91.Visible = false;
  959. this.UpdateMeasureStyleData(measureMulPLine.font, measureMulPLine.fontSize, measureMulPLine.textColor, measureMulPLine.lineColor, measureMulPLine.lineWidth, measureMulPLine.lineStyle, 0, measureMulPLine.linePositionL, measureMulPLine.linePositionP, -1);
  960. break;
  961. case DrawToolType.MeasureHMulPLine: //点垂线->水平多点垂线
  962. MeasureStyleModel.MeasureHMulPLine measureHMulPLine = this.measureStyleModel.measureHMulPLine;
  963. this.panel3.Visible = true;
  964. this.panel2.Visible = false;
  965. this.label5.Visible = false;
  966. this.numericUpDown1.Visible = false;
  967. this.label6.Visible = false;
  968. this.comboBox5.Visible = false;
  969. this.label91.Visible = false;
  970. this.comboBox91.Visible = false;
  971. this.UpdateMeasureStyleData(measureHMulPLine.font, measureHMulPLine.fontSize, measureHMulPLine.textColor, measureHMulPLine.lineColor, measureHMulPLine.lineWidth, measureHMulPLine.lineStyle, 0, measureHMulPLine.linePositionL, measureHMulPLine.linePositionP, -1);
  972. break;
  973. case DrawToolType.MeasureVMulPLine: //点垂线->垂直多点垂线
  974. MeasureStyleModel.MeasureVMulPLine measureVMulPLine = this.measureStyleModel.measureVMulPLine;
  975. this.panel3.Visible = true;
  976. this.panel2.Visible = false;
  977. this.label5.Visible = false;
  978. this.numericUpDown1.Visible = false;
  979. this.label6.Visible = false;
  980. this.comboBox5.Visible = false;
  981. this.label91.Visible = false;
  982. this.comboBox91.Visible = false;
  983. this.UpdateMeasureStyleData(measureVMulPLine.font, measureVMulPLine.fontSize, measureVMulPLine.textColor, measureVMulPLine.lineColor, measureVMulPLine.lineWidth, measureVMulPLine.lineStyle, 0, measureVMulPLine.linePositionL, measureVMulPLine.linePositionP, -1);
  984. break;
  985. case DrawToolType.MeasurePointHLine: //点垂线->点到水平线距离
  986. MeasureStyleModel.MeasurePointHLine measurePointHLine = this.measureStyleModel.measurePointHLine;
  987. this.panel3.Visible = true;
  988. this.panel2.Visible = false;
  989. this.label5.Visible = false;
  990. this.numericUpDown1.Visible = false;
  991. this.label6.Visible = false;
  992. this.comboBox5.Visible = false;
  993. this.label91.Visible = false;
  994. this.comboBox91.Visible = false;
  995. this.UpdateMeasureStyleData(measurePointHLine.font, measurePointHLine.fontSize, measurePointHLine.textColor, measurePointHLine.lineColor, measurePointHLine.lineWidth, measurePointHLine.lineStyle, 0, measurePointHLine.linePositionL, measurePointHLine.linePositionP, -1);
  996. break;
  997. case DrawToolType.MeasureParallelLine: //平行线测量->平行线
  998. MeasureStyleModel.MeasureParallelLine measureParallelLine = this.measureStyleModel.measureParallelLine;
  999. this.panel3.Visible = true;
  1000. this.panel2.Visible = false;
  1001. this.label5.Visible = false;
  1002. this.numericUpDown1.Visible = false;
  1003. this.label6.Visible = true;
  1004. this.comboBox5.Visible = true;
  1005. this.label91.Visible = false;
  1006. this.comboBox91.Visible = false;
  1007. this.UpdateMeasureStyleData(measureParallelLine.font, measureParallelLine.fontSize, measureParallelLine.textColor, measureParallelLine.lineColor, measureParallelLine.lineWidth, measureParallelLine.lineStyle, 0, measureParallelLine.linePositionL, measureParallelLine.linePositionP, -1, measureParallelLine.followLine);
  1008. break;
  1009. case DrawToolType.MeasureMulParallelLine: //平行线测量->多点平行线
  1010. MeasureStyleModel.MeasureMulParallelLine measureMulParallelLine = this.measureStyleModel.measureMulParallelLine;
  1011. this.panel3.Visible = true;
  1012. this.panel2.Visible = false;
  1013. this.label5.Visible = false;
  1014. this.numericUpDown1.Visible = false;
  1015. this.label6.Visible = false;
  1016. this.comboBox5.Visible = false;
  1017. this.label91.Visible = false;
  1018. this.comboBox91.Visible = false;
  1019. this.UpdateMeasureStyleData(measureMulParallelLine.font, measureMulParallelLine.fontSize, measureMulParallelLine.textColor, measureMulParallelLine.lineColor, measureMulParallelLine.lineWidth, measureMulParallelLine.lineStyle, 0, measureMulParallelLine.linePositionL, measureMulParallelLine.linePositionP, -1);
  1020. break;
  1021. case DrawToolType.MeasureVMulParallelLine: //平行线测量->垂直多点平行线
  1022. MeasureStyleModel.MeasureVMulParallelLine measureVMulParallelLine = this.measureStyleModel.measureVMulParallelLine;
  1023. this.panel3.Visible = true;
  1024. this.panel2.Visible = false;
  1025. this.label5.Visible = false;
  1026. this.numericUpDown1.Visible = false;
  1027. this.label6.Visible = false;
  1028. this.comboBox5.Visible = false;
  1029. this.label91.Visible = false;
  1030. this.comboBox91.Visible = false;
  1031. this.UpdateMeasureStyleData(measureVMulParallelLine.font, measureVMulParallelLine.fontSize, measureVMulParallelLine.textColor, measureVMulParallelLine.lineColor, measureVMulParallelLine.lineWidth, measureVMulParallelLine.lineStyle, 0, measureVMulParallelLine.linePositionL, measureVMulParallelLine.linePositionP, -1);
  1032. break;
  1033. case DrawToolType.MeasureHMulParallelLine: //平行线测量->水平多点平行线
  1034. MeasureStyleModel.MeasureHMulParallelLine measureHMulParallelLine = this.measureStyleModel.measureHMulParallelLine;
  1035. this.panel3.Visible = true;
  1036. this.panel2.Visible = false;
  1037. this.label5.Visible = false;
  1038. this.numericUpDown1.Visible = false;
  1039. this.label6.Visible = false;
  1040. this.comboBox5.Visible = false;
  1041. this.label91.Visible = false;
  1042. this.comboBox91.Visible = false;
  1043. this.UpdateMeasureStyleData(measureHMulParallelLine.font, measureHMulParallelLine.fontSize, measureHMulParallelLine.textColor, measureHMulParallelLine.lineColor, measureHMulParallelLine.lineWidth, measureHMulParallelLine.lineStyle, 0, measureHMulParallelLine.linePositionL, measureHMulParallelLine.linePositionP, -1);
  1044. break;
  1045. case DrawToolType.MeasureClosedCurve: //多边形测量->闭合曲线
  1046. MeasureStyleModel.MeasureClosedCurve measureClosedCurve = this.measureStyleModel.measureClosedCurve;
  1047. this.panel3.Visible = false;
  1048. this.panel2.Visible = false;
  1049. this.label5.Visible = false;
  1050. this.numericUpDown1.Visible = false;
  1051. this.label6.Visible = false;
  1052. this.comboBox5.Visible = false;
  1053. this.label91.Visible = false;
  1054. this.comboBox91.Visible = false;
  1055. this.UpdateMeasureStyleData(measureClosedCurve.font, measureClosedCurve.fontSize, measureClosedCurve.textColor, measureClosedCurve.lineColor, measureClosedCurve.lineWidth, measureClosedCurve.lineStyle, 0, 0, 0, -1);
  1056. break;
  1057. case DrawToolType.MeasurePolygon: //多边形测量->多边形
  1058. MeasureStyleModel.MeasurePolygon measurePolygon = this.measureStyleModel.measurePolygon;
  1059. this.panel3.Visible = false;
  1060. this.panel2.Visible = false;
  1061. this.label5.Visible = false;
  1062. this.numericUpDown1.Visible = false;
  1063. this.label6.Visible = false;
  1064. this.comboBox5.Visible = false;
  1065. this.label91.Visible = false;
  1066. this.comboBox91.Visible = false;
  1067. this.UpdateMeasureStyleData(measurePolygon.font, measurePolygon.fontSize, measurePolygon.textColor, measurePolygon.lineColor, measurePolygon.lineWidth, measurePolygon.lineStyle, 0, 0, 0, -1);
  1068. break;
  1069. case DrawToolType.MeasureRectangle: //多边形测量->矩形
  1070. MeasureStyleModel.MeasureRectangle measureRectangle = this.measureStyleModel.measureRectangle;
  1071. this.panel3.Visible = false;
  1072. this.panel2.Visible = false;
  1073. this.label5.Visible = false;
  1074. this.numericUpDown1.Visible = false;
  1075. this.label6.Visible = false;
  1076. this.comboBox5.Visible = false;
  1077. this.label91.Visible = false;
  1078. this.comboBox91.Visible = false;
  1079. this.UpdateMeasureStyleData(measureRectangle.font, measureRectangle.fontSize, measureRectangle.textColor, measureRectangle.lineColor, measureRectangle.lineWidth, measureRectangle.lineStyle, 0, 0, 0, -1);
  1080. break;
  1081. case DrawToolType.MeasureRandRectangle: //多边形测量->任意矩形
  1082. MeasureStyleModel.MeasureRandRectangle measureRandRectangle = this.measureStyleModel.measureRandRectangle;
  1083. this.panel3.Visible = false;
  1084. this.panel2.Visible = false;
  1085. this.label5.Visible = false;
  1086. this.numericUpDown1.Visible = false;
  1087. this.label6.Visible = false;
  1088. this.comboBox5.Visible = false;
  1089. this.label91.Visible = false;
  1090. this.comboBox91.Visible = false;
  1091. this.UpdateMeasureStyleData(measureRandRectangle.font, measureRandRectangle.fontSize, measureRandRectangle.textColor, measureRandRectangle.lineColor, measureRandRectangle.lineWidth, measureRandRectangle.lineStyle, 0, 0, 0, -1);
  1092. break;
  1093. case DrawToolType.MeasureSquare: //多边形测量->正方形
  1094. MeasureStyleModel.MeasureSquare measureSquare = this.measureStyleModel.measureSquare;
  1095. this.panel3.Visible = false;
  1096. this.panel2.Visible = false;
  1097. this.label5.Visible = false;
  1098. this.numericUpDown1.Visible = false;
  1099. this.label6.Visible = false;
  1100. this.comboBox5.Visible = false;
  1101. this.label91.Visible = false;
  1102. this.comboBox91.Visible = false;
  1103. this.UpdateMeasureStyleData(measureSquare.font, measureSquare.fontSize, measureSquare.textColor, measureSquare.lineColor, measureSquare.lineWidth, measureSquare.lineStyle, 0, 0, 0, -1);
  1104. break;
  1105. case DrawToolType.MeasureRandSquare: //多边形测量->任意正方形
  1106. MeasureStyleModel.MeasureRandSquare measureRandSquare = this.measureStyleModel.measureRandSquare;
  1107. this.panel3.Visible = false;
  1108. this.panel2.Visible = false;
  1109. this.label5.Visible = false;
  1110. this.numericUpDown1.Visible = false;
  1111. this.label6.Visible = false;
  1112. this.comboBox5.Visible = false;
  1113. this.label91.Visible = false;
  1114. this.comboBox91.Visible = false;
  1115. this.UpdateMeasureStyleData(measureRandSquare.font, measureRandSquare.fontSize, measureRandSquare.textColor, measureRandSquare.lineColor, measureRandSquare.lineWidth, measureRandSquare.lineStyle, 0, 0, 0, -1);
  1116. break;
  1117. case DrawToolType.MeasureTracePolygon: //多边形测量->轨迹多边形
  1118. MeasureStyleModel.MeasureTracePolygon measureTracePolygon = this.measureStyleModel.measureTracePolygon;
  1119. this.panel3.Visible = false;
  1120. this.panel2.Visible = false;
  1121. this.label5.Visible = false;
  1122. this.numericUpDown1.Visible = false;
  1123. this.label6.Visible = false;
  1124. this.comboBox5.Visible = false;
  1125. this.label91.Visible = false;
  1126. this.comboBox91.Visible = false;
  1127. this.UpdateMeasureStyleData(measureTracePolygon.font, measureTracePolygon.fontSize, measureTracePolygon.textColor, measureTracePolygon.lineColor, measureTracePolygon.lineWidth, measureTracePolygon.lineStyle, 0, 0, 0, -1);
  1128. break;
  1129. case DrawToolType.MeasureCircle: //圆形测量->三点圆
  1130. MeasureStyleModel.MeasureCircle measureCircle = this.measureStyleModel.measureCircle;
  1131. this.panel3.Visible = false;
  1132. this.panel2.Visible = false;
  1133. this.label5.Visible = false;
  1134. this.numericUpDown1.Visible = false;
  1135. this.label6.Visible = false;
  1136. this.comboBox5.Visible = false;
  1137. this.label91.Visible = false;
  1138. this.comboBox91.Visible = false;
  1139. this.UpdateMeasureStyleData(measureCircle.font, measureCircle.fontSize, measureCircle.textColor, measureCircle.lineColor, measureCircle.lineWidth, measureCircle.lineStyle, 0, 0, 0, -1);
  1140. break;
  1141. case DrawToolType.MeasureInnerCircle: //圆形测量->向内画圆
  1142. MeasureStyleModel.MeasureInnerCircle measureInnerCircle = this.measureStyleModel.measureInnerCircle;
  1143. this.panel3.Visible = false;
  1144. this.panel2.Visible = false;
  1145. this.label5.Visible = false;
  1146. this.numericUpDown1.Visible = false;
  1147. this.label6.Visible = false;
  1148. this.comboBox5.Visible = false;
  1149. this.label91.Visible = false;
  1150. this.comboBox91.Visible = false;
  1151. this.UpdateMeasureStyleData(measureInnerCircle.font, measureInnerCircle.fontSize, measureInnerCircle.textColor, measureInnerCircle.lineColor, measureInnerCircle.lineWidth, measureInnerCircle.lineStyle, 0, 0, 0, -1);
  1152. break;
  1153. case DrawToolType.MeasureOuterCircle: //圆形测量->向外画圆
  1154. MeasureStyleModel.MeasureOuterCircle measureOuterCircle = this.measureStyleModel.measureOuterCircle;
  1155. this.panel3.Visible = false;
  1156. this.panel2.Visible = false;
  1157. this.label5.Visible = false;
  1158. this.numericUpDown1.Visible = false;
  1159. this.label6.Visible = false;
  1160. this.comboBox5.Visible = false;
  1161. this.label91.Visible = false;
  1162. this.comboBox91.Visible = false;
  1163. this.UpdateMeasureStyleData(measureOuterCircle.font, measureOuterCircle.fontSize, measureOuterCircle.textColor, measureOuterCircle.lineColor, measureOuterCircle.lineWidth, measureOuterCircle.lineStyle, 0, 0, 0, -1);
  1164. break;
  1165. case DrawToolType.MeasureDiameterCircle: //圆形测量->直径画圆
  1166. MeasureStyleModel.MeasureDiameterCircle measureDiameterCircle = this.measureStyleModel.measureDiameterCircle;
  1167. this.panel3.Visible = false;
  1168. this.panel2.Visible = false;
  1169. this.label5.Visible = false;
  1170. this.numericUpDown1.Visible = false;
  1171. this.label6.Visible = false;
  1172. this.comboBox5.Visible = false;
  1173. this.label91.Visible = false;
  1174. this.comboBox91.Visible = false;
  1175. this.UpdateMeasureStyleData(measureDiameterCircle.font, measureDiameterCircle.fontSize, measureDiameterCircle.textColor, measureDiameterCircle.lineColor, measureDiameterCircle.lineWidth, measureDiameterCircle.lineStyle, 0, 0, 0, -1);
  1176. break;
  1177. case DrawToolType.MeasurePointEdgeSize: //圆形测量->点到圆距离
  1178. MeasureStyleModel.MeasurePointEdgeSize measurePointEdgeSize = this.measureStyleModel.measurePointEdgeSize;
  1179. this.panel3.Visible = false;
  1180. this.panel2.Visible = false;
  1181. this.label5.Visible = false;
  1182. this.numericUpDown1.Visible = false;
  1183. this.label6.Visible = false;
  1184. this.comboBox5.Visible = false;
  1185. this.label91.Visible = false;
  1186. this.comboBox91.Visible = false;
  1187. this.UpdateMeasureStyleData(measurePointEdgeSize.font, measurePointEdgeSize.fontSize, measurePointEdgeSize.textColor, measurePointEdgeSize.lineColor, measurePointEdgeSize.lineWidth, measurePointEdgeSize.lineStyle, 0, 0, 0, -1);
  1188. break;
  1189. case DrawToolType.MeasurePointCenterSize: //圆形测量->点到圆心距离
  1190. MeasureStyleModel.MeasurePointCenterSize measurePointCenterSize = this.measureStyleModel.measurePointCenterSize;
  1191. this.panel3.Visible = false;
  1192. this.panel2.Visible = false;
  1193. this.label5.Visible = false;
  1194. this.numericUpDown1.Visible = false;
  1195. this.label6.Visible = false;
  1196. this.comboBox5.Visible = false;
  1197. this.label91.Visible = false;
  1198. this.comboBox91.Visible = false;
  1199. this.UpdateMeasureStyleData(measurePointCenterSize.font, measurePointCenterSize.fontSize, measurePointCenterSize.textColor, measurePointCenterSize.lineColor, measurePointCenterSize.lineWidth, measurePointCenterSize.lineStyle, 0, 0, 0, -1);
  1200. break;
  1201. case DrawToolType.MeasurePointArcSize: //圆形测量->点到圆弧距离
  1202. MeasureStyleModel.MeasurePointArcSize measurePointArcSize = this.measureStyleModel.measurePointArcSize;
  1203. this.panel3.Visible = false;
  1204. this.panel2.Visible = false;
  1205. this.label5.Visible = false;
  1206. this.numericUpDown1.Visible = false;
  1207. this.label6.Visible = false;
  1208. this.comboBox5.Visible = false;
  1209. this.label91.Visible = false;
  1210. this.comboBox91.Visible = false;
  1211. this.UpdateMeasureStyleData(measurePointArcSize.font, measurePointArcSize.fontSize, measurePointArcSize.textColor, measurePointArcSize.lineColor, measurePointArcSize.lineWidth, measurePointArcSize.lineStyle, 0, 0, 0, -1);
  1212. break;
  1213. case DrawToolType.MeasureThreePointAngle: //角度测量->三点角度
  1214. MeasureStyleModel.MeasureThreePointAngle measureThreePointAngle = this.measureStyleModel.measureThreePointAngle;
  1215. this.panel3.Visible = false;
  1216. this.panel2.Visible = false;
  1217. this.label5.Visible = false;
  1218. this.numericUpDown1.Visible = false;
  1219. this.label6.Visible = false;
  1220. this.comboBox5.Visible = false;
  1221. this.label91.Visible = true;
  1222. this.comboBox91.Visible = true;
  1223. this.UpdateMeasureStyleData(measureThreePointAngle.font, measureThreePointAngle.fontSize, measureThreePointAngle.textColor, measureThreePointAngle.lineColor, measureThreePointAngle.lineWidth, measureThreePointAngle.lineStyle, 0, 0, 0, -1,false, measureThreePointAngle.isAngle);
  1224. break;
  1225. case DrawToolType.MeasureFourPointAngle: //角度测量->四点角度
  1226. MeasureStyleModel.MeasureFourPointAngle measureFourPointAngle = this.measureStyleModel.measureFourPointAngle;
  1227. this.panel3.Visible = false;
  1228. this.panel2.Visible = false;
  1229. this.label5.Visible = false;
  1230. this.numericUpDown1.Visible = false;
  1231. this.label6.Visible = false;
  1232. this.comboBox5.Visible = false;
  1233. this.label91.Visible = true;
  1234. this.comboBox91.Visible = true;
  1235. this.UpdateMeasureStyleData(measureFourPointAngle.font, measureFourPointAngle.fontSize, measureFourPointAngle.textColor, measureFourPointAngle.lineColor, measureFourPointAngle.lineWidth, measureFourPointAngle.lineStyle, 0, 0, 0, -1, false, measureFourPointAngle.isAngle);
  1236. break;
  1237. case DrawToolType.MeasureThreePointArc: //角度测量->三点弧
  1238. MeasureStyleModel.MeasureThreePointArc measureThreePointArc = this.measureStyleModel.measureThreePointArc;
  1239. this.panel3.Visible = false;
  1240. this.panel2.Visible = false;
  1241. this.label5.Visible = false;
  1242. this.numericUpDown1.Visible = false;
  1243. this.label6.Visible = false;
  1244. this.comboBox5.Visible = false;
  1245. this.label91.Visible = true;
  1246. this.comboBox91.Visible = true;
  1247. this.UpdateMeasureStyleData(measureThreePointArc.font, measureThreePointArc.fontSize, measureThreePointArc.textColor, measureThreePointArc.lineColor, measureThreePointArc.lineWidth, measureThreePointArc.lineStyle, 0, 0, 0, -1, false, measureThreePointArc.isAngle);
  1248. break;
  1249. case DrawToolType.MeasureCenterCenterSize: //对准度测量->圆心到圆心距离
  1250. MeasureStyleModel.MeasureCenterCenterSize measureCenterCenterSize = this.measureStyleModel.measureCenterCenterSize;
  1251. this.panel3.Visible = false;
  1252. this.panel2.Visible = true;
  1253. this.label5.Visible = false;
  1254. this.numericUpDown1.Visible = false;
  1255. this.label6.Visible = false;
  1256. this.comboBox5.Visible = false;
  1257. this.label91.Visible = false;
  1258. this.comboBox91.Visible = false;
  1259. UpdataFontPosition(false);
  1260. this.UpdateMeasureStyleData(measureCenterCenterSize.font, measureCenterCenterSize.fontSize, measureCenterCenterSize.textColor, measureCenterCenterSize.lineColor, measureCenterCenterSize.lineWidth, measureCenterCenterSize.lineStyle, measureCenterCenterSize.linePosition, 0, 0, -1);
  1261. break;
  1262. case DrawToolType.MeasureTwoLineVLDistance: //对准度测量->两线中垂线距离
  1263. MeasureStyleModel.MeasureTwoLineVLDistance measureTwoLineVLDistance = this.measureStyleModel.measureTwoLineVLDistance;
  1264. this.panel3.Visible = false;
  1265. this.panel2.Visible = true;
  1266. this.label5.Visible = false;
  1267. this.numericUpDown1.Visible = false;
  1268. this.label6.Visible = false;
  1269. this.comboBox5.Visible = false;
  1270. this.label91.Visible = false;
  1271. this.comboBox91.Visible = false;
  1272. UpdataFontPosition(false);
  1273. this.UpdateMeasureStyleData(measureTwoLineVLDistance.font, measureTwoLineVLDistance.fontSize, measureTwoLineVLDistance.textColor, measureTwoLineVLDistance.lineColor, measureTwoLineVLDistance.lineWidth, measureTwoLineVLDistance.lineStyle, measureTwoLineVLDistance.linePosition, 0, 0, -1);
  1274. break;
  1275. }
  1276. }
  1277. #endregion
  1278. private void UpdataFontPosition(bool curve)
  1279. {
  1280. List<string> position = new List<string> { PdnResources.GetString("Menu.Upperleft.text")
  1281. , PdnResources.GetString("Menu.Uppermiddle.Text")
  1282. , PdnResources.GetString("Menu.Upperright.text")
  1283. , PdnResources.GetString("Menu.Lowerleft.text")
  1284. , PdnResources.GetString("Menu.Themiddleandlower.Text")
  1285. , PdnResources.GetString("Menu.Lowerright.text")};
  1286. List<string> position1 = new List<string> { PdnResources.GetString("Menu.hestartingpoint.Text")
  1287. , PdnResources.GetString("Menu.Theendpoint.Text")
  1288. };
  1289. this.comboBox2.DataSource = null;
  1290. if (curve)
  1291. this.comboBox2.DataSource = position1;
  1292. else
  1293. this.comboBox2.DataSource = position;
  1294. }
  1295. /// <summary>
  1296. /// 刷新右侧预览图
  1297. /// </summary>
  1298. private void UpdateRightPreview()
  1299. {
  1300. }
  1301. /// <summary>
  1302. /// 更新显示区域控件的数值
  1303. /// </summary>
  1304. /// <param name="font"></param>
  1305. /// <param name="fontSize"></param>
  1306. /// <param name="textColor"></param>
  1307. /// <param name="lineColor"></param>
  1308. /// <param name="lineWidth"></param>
  1309. /// <param name="lineStyle"></param>
  1310. private void UpdateMeasureStyleData(string font,int fontSize,int textColor,int lineColor,int lineWidth,int lineStyle, int linePosition, int linePositionL, int linePositionP, int vLineLength,bool followLine = false,bool isAngle = false)
  1311. {
  1312. //绑定样式默认数据
  1313. this.comboBox11.Text = font;
  1314. this.numericUpDown21.Value = fontSize;
  1315. this.textPanel.BackColor = Color.FromArgb( textColor);
  1316. this.linePanel.BackColor = Color.FromArgb( lineColor);
  1317. this.numericUpDown11.Value = lineWidth;
  1318. this.comboBox21.SelectedIndex = lineStyle;
  1319. if(this.comboBox2.Items.Count > 0)
  1320. this.comboBox2.SelectedIndex = linePosition;
  1321. if (this.comboBox3.Items.Count > 0)
  1322. this.comboBox3.SelectedIndex = linePositionL;
  1323. if (this.comboBox4.Items.Count > 0)
  1324. this.comboBox4.SelectedIndex = linePositionP;
  1325. if(vLineLength > -1)
  1326. this.numericUpDown1.Value = vLineLength;
  1327. if (followLine)
  1328. {
  1329. this.comboBox5.SelectedIndex = 0;
  1330. }
  1331. else {
  1332. this.comboBox5.SelectedIndex = 1;
  1333. }
  1334. this.comboBox91.SelectedIndex = isAngle ? 1 : 0;
  1335. }
  1336. /// <summary>
  1337. /// 保存按钮
  1338. /// </summary>
  1339. /// <param name="sender"></param>
  1340. /// <param name="e"></param>
  1341. private void Button2_Click(object sender, EventArgs e)
  1342. {
  1343. //调用检查类型
  1344. this.checkSaveModel();
  1345. //以下保存xml文件信息
  1346. string stageModelXml = XmlSerializeHelper.XmlSerialize<MeasureStyleModel>(this.measureStyleModel);
  1347. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\" + this.comboBox1.Text + ".xml";
  1348. FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
  1349. this.config.MarkpointWidth = Convert.ToInt32(this.numericUpDown71.Value);
  1350. string configModelXml = XmlSerializeHelper.XmlSerialize<ConfigModel>(config);
  1351. FileOperationHelper.WriteStringToFile(configModelXml, Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Config.xml", FileMode.Create);
  1352. MarkPointRect.markPointRectWidth = configModel.MarkpointWidth;
  1353. if (this.appWorkspace.DocumentWorkspaces != null)
  1354. {
  1355. foreach (var item in this.appWorkspace.DocumentWorkspaces)
  1356. {
  1357. if (item != null && item.GraphicsList != null)
  1358. foreach (var graObject in item.GraphicsList.graphicsList)
  1359. {
  1360. graObject.smallRectangleWidth = this.config.MarkpointWidth;
  1361. }
  1362. item.Refresh();
  1363. }
  1364. }
  1365. ApplicationSetting();
  1366. }
  1367. /// <summary>
  1368. ///另存为按钮点击
  1369. /// </summary>
  1370. /// <param name="sender"></param>
  1371. /// <param name="e"></param>
  1372. private void Button3_Click(object sender, EventArgs e)
  1373. {
  1374. dialog = new CreateNameDialog(this);
  1375. dialog.Text = PdnResources.GetString("Menu.Set.Watermarksettings.Newstyle.text");
  1376. dialog.StartPosition = FormStartPosition.CenterParent;
  1377. dialog.ShowDialog();
  1378. }
  1379. /// <summary>
  1380. /// 当前操作样式
  1381. /// </summary>
  1382. /// <param name="sender"></param>
  1383. /// <param name="e"></param>
  1384. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  1385. {
  1386. measureStyleModel = XmlSerializeHelper.DESerializer<MeasureStyleModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\" + this.comboBox1.SelectedItem.ToString() + ".xml", FileMode.Open));
  1387. InitializeData();
  1388. }
  1389. /// <summary>
  1390. /// 绑定样式下拉
  1391. /// </summary>
  1392. private void InitializeStyleName()
  1393. {
  1394. List<string> fileNames = FileOperationHelper.GetFileList(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\");
  1395. files.Clear();
  1396. foreach (string fileName in fileNames)
  1397. {
  1398. string name = fileName.Substring(0, fileName.LastIndexOf("."));
  1399. files.Add(name);
  1400. }
  1401. this.comboBox1.SelectedIndexChanged -= this.comboBox1_SelectedIndexChanged;
  1402. this.comboBox1.DataSource = null;
  1403. this.comboBox1.DataSource = files;
  1404. string nowModelName = Startup.instance.configModel.Watermark.Substring(0, Startup.instance.configModel.Watermark.LastIndexOf("."));
  1405. this.comboBox1.SelectedIndex = files.FindIndex(a => a.Equals(nowModelName));
  1406. measureStyleModel = XmlSerializeHelper.DESerializer<MeasureStyleModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\" + this.comboBox1.SelectedItem.ToString() + ".xml", FileMode.Open));
  1407. // InitializeData();
  1408. this.comboBox1.SelectedIndexChanged += new EventHandler(this.comboBox1_SelectedIndexChanged);
  1409. }
  1410. /// <summary>
  1411. /// 删除按钮
  1412. /// </summary>
  1413. /// <param name="sender"></param>
  1414. /// <param name="e"></param>
  1415. private void Button4_Click(object sender, EventArgs e)
  1416. {
  1417. if ("Default".Equals(this.comboBox1.Text))
  1418. {
  1419. MessageBox.Show(PdnResources.GetString("Menu.efaultstylecannotbedelete.Text"), PdnResources.GetString("Menu.ensure.text"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1420. return;
  1421. }
  1422. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.nfirmthedeleti.Text"), PdnResources.GetString("Menu.ensure.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  1423. if (dr == DialogResult.OK)
  1424. {
  1425. int newIndex = 0;
  1426. int selectIndex = this.comboBox1.SelectedIndex;
  1427. int tall = files.Count - 1;
  1428. if (selectIndex < tall)
  1429. {
  1430. newIndex = selectIndex;
  1431. }
  1432. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\" + this.comboBox1.Text + ".xml";
  1433. FileInfo fileInfo = new FileInfo(filePath);
  1434. fileInfo.Delete();
  1435. InitializeStyleName();
  1436. this.comboBox1.SelectedIndex = newIndex;
  1437. measureStyleModel = XmlSerializeHelper.DESerializer<MeasureStyleModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\" + this.comboBox1.SelectedItem.ToString() + ".xml", FileMode.Open));
  1438. InitializeData();
  1439. }
  1440. else if (dr == DialogResult.Cancel)
  1441. {
  1442. }
  1443. }
  1444. /// <summary>
  1445. /// 弹出另存为框点击保存效果
  1446. /// </summary>
  1447. /// <param name="name"></param>
  1448. public override void GetCreateName(string name)
  1449. {
  1450. string currentcomboBox = this.comboBox1.Text;
  1451. this.newName = name;
  1452. if (files.Contains(this.newName))
  1453. {
  1454. MessageBox.Show(PdnResources.GetString("Menu.Stylenamecannotberepeated.text"), PdnResources.GetString("Menu.ensure.text"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1455. return;
  1456. }
  1457. CopyConfigAndRename();
  1458. InitializeStyleName();
  1459. this.comboBox1.Text = currentcomboBox;
  1460. dialog.Close();
  1461. }
  1462. /// <summary>
  1463. /// 另存配置文件
  1464. /// </summary>
  1465. private void CopyConfigAndRename()
  1466. {
  1467. /*if (this.checkBox1.Checked)
  1468. {
  1469. this.watermarkModel.bold = 1;
  1470. }
  1471. else
  1472. {
  1473. this.watermarkModel.bold = 2;
  1474. }
  1475. if (this.checkBox2.Checked)
  1476. {
  1477. this.watermarkModel.italic = 1;
  1478. }
  1479. else
  1480. {
  1481. this.watermarkModel.italic = 2;
  1482. }
  1483. this.watermarkModel.position = this.comboBox2.SelectedIndex + 1;
  1484. this.watermarkModel.typeface = this.comboBox3.Text;
  1485. this.watermarkModel.fontSize = Int32.Parse(this.comboBox4.Text);*/
  1486. //检查保存类型
  1487. this.checkSaveModel();
  1488. //另存为
  1489. string stageModelXml = XmlSerializeHelper.XmlSerialize<MeasureStyleModel>(this.measureStyleModel);
  1490. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\" + this.newName + ".xml";
  1491. FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
  1492. }
  1493. /// <summary>
  1494. /// 应用按钮
  1495. /// </summary>
  1496. /// <param name="sender"></param>
  1497. /// <param name="e"></param>
  1498. private void ApplicationSetting()
  1499. {
  1500. //修改缓存中的样式数据
  1501. Startup.instance.measureStyleModel = this.measureStyleModel;
  1502. //修改主配置文件中的值
  1503. configModel.MeasurementStyle = this.comboBox1.Text + ".xml";
  1504. //修改主配置文件的xml
  1505. string configModelXml = XmlSerializeHelper.XmlSerialize<ConfigModel>(this.configModel);
  1506. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Config.xml";
  1507. FileOperationHelper.WriteStringToFile(configModelXml, filePath, FileMode.Create);
  1508. MessageBox.Show(PdnResources.GetString("Menu.Successfullysaved.text"));
  1509. }
  1510. private void textColorPanel_Click(object sender, EventArgs e)
  1511. {
  1512. this.colorsForm.UserPrimaryColor = ColorBgra.FromColor(this.textPanel.BackColor);
  1513. this.colorsForm.setSaveBtn_Click(new System.EventHandler(this.textColorChanged));
  1514. this.colorsForm.ShowDialog();
  1515. }
  1516. private void textColorChanged(object sender, EventArgs e)
  1517. {
  1518. this.textPanel.BackColor = this.colorsForm.UserPrimaryColor.ToColor();
  1519. //this.measureStyleModel.backColor = this.colorsForm.UserPrimaryColor.ToColor().ToArgb();
  1520. this.colorsForm.Close();
  1521. }
  1522. private void lineColorPanel_Click(object sender, EventArgs e)
  1523. {
  1524. this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.linePanel.BackColor);
  1525. this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.lineColorChanged));
  1526. this.colorsForm1.ShowDialog();
  1527. }
  1528. private void lineColorChanged(object sender, EventArgs e)
  1529. {
  1530. this.linePanel.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
  1531. // this.measureStyleModel.backColor = this.colorsForm.UserPrimaryColor.ToColor().ToArgb();
  1532. this.colorsForm1.Close();
  1533. }
  1534. private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
  1535. {
  1536. }
  1537. /// <summary>
  1538. /// 检查保存类型
  1539. /// </summary>
  1540. private void checkSaveModel() {
  1541. string font = comboBox11.Text;
  1542. int fontSize = Convert.ToInt32(numericUpDown21.Value);
  1543. int textColor = Convert.ToInt32(this.textPanel.BackColor.ToArgb());
  1544. int lineColor = Convert.ToInt32(this.linePanel.BackColor.ToArgb());
  1545. int lineWidth = Convert.ToInt32(numericUpDown11.Value);
  1546. int lineStyle = this.comboBox21.SelectedIndex;
  1547. int linePosition = this.comboBox2.SelectedIndex;
  1548. int linePositionL = this.comboBox3.SelectedIndex;
  1549. int linePositionP = this.comboBox4.SelectedIndex;
  1550. int vLineLength = Convert.ToInt32(this.numericUpDown1.Value);
  1551. bool isAngle = comboBox91.SelectedIndex == 0 ? false : true;
  1552. switch (this.drawToolType)
  1553. {
  1554. case DrawToolType.MeasureLine: //长度测量直线
  1555. this.measureStyleModel.measureLine.font = font;
  1556. this.measureStyleModel.measureLine.fontSize = fontSize;
  1557. this.measureStyleModel.measureLine.textColor = textColor;
  1558. this.measureStyleModel.measureLine.lineColor = lineColor;
  1559. this.measureStyleModel.measureLine.lineWidth = lineWidth;
  1560. this.measureStyleModel.measureLine.lineStyle = lineStyle;
  1561. this.measureStyleModel.measureLine.linePosition = linePosition;
  1562. this.measureStyleModel.measureLine.vLineLength = vLineLength;
  1563. this.measureStyleModel.measureLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false;
  1564. break;
  1565. case DrawToolType.MeasureDistanceLine: //距离
  1566. this.measureStyleModel.measureDistanceLine.font = font;
  1567. this.measureStyleModel.measureDistanceLine.fontSize = fontSize;
  1568. this.measureStyleModel.measureDistanceLine.textColor = textColor;
  1569. this.measureStyleModel.measureDistanceLine.lineColor = lineColor;
  1570. this.measureStyleModel.measureDistanceLine.lineWidth = lineWidth;
  1571. this.measureStyleModel.measureDistanceLine.lineStyle = lineStyle;
  1572. this.measureStyleModel.measureDistanceLine.linePosition = linePosition;
  1573. break;
  1574. case DrawToolType.MeasureLength: //长度测量->长度
  1575. this.measureStyleModel.measureLength.font = font;
  1576. this.measureStyleModel.measureLength.fontSize = fontSize;
  1577. this.measureStyleModel.measureLength.textColor = textColor;
  1578. this.measureStyleModel.measureLength.lineColor = lineColor;
  1579. this.measureStyleModel.measureLength.lineWidth = lineWidth;
  1580. this.measureStyleModel.measureLength.lineStyle = lineStyle;
  1581. this.measureStyleModel.measureLength.linePosition = linePosition;
  1582. break;
  1583. case DrawToolType.MeasureHLine: //长度测量->水平线
  1584. this.measureStyleModel.measureHLine.font = font;
  1585. this.measureStyleModel.measureHLine.fontSize = fontSize;
  1586. this.measureStyleModel.measureHLine.textColor = textColor;
  1587. this.measureStyleModel.measureHLine.lineColor = lineColor;
  1588. this.measureStyleModel.measureHLine.lineWidth = lineWidth;
  1589. this.measureStyleModel.measureHLine.lineStyle = lineStyle;
  1590. this.measureStyleModel.measureHLine.linePosition = linePosition;
  1591. this.measureStyleModel.measureHLine.vLineLength = vLineLength;
  1592. break;
  1593. case DrawToolType.MeasureVLine: //长度测量->垂线
  1594. this.measureStyleModel.measureVLine.font = font;
  1595. this.measureStyleModel.measureVLine.fontSize = fontSize;
  1596. this.measureStyleModel.measureVLine.textColor = textColor;
  1597. this.measureStyleModel.measureVLine.lineColor = lineColor;
  1598. this.measureStyleModel.measureVLine.lineWidth = lineWidth;
  1599. this.measureStyleModel.measureVLine.lineStyle = lineStyle;
  1600. this.measureStyleModel.measureVLine.linePosition = linePosition;
  1601. this.measureStyleModel.measureVLine.vLineLength = vLineLength;
  1602. this.measureStyleModel.measureVLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false;
  1603. break;
  1604. case DrawToolType.MeasureMulLine: //多点线段->多点直线
  1605. this.measureStyleModel.measureMulLine.font = font;
  1606. this.measureStyleModel.measureMulLine.fontSize = fontSize;
  1607. this.measureStyleModel.measureMulLine.textColor = textColor;
  1608. this.measureStyleModel.measureMulLine.lineColor = lineColor;
  1609. this.measureStyleModel.measureMulLine.lineWidth = lineWidth;
  1610. this.measureStyleModel.measureMulLine.lineStyle = lineStyle;
  1611. this.measureStyleModel.measureMulLine.linePositionL = linePositionL;
  1612. this.measureStyleModel.measureMulLine.linePositionP = linePositionP;
  1613. this.measureStyleModel.measureMulLine.vLineLength = vLineLength;
  1614. break;
  1615. case DrawToolType.MeasureMulHVLine: //多点线段->多点水平线
  1616. this.measureStyleModel.measureMulHVLine.font = font;
  1617. this.measureStyleModel.measureMulHVLine.fontSize = fontSize;
  1618. this.measureStyleModel.measureMulHVLine.textColor = textColor;
  1619. this.measureStyleModel.measureMulHVLine.lineColor = lineColor;
  1620. this.measureStyleModel.measureMulHVLine.lineWidth = lineWidth;
  1621. this.measureStyleModel.measureMulHVLine.lineStyle = lineStyle;
  1622. this.measureStyleModel.measureMulHVLine.linePositionL = linePositionL;
  1623. this.measureStyleModel.measureMulHVLine.linePositionP = linePositionP;
  1624. this.measureStyleModel.measureMulHVLine.vLineLength = vLineLength;
  1625. break;
  1626. case DrawToolType.MeasureMulSegment: //多点线段->多点线段
  1627. this.measureStyleModel.measureMulSegment.font = font;
  1628. this.measureStyleModel.measureMulSegment.fontSize = fontSize;
  1629. this.measureStyleModel.measureMulSegment.textColor = textColor;
  1630. this.measureStyleModel.measureMulSegment.lineColor = lineColor;
  1631. this.measureStyleModel.measureMulSegment.lineWidth = lineWidth;
  1632. this.measureStyleModel.measureMulSegment.lineStyle = lineStyle;
  1633. this.measureStyleModel.measureMulSegment.linePositionL = linePositionL;
  1634. this.measureStyleModel.measureMulSegment.linePositionP = linePositionP;
  1635. this.measureStyleModel.measureMulSegment.vLineLength = vLineLength;
  1636. break;
  1637. case DrawToolType.MeasureMulVLine: //多点线段->多点垂直线
  1638. this.measureStyleModel.measureMulVLine.font = font;
  1639. this.measureStyleModel.measureMulVLine.fontSize = fontSize;
  1640. this.measureStyleModel.measureMulVLine.textColor = textColor;
  1641. this.measureStyleModel.measureMulVLine.lineColor = lineColor;
  1642. this.measureStyleModel.measureMulVLine.lineWidth = lineWidth;
  1643. this.measureStyleModel.measureMulVLine.lineStyle = lineStyle;
  1644. this.measureStyleModel.measureMulVLine.linePositionL = linePositionL;
  1645. this.measureStyleModel.measureMulVLine.linePositionP = linePositionP;
  1646. this.measureStyleModel.measureMulVLine.vLineLength = vLineLength;
  1647. this.measureStyleModel.measureMulVLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false;
  1648. break;
  1649. case DrawToolType.MeasureBrokenLine: //曲线长度->折线
  1650. this.measureStyleModel.measureBrokenLine.font = font;
  1651. this.measureStyleModel.measureBrokenLine.fontSize = fontSize;
  1652. this.measureStyleModel.measureBrokenLine.textColor = textColor;
  1653. this.measureStyleModel.measureBrokenLine.lineColor = lineColor;
  1654. this.measureStyleModel.measureBrokenLine.lineWidth = lineWidth;
  1655. this.measureStyleModel.measureBrokenLine.lineStyle = lineStyle;
  1656. this.measureStyleModel.measureBrokenLine.linePosition = linePosition;
  1657. break;
  1658. case DrawToolType.MeasureTraceCurve: //曲线长度->轨迹曲线
  1659. this.measureStyleModel.measureTraceCurve.font = font;
  1660. this.measureStyleModel.measureTraceCurve.fontSize = fontSize;
  1661. this.measureStyleModel.measureTraceCurve.textColor = textColor;
  1662. this.measureStyleModel.measureTraceCurve.lineColor = lineColor;
  1663. this.measureStyleModel.measureTraceCurve.lineWidth = lineWidth;
  1664. this.measureStyleModel.measureTraceCurve.lineStyle = lineStyle;
  1665. this.measureStyleModel.measureTraceCurve.linePosition = linePosition;
  1666. break;
  1667. case DrawToolType.MeasureCurveLine: //曲线长度->曲线
  1668. this.measureStyleModel.measureCurveLine.font = font;
  1669. this.measureStyleModel.measureCurveLine.fontSize = fontSize;
  1670. this.measureStyleModel.measureCurveLine.textColor = textColor;
  1671. this.measureStyleModel.measureCurveLine.lineColor = lineColor;
  1672. this.measureStyleModel.measureCurveLine.lineWidth = lineWidth;
  1673. this.measureStyleModel.measureCurveLine.lineStyle = lineStyle;
  1674. this.measureStyleModel.measureCurveLine.linePosition = linePosition;
  1675. break;
  1676. case DrawToolType.MeasurePLine: //点垂线->点垂线
  1677. this.measureStyleModel.measurePLine.font = font;
  1678. this.measureStyleModel.measurePLine.fontSize = fontSize;
  1679. this.measureStyleModel.measurePLine.textColor = textColor;
  1680. this.measureStyleModel.measurePLine.lineColor = lineColor;
  1681. this.measureStyleModel.measurePLine.lineWidth = lineWidth;
  1682. this.measureStyleModel.measurePLine.lineStyle = lineStyle;
  1683. this.measureStyleModel.measurePLine.linePositionL = linePositionL;
  1684. this.measureStyleModel.measurePLine.linePositionP = linePositionP;
  1685. break;
  1686. case DrawToolType.MeasureMulPLine: //点垂线->多点垂线
  1687. this.measureStyleModel.measureMulPLine.font = font;
  1688. this.measureStyleModel.measureMulPLine.fontSize = fontSize;
  1689. this.measureStyleModel.measureMulPLine.textColor = textColor;
  1690. this.measureStyleModel.measureMulPLine.lineColor = lineColor;
  1691. this.measureStyleModel.measureMulPLine.lineWidth = lineWidth;
  1692. this.measureStyleModel.measureMulPLine.lineStyle = lineStyle;
  1693. this.measureStyleModel.measureMulPLine.linePositionL = linePositionL;
  1694. this.measureStyleModel.measureMulPLine.linePositionP = linePositionP;
  1695. break;
  1696. case DrawToolType.MeasureHMulPLine: //点垂线->水平多点垂线
  1697. this.measureStyleModel.measureHMulPLine.font = font;
  1698. this.measureStyleModel.measureHMulPLine.fontSize = fontSize;
  1699. this.measureStyleModel.measureHMulPLine.textColor = textColor;
  1700. this.measureStyleModel.measureHMulPLine.lineColor = lineColor;
  1701. this.measureStyleModel.measureHMulPLine.lineWidth = lineWidth;
  1702. this.measureStyleModel.measureHMulPLine.lineStyle = lineStyle;
  1703. this.measureStyleModel.measureHMulPLine.linePositionL = linePositionL;
  1704. this.measureStyleModel.measureHMulPLine.linePositionP = linePositionP;
  1705. break;
  1706. case DrawToolType.MeasureVMulPLine: //点垂线->垂直多点垂线
  1707. this.measureStyleModel.measureVMulPLine.font = font;
  1708. this.measureStyleModel.measureVMulPLine.fontSize = fontSize;
  1709. this.measureStyleModel.measureVMulPLine.textColor = textColor;
  1710. this.measureStyleModel.measureVMulPLine.lineColor = lineColor;
  1711. this.measureStyleModel.measureVMulPLine.lineWidth = lineWidth;
  1712. this.measureStyleModel.measureVMulPLine.lineStyle = lineStyle;
  1713. this.measureStyleModel.measureVMulPLine.linePositionL = linePositionL;
  1714. this.measureStyleModel.measureVMulPLine.linePositionP = linePositionP;
  1715. break;
  1716. case DrawToolType.MeasurePointHLine: //点垂线->点到水平线距离
  1717. this.measureStyleModel.measurePointHLine.font = font;
  1718. this.measureStyleModel.measurePointHLine.fontSize = fontSize;
  1719. this.measureStyleModel.measurePointHLine.textColor = textColor;
  1720. this.measureStyleModel.measurePointHLine.lineColor = lineColor;
  1721. this.measureStyleModel.measurePointHLine.lineWidth = lineWidth;
  1722. this.measureStyleModel.measurePointHLine.lineStyle = lineStyle;
  1723. this.measureStyleModel.measurePointHLine.linePositionL = linePositionL;
  1724. this.measureStyleModel.measurePointHLine.linePositionP = linePositionP;
  1725. break;
  1726. case DrawToolType.MeasureParallelLine: //平行线测量->平行线
  1727. this.measureStyleModel.measureParallelLine.font = font;
  1728. this.measureStyleModel.measureParallelLine.fontSize = fontSize;
  1729. this.measureStyleModel.measureParallelLine.textColor = textColor;
  1730. this.measureStyleModel.measureParallelLine.lineColor = lineColor;
  1731. this.measureStyleModel.measureParallelLine.lineWidth = lineWidth;
  1732. this.measureStyleModel.measureParallelLine.lineStyle = lineStyle;
  1733. this.measureStyleModel.measureParallelLine.linePositionL = linePositionL;
  1734. this.measureStyleModel.measureParallelLine.linePositionP = linePositionP;
  1735. this.measureStyleModel.measureParallelLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false;
  1736. break;
  1737. case DrawToolType.MeasureMulParallelLine: //平行线测量->多点平行线
  1738. this.measureStyleModel.measureMulParallelLine.font = font;
  1739. this.measureStyleModel.measureMulParallelLine.fontSize = fontSize;
  1740. this.measureStyleModel.measureMulParallelLine.textColor = textColor;
  1741. this.measureStyleModel.measureMulParallelLine.lineColor = lineColor;
  1742. this.measureStyleModel.measureMulParallelLine.lineWidth = lineWidth;
  1743. this.measureStyleModel.measureMulParallelLine.lineStyle = lineStyle;
  1744. this.measureStyleModel.measureMulParallelLine.linePositionL = linePositionL;
  1745. this.measureStyleModel.measureMulParallelLine.linePositionP = linePositionP;
  1746. break;
  1747. case DrawToolType.MeasureVMulParallelLine: //平行线测量->垂直多点平行线
  1748. this.measureStyleModel.measureVMulParallelLine.font = font;
  1749. this.measureStyleModel.measureVMulParallelLine.fontSize = fontSize;
  1750. this.measureStyleModel.measureVMulParallelLine.textColor = textColor;
  1751. this.measureStyleModel.measureVMulParallelLine.lineColor = lineColor;
  1752. this.measureStyleModel.measureVMulParallelLine.lineWidth = lineWidth;
  1753. this.measureStyleModel.measureVMulParallelLine.lineStyle = lineStyle;
  1754. this.measureStyleModel.measureVMulParallelLine.linePositionL = linePositionL;
  1755. this.measureStyleModel.measureVMulParallelLine.linePositionP = linePositionP;
  1756. break;
  1757. case DrawToolType.MeasureHMulParallelLine: //平行线测量->水平多点平行线
  1758. this.measureStyleModel.measureHMulParallelLine.font = font;
  1759. this.measureStyleModel.measureHMulParallelLine.fontSize = fontSize;
  1760. this.measureStyleModel.measureHMulParallelLine.textColor = textColor;
  1761. this.measureStyleModel.measureHMulParallelLine.lineColor = lineColor;
  1762. this.measureStyleModel.measureHMulParallelLine.lineWidth = lineWidth;
  1763. this.measureStyleModel.measureHMulParallelLine.lineStyle = lineStyle;
  1764. this.measureStyleModel.measureHMulParallelLine.linePositionL = linePositionL;
  1765. this.measureStyleModel.measureHMulParallelLine.linePositionP = linePositionP;
  1766. break;
  1767. case DrawToolType.MeasureClosedCurve: //多边形测量->闭合曲线
  1768. this.measureStyleModel.measureClosedCurve.font = font;
  1769. this.measureStyleModel.measureClosedCurve.fontSize = fontSize;
  1770. this.measureStyleModel.measureClosedCurve.textColor = textColor;
  1771. this.measureStyleModel.measureClosedCurve.lineColor = lineColor;
  1772. this.measureStyleModel.measureClosedCurve.lineWidth = lineWidth;
  1773. this.measureStyleModel.measureClosedCurve.lineStyle = lineStyle;
  1774. break;
  1775. case DrawToolType.MeasurePolygon: //多边形测量->多边形
  1776. this.measureStyleModel.measurePolygon.font = font;
  1777. this.measureStyleModel.measurePolygon.fontSize = fontSize;
  1778. this.measureStyleModel.measurePolygon.textColor = textColor;
  1779. this.measureStyleModel.measurePolygon.lineColor = lineColor;
  1780. this.measureStyleModel.measurePolygon.lineWidth = lineWidth;
  1781. this.measureStyleModel.measurePolygon.lineStyle = lineStyle;
  1782. break;
  1783. case DrawToolType.MeasureRectangle: //多边形测量->矩形
  1784. this.measureStyleModel.measureRectangle.font = font;
  1785. this.measureStyleModel.measureRectangle.fontSize = fontSize;
  1786. this.measureStyleModel.measureRectangle.textColor = textColor;
  1787. this.measureStyleModel.measureRectangle.lineColor = lineColor;
  1788. this.measureStyleModel.measureRectangle.lineWidth = lineWidth;
  1789. this.measureStyleModel.measureRectangle.lineStyle = lineStyle;
  1790. break;
  1791. case DrawToolType.MeasureRandRectangle: //多边形测量->任意矩形
  1792. this.measureStyleModel.measureRandRectangle.font = font;
  1793. this.measureStyleModel.measureRandRectangle.fontSize = fontSize;
  1794. this.measureStyleModel.measureRandRectangle.textColor = textColor;
  1795. this.measureStyleModel.measureRandRectangle.lineColor = lineColor;
  1796. this.measureStyleModel.measureRandRectangle.lineWidth = lineWidth;
  1797. this.measureStyleModel.measureRandRectangle.lineStyle = lineStyle;
  1798. break;
  1799. case DrawToolType.MeasureSquare: //多边形测量->正方形
  1800. this.measureStyleModel.measureSquare.font = font;
  1801. this.measureStyleModel.measureSquare.fontSize = fontSize;
  1802. this.measureStyleModel.measureSquare.textColor = textColor;
  1803. this.measureStyleModel.measureSquare.lineColor = lineColor;
  1804. this.measureStyleModel.measureSquare.lineWidth = lineWidth;
  1805. this.measureStyleModel.measureSquare.lineStyle = lineStyle;
  1806. break;
  1807. case DrawToolType.MeasureRandSquare: //多边形测量->任意正方形
  1808. this.measureStyleModel.measureRandSquare.font = font;
  1809. this.measureStyleModel.measureRandSquare.fontSize = fontSize;
  1810. this.measureStyleModel.measureRandSquare.textColor = textColor;
  1811. this.measureStyleModel.measureRandSquare.lineColor = lineColor;
  1812. this.measureStyleModel.measureRandSquare.lineWidth = lineWidth;
  1813. this.measureStyleModel.measureRandSquare.lineStyle = lineStyle;
  1814. break;
  1815. case DrawToolType.MeasureTracePolygon: //多边形测量->轨迹多边形
  1816. this.measureStyleModel.measureTracePolygon.font = font;
  1817. this.measureStyleModel.measureTracePolygon.fontSize = fontSize;
  1818. this.measureStyleModel.measureTracePolygon.textColor = textColor;
  1819. this.measureStyleModel.measureTracePolygon.lineColor = lineColor;
  1820. this.measureStyleModel.measureTracePolygon.lineWidth = lineWidth;
  1821. this.measureStyleModel.measureTracePolygon.lineStyle = lineStyle;
  1822. break;
  1823. case DrawToolType.MeasureCircle: //圆形测量->三点圆
  1824. this.measureStyleModel.measureCircle.font = font;
  1825. this.measureStyleModel.measureCircle.fontSize = fontSize;
  1826. this.measureStyleModel.measureCircle.textColor = textColor;
  1827. this.measureStyleModel.measureCircle.lineColor = lineColor;
  1828. this.measureStyleModel.measureCircle.lineWidth = lineWidth;
  1829. this.measureStyleModel.measureCircle.lineStyle = lineStyle;
  1830. break;
  1831. case DrawToolType.MeasureInnerCircle: //圆形测量->向内画圆
  1832. this.measureStyleModel.measureInnerCircle.font = font;
  1833. this.measureStyleModel.measureInnerCircle.fontSize = fontSize;
  1834. this.measureStyleModel.measureInnerCircle.textColor = textColor;
  1835. this.measureStyleModel.measureInnerCircle.lineColor = lineColor;
  1836. this.measureStyleModel.measureInnerCircle.lineWidth = lineWidth;
  1837. this.measureStyleModel.measureInnerCircle.lineStyle = lineStyle;
  1838. break;
  1839. case DrawToolType.MeasureOuterCircle: //圆形测量->向外画圆
  1840. this.measureStyleModel.measureOuterCircle.font = font;
  1841. this.measureStyleModel.measureOuterCircle.fontSize = fontSize;
  1842. this.measureStyleModel.measureOuterCircle.textColor = textColor;
  1843. this.measureStyleModel.measureOuterCircle.lineColor = lineColor;
  1844. this.measureStyleModel.measureOuterCircle.lineWidth = lineWidth;
  1845. this.measureStyleModel.measureOuterCircle.lineStyle = lineStyle;
  1846. break;
  1847. case DrawToolType.MeasureDiameterCircle: //圆形测量->直径画圆
  1848. this.measureStyleModel.measureDiameterCircle.font = font;
  1849. this.measureStyleModel.measureDiameterCircle.fontSize = fontSize;
  1850. this.measureStyleModel.measureDiameterCircle.textColor = textColor;
  1851. this.measureStyleModel.measureDiameterCircle.lineColor = lineColor;
  1852. this.measureStyleModel.measureDiameterCircle.lineWidth = lineWidth;
  1853. this.measureStyleModel.measureDiameterCircle.lineStyle = lineStyle;
  1854. break;
  1855. case DrawToolType.MeasurePointEdgeSize: //圆形测量->点到圆距离
  1856. this.measureStyleModel.measurePointEdgeSize.font = font;
  1857. this.measureStyleModel.measurePointEdgeSize.fontSize = fontSize;
  1858. this.measureStyleModel.measurePointEdgeSize.textColor = textColor;
  1859. this.measureStyleModel.measurePointEdgeSize.lineColor = lineColor;
  1860. this.measureStyleModel.measurePointEdgeSize.lineWidth = lineWidth;
  1861. this.measureStyleModel.measurePointEdgeSize.lineStyle = lineStyle;
  1862. break;
  1863. case DrawToolType.MeasurePointCenterSize: //圆形测量->点到圆心距离
  1864. this.measureStyleModel.measurePointCenterSize.font = font;
  1865. this.measureStyleModel.measurePointCenterSize.fontSize = fontSize;
  1866. this.measureStyleModel.measurePointCenterSize.textColor = textColor;
  1867. this.measureStyleModel.measurePointCenterSize.lineColor = lineColor;
  1868. this.measureStyleModel.measurePointCenterSize.lineWidth = lineWidth;
  1869. this.measureStyleModel.measurePointCenterSize.lineStyle = lineStyle;
  1870. break;
  1871. case DrawToolType.MeasurePointArcSize: //圆形测量->点到圆弧距离
  1872. this.measureStyleModel.measurePointArcSize.font = font;
  1873. this.measureStyleModel.measurePointArcSize.fontSize = fontSize;
  1874. this.measureStyleModel.measurePointArcSize.textColor = textColor;
  1875. this.measureStyleModel.measurePointArcSize.lineColor = lineColor;
  1876. this.measureStyleModel.measurePointArcSize.lineWidth = lineWidth;
  1877. this.measureStyleModel.measurePointArcSize.lineStyle = lineStyle;
  1878. break;
  1879. case DrawToolType.MeasureThreePointAngle: //角度测量->三点角度
  1880. this.measureStyleModel.measureThreePointAngle.font = font;
  1881. this.measureStyleModel.measureThreePointAngle.fontSize = fontSize;
  1882. this.measureStyleModel.measureThreePointAngle.textColor = textColor;
  1883. this.measureStyleModel.measureThreePointAngle.lineColor = lineColor;
  1884. this.measureStyleModel.measureThreePointAngle.lineWidth = lineWidth;
  1885. this.measureStyleModel.measureThreePointAngle.lineStyle = lineStyle;
  1886. this.measureStyleModel.measureThreePointAngle.isAngle = isAngle;
  1887. break;
  1888. case DrawToolType.MeasureFourPointAngle: //角度测量->四点角度
  1889. this.measureStyleModel.measureFourPointAngle.font = font;
  1890. this.measureStyleModel.measureFourPointAngle.fontSize = fontSize;
  1891. this.measureStyleModel.measureFourPointAngle.textColor = textColor;
  1892. this.measureStyleModel.measureFourPointAngle.lineColor = lineColor;
  1893. this.measureStyleModel.measureFourPointAngle.lineWidth = lineWidth;
  1894. this.measureStyleModel.measureFourPointAngle.lineStyle = lineStyle;
  1895. this.measureStyleModel.measureFourPointAngle.isAngle = isAngle;
  1896. break;
  1897. case DrawToolType.MeasureThreePointArc: //角度测量->三点弧
  1898. this.measureStyleModel.measureThreePointArc.font = font;
  1899. this.measureStyleModel.measureThreePointArc.fontSize = fontSize;
  1900. this.measureStyleModel.measureThreePointArc.textColor = textColor;
  1901. this.measureStyleModel.measureThreePointArc.lineColor = lineColor;
  1902. this.measureStyleModel.measureThreePointArc.lineWidth = lineWidth;
  1903. this.measureStyleModel.measureThreePointArc.lineStyle = lineStyle;
  1904. this.measureStyleModel.measureThreePointArc.isAngle = isAngle;
  1905. break;
  1906. case DrawToolType.MeasureCenterCenterSize: //对准度测量->圆心到圆心距离
  1907. this.measureStyleModel.measureCenterCenterSize.font = font;
  1908. this.measureStyleModel.measureCenterCenterSize.fontSize = fontSize;
  1909. this.measureStyleModel.measureCenterCenterSize.textColor = textColor;
  1910. this.measureStyleModel.measureCenterCenterSize.lineColor = lineColor;
  1911. this.measureStyleModel.measureCenterCenterSize.lineWidth = lineWidth;
  1912. this.measureStyleModel.measureCenterCenterSize.lineStyle = lineStyle;
  1913. this.measureStyleModel.measureCenterCenterSize.linePosition = linePosition;
  1914. break;
  1915. case DrawToolType.MeasureTwoLineVLDistance: //对准度测量->两线中垂线距离
  1916. this.measureStyleModel.measureTwoLineVLDistance.font = font;
  1917. this.measureStyleModel.measureTwoLineVLDistance.fontSize = fontSize;
  1918. this.measureStyleModel.measureTwoLineVLDistance.textColor = textColor;
  1919. this.measureStyleModel.measureTwoLineVLDistance.lineColor = lineColor;
  1920. this.measureStyleModel.measureTwoLineVLDistance.lineWidth = lineWidth;
  1921. this.measureStyleModel.measureTwoLineVLDistance.lineStyle = lineStyle;
  1922. this.measureStyleModel.measureTwoLineVLDistance.linePosition = linePosition;
  1923. break;
  1924. }
  1925. }
  1926. /// <summary>
  1927. /// 应用全部
  1928. /// </summary>
  1929. /// <param name="sender"></param>
  1930. /// <param name="e"></param>
  1931. private void button6_Click(object sender, EventArgs e)
  1932. {
  1933. string font = comboBox11.Text;
  1934. int fontSize = Convert.ToInt32(numericUpDown21.Value);
  1935. int textColor = Convert.ToInt32(this.textPanel.BackColor.ToArgb());
  1936. int lineColor = Convert.ToInt32(this.linePanel.BackColor.ToArgb());
  1937. int lineWidth = Convert.ToInt32(numericUpDown11.Value);
  1938. int lineStyle = this.comboBox21.SelectedIndex;
  1939. int linePosition = this.comboBox2.SelectedIndex;
  1940. int linePositionL = this.comboBox3.SelectedIndex;
  1941. int linePositionP = this.comboBox4.SelectedIndex;
  1942. int vLineLength = Convert.ToInt32(this.numericUpDown1.Value);
  1943. bool isAngle = comboBox91.SelectedIndex == 0 ? false : true;
  1944. switch (this.selectId)
  1945. {
  1946. // 直线测量
  1947. case 1:
  1948. this.measureStyleModel.measureLine.font = font;
  1949. this.measureStyleModel.measureLine.fontSize = fontSize;
  1950. this.measureStyleModel.measureLine.textColor = textColor;
  1951. this.measureStyleModel.measureLine.lineColor = lineColor;
  1952. this.measureStyleModel.measureLine.lineWidth = lineWidth;
  1953. this.measureStyleModel.measureLine.lineStyle = lineStyle;
  1954. this.measureStyleModel.measureLine.linePosition = linePosition;
  1955. this.measureStyleModel.measureLine.vLineLength = vLineLength;
  1956. this.measureStyleModel.measureLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false;
  1957. this.measureStyleModel.measureDistanceLine.font = font;
  1958. this.measureStyleModel.measureDistanceLine.fontSize = fontSize;
  1959. this.measureStyleModel.measureDistanceLine.textColor = textColor;
  1960. this.measureStyleModel.measureDistanceLine.lineColor = lineColor;
  1961. this.measureStyleModel.measureDistanceLine.lineWidth = lineWidth;
  1962. this.measureStyleModel.measureDistanceLine.lineStyle = lineStyle;
  1963. this.measureStyleModel.measureDistanceLine.linePosition = linePosition;
  1964. this.measureStyleModel.measureLength.font = font;
  1965. this.measureStyleModel.measureLength.fontSize = fontSize;
  1966. this.measureStyleModel.measureLength.textColor = textColor;
  1967. this.measureStyleModel.measureLength.lineColor = lineColor;
  1968. this.measureStyleModel.measureLength.lineWidth = lineWidth;
  1969. this.measureStyleModel.measureLength.lineStyle = lineStyle;
  1970. this.measureStyleModel.measureLength.linePosition = linePosition;
  1971. this.measureStyleModel.measureHLine.font = font;
  1972. this.measureStyleModel.measureHLine.fontSize = fontSize;
  1973. this.measureStyleModel.measureHLine.textColor = textColor;
  1974. this.measureStyleModel.measureHLine.lineColor = lineColor;
  1975. this.measureStyleModel.measureHLine.lineWidth = lineWidth;
  1976. this.measureStyleModel.measureHLine.lineStyle = lineStyle;
  1977. this.measureStyleModel.measureHLine.linePosition = linePosition;
  1978. this.measureStyleModel.measureHLine.vLineLength = vLineLength;
  1979. this.measureStyleModel.measureVLine.font = font;
  1980. this.measureStyleModel.measureVLine.fontSize = fontSize;
  1981. this.measureStyleModel.measureVLine.textColor = textColor;
  1982. this.measureStyleModel.measureVLine.lineColor = lineColor;
  1983. this.measureStyleModel.measureVLine.lineWidth = lineWidth;
  1984. this.measureStyleModel.measureVLine.lineStyle = lineStyle;
  1985. this.measureStyleModel.measureVLine.linePosition = linePosition;
  1986. this.measureStyleModel.measureVLine.vLineLength = vLineLength;
  1987. this.measureStyleModel.measureVLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false;
  1988. break;
  1989. // 多点直线
  1990. case 2:
  1991. this.measureStyleModel.measureMulLine.font = font;
  1992. this.measureStyleModel.measureMulLine.fontSize = fontSize;
  1993. this.measureStyleModel.measureMulLine.textColor = textColor;
  1994. this.measureStyleModel.measureMulLine.lineColor = lineColor;
  1995. this.measureStyleModel.measureMulLine.lineWidth = lineWidth;
  1996. this.measureStyleModel.measureMulLine.lineStyle = lineStyle;
  1997. this.measureStyleModel.measureMulLine.linePositionL = linePositionL;
  1998. this.measureStyleModel.measureMulLine.linePositionP = linePositionP;
  1999. this.measureStyleModel.measureMulLine.vLineLength = vLineLength;
  2000. this.measureStyleModel.measureMulHVLine.font = font;
  2001. this.measureStyleModel.measureMulHVLine.fontSize = fontSize;
  2002. this.measureStyleModel.measureMulHVLine.textColor = textColor;
  2003. this.measureStyleModel.measureMulHVLine.lineColor = lineColor;
  2004. this.measureStyleModel.measureMulHVLine.lineWidth = lineWidth;
  2005. this.measureStyleModel.measureMulHVLine.lineStyle = lineStyle;
  2006. this.measureStyleModel.measureMulHVLine.linePositionL = linePositionL;
  2007. this.measureStyleModel.measureMulHVLine.linePositionP = linePositionP;
  2008. this.measureStyleModel.measureMulHVLine.vLineLength = vLineLength;
  2009. this.measureStyleModel.measureMulSegment.font = font;
  2010. this.measureStyleModel.measureMulSegment.fontSize = fontSize;
  2011. this.measureStyleModel.measureMulSegment.textColor = textColor;
  2012. this.measureStyleModel.measureMulSegment.lineColor = lineColor;
  2013. this.measureStyleModel.measureMulSegment.lineWidth = lineWidth;
  2014. this.measureStyleModel.measureMulSegment.lineStyle = lineStyle;
  2015. this.measureStyleModel.measureMulSegment.linePositionL = linePositionL;
  2016. this.measureStyleModel.measureMulSegment.linePositionP = linePositionP;
  2017. this.measureStyleModel.measureMulSegment.vLineLength = vLineLength;
  2018. this.measureStyleModel.measureMulVLine.font = font;
  2019. this.measureStyleModel.measureMulVLine.fontSize = fontSize;
  2020. this.measureStyleModel.measureMulVLine.textColor = textColor;
  2021. this.measureStyleModel.measureMulVLine.lineColor = lineColor;
  2022. this.measureStyleModel.measureMulVLine.lineWidth = lineWidth;
  2023. this.measureStyleModel.measureMulVLine.lineStyle = lineStyle;
  2024. this.measureStyleModel.measureMulVLine.linePositionL = linePositionL;
  2025. this.measureStyleModel.measureMulVLine.linePositionP = linePositionP;
  2026. this.measureStyleModel.measureMulVLine.vLineLength = vLineLength;
  2027. this.measureStyleModel.measureMulVLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false;
  2028. break;
  2029. // 曲线测量
  2030. case 3:
  2031. this.measureStyleModel.measureBrokenLine.font = font;
  2032. this.measureStyleModel.measureBrokenLine.fontSize = fontSize;
  2033. this.measureStyleModel.measureBrokenLine.textColor = textColor;
  2034. this.measureStyleModel.measureBrokenLine.lineColor = lineColor;
  2035. this.measureStyleModel.measureBrokenLine.lineWidth = lineWidth;
  2036. this.measureStyleModel.measureBrokenLine.lineStyle = lineStyle;
  2037. this.measureStyleModel.measureBrokenLine.linePosition = linePosition;
  2038. this.measureStyleModel.measureTraceCurve.font = font;
  2039. this.measureStyleModel.measureTraceCurve.fontSize = fontSize;
  2040. this.measureStyleModel.measureTraceCurve.textColor = textColor;
  2041. this.measureStyleModel.measureTraceCurve.lineColor = lineColor;
  2042. this.measureStyleModel.measureTraceCurve.lineWidth = lineWidth;
  2043. this.measureStyleModel.measureTraceCurve.lineStyle = lineStyle;
  2044. this.measureStyleModel.measureTraceCurve.linePosition = linePosition;
  2045. this.measureStyleModel.measureCurveLine.font = font;
  2046. this.measureStyleModel.measureCurveLine.fontSize = fontSize;
  2047. this.measureStyleModel.measureCurveLine.textColor = textColor;
  2048. this.measureStyleModel.measureCurveLine.lineColor = lineColor;
  2049. this.measureStyleModel.measureCurveLine.lineWidth = lineWidth;
  2050. this.measureStyleModel.measureCurveLine.lineStyle = lineStyle;
  2051. this.measureStyleModel.measureCurveLine.linePosition = linePosition;
  2052. break;
  2053. // 点垂线
  2054. case 4:
  2055. this.measureStyleModel.measurePLine.font = font;
  2056. this.measureStyleModel.measurePLine.fontSize = fontSize;
  2057. this.measureStyleModel.measurePLine.textColor = textColor;
  2058. this.measureStyleModel.measurePLine.lineColor = lineColor;
  2059. this.measureStyleModel.measurePLine.lineWidth = lineWidth;
  2060. this.measureStyleModel.measurePLine.lineStyle = lineStyle;
  2061. this.measureStyleModel.measurePLine.linePositionL = linePositionL;
  2062. this.measureStyleModel.measurePLine.linePositionP = linePositionP;
  2063. this.measureStyleModel.measureMulPLine.font = font;
  2064. this.measureStyleModel.measureMulPLine.fontSize = fontSize;
  2065. this.measureStyleModel.measureMulPLine.textColor = textColor;
  2066. this.measureStyleModel.measureMulPLine.lineColor = lineColor;
  2067. this.measureStyleModel.measureMulPLine.lineWidth = lineWidth;
  2068. this.measureStyleModel.measureMulPLine.lineStyle = lineStyle;
  2069. this.measureStyleModel.measureMulPLine.linePositionL = linePositionL;
  2070. this.measureStyleModel.measureMulPLine.linePositionP = linePositionP;
  2071. this.measureStyleModel.measureHMulPLine.font = font;
  2072. this.measureStyleModel.measureHMulPLine.fontSize = fontSize;
  2073. this.measureStyleModel.measureHMulPLine.textColor = textColor;
  2074. this.measureStyleModel.measureHMulPLine.lineColor = lineColor;
  2075. this.measureStyleModel.measureHMulPLine.lineWidth = lineWidth;
  2076. this.measureStyleModel.measureHMulPLine.lineStyle = lineStyle;
  2077. this.measureStyleModel.measureHMulPLine.linePositionL = linePositionL;
  2078. this.measureStyleModel.measureHMulPLine.linePositionP = linePositionP;
  2079. this.measureStyleModel.measureVMulPLine.font = font;
  2080. this.measureStyleModel.measureVMulPLine.fontSize = fontSize;
  2081. this.measureStyleModel.measureVMulPLine.textColor = textColor;
  2082. this.measureStyleModel.measureVMulPLine.lineColor = lineColor;
  2083. this.measureStyleModel.measureVMulPLine.lineWidth = lineWidth;
  2084. this.measureStyleModel.measureVMulPLine.lineStyle = lineStyle;
  2085. this.measureStyleModel.measureVMulPLine.linePositionL = linePositionL;
  2086. this.measureStyleModel.measureVMulPLine.linePositionP = linePositionP;
  2087. this.measureStyleModel.measurePointHLine.font = font;
  2088. this.measureStyleModel.measurePointHLine.fontSize = fontSize;
  2089. this.measureStyleModel.measurePointHLine.textColor = textColor;
  2090. this.measureStyleModel.measurePointHLine.lineColor = lineColor;
  2091. this.measureStyleModel.measurePointHLine.lineWidth = lineWidth;
  2092. this.measureStyleModel.measurePointHLine.lineStyle = lineStyle;
  2093. this.measureStyleModel.measurePointHLine.linePositionL = linePositionL;
  2094. this.measureStyleModel.measurePointHLine.linePositionP = linePositionP;
  2095. break;
  2096. // 平行线测量
  2097. case 5:
  2098. this.measureStyleModel.measureParallelLine.font = font;
  2099. this.measureStyleModel.measureParallelLine.fontSize = fontSize;
  2100. this.measureStyleModel.measureParallelLine.textColor = textColor;
  2101. this.measureStyleModel.measureParallelLine.lineColor = lineColor;
  2102. this.measureStyleModel.measureParallelLine.lineWidth = lineWidth;
  2103. this.measureStyleModel.measureParallelLine.lineStyle = lineStyle;
  2104. this.measureStyleModel.measureParallelLine.linePositionL = linePositionL;
  2105. this.measureStyleModel.measureParallelLine.linePositionP = linePositionP;
  2106. this.measureStyleModel.measureParallelLine.followLine = this.comboBox5.SelectedIndex == 0 ? true : false;
  2107. this.measureStyleModel.measureMulParallelLine.font = font;
  2108. this.measureStyleModel.measureMulParallelLine.fontSize = fontSize;
  2109. this.measureStyleModel.measureMulParallelLine.textColor = textColor;
  2110. this.measureStyleModel.measureMulParallelLine.lineColor = lineColor;
  2111. this.measureStyleModel.measureMulParallelLine.lineWidth = lineWidth;
  2112. this.measureStyleModel.measureMulParallelLine.lineStyle = lineStyle;
  2113. this.measureStyleModel.measureMulParallelLine.linePositionL = linePositionL;
  2114. this.measureStyleModel.measureMulParallelLine.linePositionP = linePositionP;
  2115. this.measureStyleModel.measureVMulParallelLine.font = font;
  2116. this.measureStyleModel.measureVMulParallelLine.fontSize = fontSize;
  2117. this.measureStyleModel.measureVMulParallelLine.textColor = textColor;
  2118. this.measureStyleModel.measureVMulParallelLine.lineColor = lineColor;
  2119. this.measureStyleModel.measureVMulParallelLine.lineWidth = lineWidth;
  2120. this.measureStyleModel.measureVMulParallelLine.lineStyle = lineStyle;
  2121. this.measureStyleModel.measureVMulParallelLine.linePositionL = linePositionL;
  2122. this.measureStyleModel.measureVMulParallelLine.linePositionP = linePositionP;
  2123. this.measureStyleModel.measureHMulParallelLine.font = font;
  2124. this.measureStyleModel.measureHMulParallelLine.fontSize = fontSize;
  2125. this.measureStyleModel.measureHMulParallelLine.textColor = textColor;
  2126. this.measureStyleModel.measureHMulParallelLine.lineColor = lineColor;
  2127. this.measureStyleModel.measureHMulParallelLine.lineWidth = lineWidth;
  2128. this.measureStyleModel.measureHMulParallelLine.lineStyle = lineStyle;
  2129. this.measureStyleModel.measureHMulParallelLine.linePositionL = linePositionL;
  2130. this.measureStyleModel.measureHMulParallelLine.linePositionP = linePositionP;
  2131. break;
  2132. // 多边形测量
  2133. case 6:
  2134. this.measureStyleModel.measureClosedCurve.font = font;
  2135. this.measureStyleModel.measureClosedCurve.fontSize = fontSize;
  2136. this.measureStyleModel.measureClosedCurve.textColor = textColor;
  2137. this.measureStyleModel.measureClosedCurve.lineColor = lineColor;
  2138. this.measureStyleModel.measureClosedCurve.lineWidth = lineWidth;
  2139. this.measureStyleModel.measureClosedCurve.lineStyle = lineStyle;
  2140. this.measureStyleModel.measurePolygon.font = font;
  2141. this.measureStyleModel.measurePolygon.fontSize = fontSize;
  2142. this.measureStyleModel.measurePolygon.textColor = textColor;
  2143. this.measureStyleModel.measurePolygon.lineColor = lineColor;
  2144. this.measureStyleModel.measurePolygon.lineWidth = lineWidth;
  2145. this.measureStyleModel.measurePolygon.lineStyle = lineStyle;
  2146. this.measureStyleModel.measureRectangle.font = font;
  2147. this.measureStyleModel.measureRectangle.fontSize = fontSize;
  2148. this.measureStyleModel.measureRectangle.textColor = textColor;
  2149. this.measureStyleModel.measureRectangle.lineColor = lineColor;
  2150. this.measureStyleModel.measureRectangle.lineWidth = lineWidth;
  2151. this.measureStyleModel.measureRectangle.lineStyle = lineStyle;
  2152. this.measureStyleModel.measureRandRectangle.font = font;
  2153. this.measureStyleModel.measureRandRectangle.fontSize = fontSize;
  2154. this.measureStyleModel.measureRandRectangle.textColor = textColor;
  2155. this.measureStyleModel.measureRandRectangle.lineColor = lineColor;
  2156. this.measureStyleModel.measureRandRectangle.lineWidth = lineWidth;
  2157. this.measureStyleModel.measureRandRectangle.lineStyle = lineStyle;
  2158. this.measureStyleModel.measureSquare.font = font;
  2159. this.measureStyleModel.measureSquare.fontSize = fontSize;
  2160. this.measureStyleModel.measureSquare.textColor = textColor;
  2161. this.measureStyleModel.measureSquare.lineColor = lineColor;
  2162. this.measureStyleModel.measureSquare.lineWidth = lineWidth;
  2163. this.measureStyleModel.measureSquare.lineStyle = lineStyle;
  2164. this.measureStyleModel.measureRandSquare.font = font;
  2165. this.measureStyleModel.measureRandSquare.fontSize = fontSize;
  2166. this.measureStyleModel.measureRandSquare.textColor = textColor;
  2167. this.measureStyleModel.measureRandSquare.lineColor = lineColor;
  2168. this.measureStyleModel.measureRandSquare.lineWidth = lineWidth;
  2169. this.measureStyleModel.measureRandSquare.lineStyle = lineStyle;
  2170. this.measureStyleModel.measureTracePolygon.font = font;
  2171. this.measureStyleModel.measureTracePolygon.fontSize = fontSize;
  2172. this.measureStyleModel.measureTracePolygon.textColor = textColor;
  2173. this.measureStyleModel.measureTracePolygon.lineColor = lineColor;
  2174. this.measureStyleModel.measureTracePolygon.lineWidth = lineWidth;
  2175. this.measureStyleModel.measureTracePolygon.lineStyle = lineStyle;
  2176. break;
  2177. // 圆形测量
  2178. case 7:
  2179. this.measureStyleModel.measureCircle.font = font;
  2180. this.measureStyleModel.measureCircle.fontSize = fontSize;
  2181. this.measureStyleModel.measureCircle.textColor = textColor;
  2182. this.measureStyleModel.measureCircle.lineColor = lineColor;
  2183. this.measureStyleModel.measureCircle.lineWidth = lineWidth;
  2184. this.measureStyleModel.measureCircle.lineStyle = lineStyle;
  2185. this.measureStyleModel.measureInnerCircle.font = font;
  2186. this.measureStyleModel.measureInnerCircle.fontSize = fontSize;
  2187. this.measureStyleModel.measureInnerCircle.textColor = textColor;
  2188. this.measureStyleModel.measureInnerCircle.lineColor = lineColor;
  2189. this.measureStyleModel.measureInnerCircle.lineWidth = lineWidth;
  2190. this.measureStyleModel.measureInnerCircle.lineStyle = lineStyle;
  2191. this.measureStyleModel.measureOuterCircle.font = font;
  2192. this.measureStyleModel.measureOuterCircle.fontSize = fontSize;
  2193. this.measureStyleModel.measureOuterCircle.textColor = textColor;
  2194. this.measureStyleModel.measureOuterCircle.lineColor = lineColor;
  2195. this.measureStyleModel.measureOuterCircle.lineWidth = lineWidth;
  2196. this.measureStyleModel.measureOuterCircle.lineStyle = lineStyle;
  2197. this.measureStyleModel.measureDiameterCircle.font = font;
  2198. this.measureStyleModel.measureDiameterCircle.fontSize = fontSize;
  2199. this.measureStyleModel.measureDiameterCircle.textColor = textColor;
  2200. this.measureStyleModel.measureDiameterCircle.lineColor = lineColor;
  2201. this.measureStyleModel.measureDiameterCircle.lineWidth = lineWidth;
  2202. this.measureStyleModel.measureDiameterCircle.lineStyle = lineStyle;
  2203. this.measureStyleModel.measurePointEdgeSize.font = font;
  2204. this.measureStyleModel.measurePointEdgeSize.fontSize = fontSize;
  2205. this.measureStyleModel.measurePointEdgeSize.textColor = textColor;
  2206. this.measureStyleModel.measurePointEdgeSize.lineColor = lineColor;
  2207. this.measureStyleModel.measurePointEdgeSize.lineWidth = lineWidth;
  2208. this.measureStyleModel.measurePointEdgeSize.lineStyle = lineStyle;
  2209. this.measureStyleModel.measurePointCenterSize.font = font;
  2210. this.measureStyleModel.measurePointCenterSize.fontSize = fontSize;
  2211. this.measureStyleModel.measurePointCenterSize.textColor = textColor;
  2212. this.measureStyleModel.measurePointCenterSize.lineColor = lineColor;
  2213. this.measureStyleModel.measurePointCenterSize.lineWidth = lineWidth;
  2214. this.measureStyleModel.measurePointCenterSize.lineStyle = lineStyle;
  2215. this.measureStyleModel.measurePointArcSize.font = font;
  2216. this.measureStyleModel.measurePointArcSize.fontSize = fontSize;
  2217. this.measureStyleModel.measurePointArcSize.textColor = textColor;
  2218. this.measureStyleModel.measurePointArcSize.lineColor = lineColor;
  2219. this.measureStyleModel.measurePointArcSize.lineWidth = lineWidth;
  2220. this.measureStyleModel.measurePointArcSize.lineStyle = lineStyle;
  2221. break;
  2222. // 角度测量
  2223. case 8:
  2224. this.measureStyleModel.measureThreePointAngle.font = font;
  2225. this.measureStyleModel.measureThreePointAngle.fontSize = fontSize;
  2226. this.measureStyleModel.measureThreePointAngle.textColor = textColor;
  2227. this.measureStyleModel.measureThreePointAngle.lineColor = lineColor;
  2228. this.measureStyleModel.measureThreePointAngle.lineWidth = lineWidth;
  2229. this.measureStyleModel.measureThreePointAngle.lineStyle = lineStyle;
  2230. this.measureStyleModel.measureThreePointAngle.isAngle = isAngle;
  2231. this.measureStyleModel.measureFourPointAngle.font = font;
  2232. this.measureStyleModel.measureFourPointAngle.fontSize = fontSize;
  2233. this.measureStyleModel.measureFourPointAngle.textColor = textColor;
  2234. this.measureStyleModel.measureFourPointAngle.lineColor = lineColor;
  2235. this.measureStyleModel.measureFourPointAngle.lineWidth = lineWidth;
  2236. this.measureStyleModel.measureFourPointAngle.lineStyle = lineStyle;
  2237. this.measureStyleModel.measureFourPointAngle.isAngle = isAngle;
  2238. this.measureStyleModel.measureThreePointArc.font = font;
  2239. this.measureStyleModel.measureThreePointArc.fontSize = fontSize;
  2240. this.measureStyleModel.measureThreePointArc.textColor = textColor;
  2241. this.measureStyleModel.measureThreePointArc.lineColor = lineColor;
  2242. this.measureStyleModel.measureThreePointArc.lineWidth = lineWidth;
  2243. this.measureStyleModel.measureThreePointArc.lineStyle = lineStyle;
  2244. this.measureStyleModel.measureThreePointArc.isAngle = isAngle;
  2245. break;
  2246. case 9:
  2247. this.measureStyleModel.measureCenterCenterSize.font = font;
  2248. this.measureStyleModel.measureCenterCenterSize.fontSize = fontSize;
  2249. this.measureStyleModel.measureCenterCenterSize.textColor = textColor;
  2250. this.measureStyleModel.measureCenterCenterSize.lineColor = lineColor;
  2251. this.measureStyleModel.measureCenterCenterSize.lineWidth = lineWidth;
  2252. this.measureStyleModel.measureCenterCenterSize.lineStyle = lineStyle;
  2253. this.measureStyleModel.measureCenterCenterSize.linePosition = linePosition;
  2254. this.measureStyleModel.measureTwoLineVLDistance.font = font;
  2255. this.measureStyleModel.measureTwoLineVLDistance.fontSize = fontSize;
  2256. this.measureStyleModel.measureTwoLineVLDistance.textColor = textColor;
  2257. this.measureStyleModel.measureTwoLineVLDistance.lineColor = lineColor;
  2258. this.measureStyleModel.measureTwoLineVLDistance.lineWidth = lineWidth;
  2259. this.measureStyleModel.measureTwoLineVLDistance.lineStyle = lineStyle;
  2260. this.measureStyleModel.measureTwoLineVLDistance.linePosition = linePosition;
  2261. break;
  2262. }
  2263. //以下保存xml文件信息
  2264. string stageModelXml = XmlSerializeHelper.XmlSerialize<MeasureStyleModel>(this.measureStyleModel);
  2265. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\" + this.comboBox1.Text + ".xml";
  2266. FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
  2267. ApplicationSetting();
  2268. }
  2269. }
  2270. }