LabelWorkTypeStyleDialog.cs 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909
  1. using PaintDotNet.Annotation;
  2. using PaintDotNet.Annotation.Label;
  3. using PaintDotNet.Base.CommTool;
  4. using PaintDotNet.Base.SettingModel;
  5. using System;
  6. using System.Collections;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Threading.Tasks;
  14. using System.Windows.Forms;
  15. namespace PaintDotNet.ImageLabel
  16. {
  17. internal class LabelWorkTypeStyleDialog : PdnBaseForm
  18. {
  19. private Button button2;
  20. private Button button1;
  21. private GroupBox groupBox2;
  22. private GroupBox groupBox3;
  23. private GroupBox groupBox4;
  24. private Label label2;
  25. private Label label1;
  26. private Panel panel1;
  27. private RadioButton radioButton2;
  28. private RadioButton radioButton1;
  29. private Label label3;
  30. private NumericUpDown numericUpDown1;
  31. private Label label5;
  32. private Label label4;
  33. private RadioButton radioButton4;
  34. private RadioButton radioButton3;
  35. private Panel panel2;
  36. private Label label6;
  37. private NumericUpDown numericUpDown2;
  38. private Label label10;
  39. private Label label9;
  40. private Label label7;
  41. private NumericUpDown numericUpDown3;
  42. private Panel panel3;
  43. private RadioButton radioButton6;
  44. private RadioButton radioButton8;
  45. private Label label12;
  46. private Label label11;
  47. private Panel panel4;
  48. private ComboBox comboBox1;
  49. private Label label13;
  50. private NumericUpDown numericUpDown4;
  51. private GroupBox groupBox1;
  52. private AppWorkspace appWorkspace;
  53. private DrawObject drawObject;
  54. private ParentStyleModel parentStyleModel;
  55. private WorkTypeStyleModel workTypeModel;
  56. /// <summary>
  57. /// 字体列表
  58. /// </summary>
  59. ArrayList fontsItems = new ArrayList();
  60. /// <summary>
  61. /// 调色板辅助线
  62. /// </summary>
  63. PaintDotNet.ColorsForm colorsFormfzx;
  64. /// <summary>
  65. /// 调色板连接线
  66. /// </summary>
  67. PaintDotNet.ColorsForm colorsFormljx;
  68. /// <summary>
  69. /// 调色板测量线
  70. /// </summary>
  71. PaintDotNet.ColorsForm colorsFormclx;
  72. private Panel panel5;
  73. private RadioButton radioButton7;
  74. private RadioButton radioButton5;
  75. private Label label8;
  76. /// <summary>
  77. /// 调色板字体
  78. /// </summary>
  79. PaintDotNet.ColorsForm colorsFormfont;
  80. public LabelWorkTypeStyleDialog(AppWorkspace appWorkspace, DrawObject drawObject)
  81. {
  82. this.appWorkspace = appWorkspace;
  83. this.drawObject = drawObject;
  84. this.parentStyleModel = DrawRulerHelper.DeepCopyByReflect(this.drawObject.GetStyle());
  85. InitializeComponent();
  86. InitializeLanguageText();
  87. InitializeColorForm();
  88. InitializeWorkTypeModel();
  89. }
  90. private void InitializeLanguageText()
  91. {
  92. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  93. this.button2.Text = PdnResources.GetString("Menu.File.Close.Text");
  94. this.button1.Text = PdnResources.GetString("Menu.application.text");
  95. this.groupBox2.Text = PdnResources.GetString("Menu.Auxiliarylinesettings.text");
  96. this.label3.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
  97. this.radioButton2.Text = PdnResources.GetString("Menu.no.text");
  98. this.radioButton1.Text = PdnResources.GetString("Menu.Yes.text");
  99. this.label2.Text = PdnResources.GetString("Menu.display.text") + ":";
  100. this.label1.Text = PdnResources.GetString("Menu.color.text") + ":";
  101. this.groupBox3.Text = PdnResources.GetString("Menu.Set.typesettings.the communicationscablesetting.text");
  102. this.label6.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
  103. this.radioButton4.Text = PdnResources.GetString("Menu.no.text");
  104. this.radioButton3.Text = PdnResources.GetString("Menu.Yes.text");
  105. this.label5.Text = PdnResources.GetString("Menu.display.text") + ":";
  106. this.label4.Text = PdnResources.GetString("Menu.color.text") + ":";
  107. this.groupBox4.Text = PdnResources.GetString("Menu.Measuringlinesetting.text");
  108. this.label13.Text = PdnResources.GetString("Menu.Fontsize.text") + ":";
  109. this.label12.Text = PdnResources.GetString("Menu.Font.text") + ":";
  110. this.label11.Text = PdnResources.GetString("Menu.fontcolor.text") + ":";
  111. this.radioButton8.Text = PdnResources.GetString("Menu.no.text");
  112. this.radioButton6.Text = PdnResources.GetString("Menu.Yes.text");
  113. this.label10.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
  114. this.label9.Text = PdnResources.GetString("Menu.Set.typesettings.Displaythelengthofmeasuringline.text") + ":";
  115. this.label7.Text = PdnResources.GetString("Menu.color.text") + ":";
  116. this.radioButton7.Text = PdnResources.GetString("Menu.no.text");
  117. this.radioButton5.Text = PdnResources.GetString("Menu.Yes.text");
  118. this.label8.Text = PdnResources.GetString("Menu.Set.typesettings.Displaymeasuringlinedistance.text") + ":";
  119. this.Text = PdnResources.GetString("Menu.Setting.WorkTypeSetting.Text");
  120. }
  121. private void InitializeComponent()
  122. {
  123. this.groupBox1 = new System.Windows.Forms.GroupBox();
  124. this.button2 = new System.Windows.Forms.Button();
  125. this.button1 = new System.Windows.Forms.Button();
  126. this.groupBox2 = new System.Windows.Forms.GroupBox();
  127. this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
  128. this.label3 = new System.Windows.Forms.Label();
  129. this.radioButton2 = new System.Windows.Forms.RadioButton();
  130. this.radioButton1 = new System.Windows.Forms.RadioButton();
  131. this.panel1 = new System.Windows.Forms.Panel();
  132. this.label2 = new System.Windows.Forms.Label();
  133. this.label1 = new System.Windows.Forms.Label();
  134. this.groupBox3 = new System.Windows.Forms.GroupBox();
  135. this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
  136. this.label6 = new System.Windows.Forms.Label();
  137. this.radioButton4 = new System.Windows.Forms.RadioButton();
  138. this.radioButton3 = new System.Windows.Forms.RadioButton();
  139. this.panel2 = new System.Windows.Forms.Panel();
  140. this.label5 = new System.Windows.Forms.Label();
  141. this.label4 = new System.Windows.Forms.Label();
  142. this.groupBox4 = new System.Windows.Forms.GroupBox();
  143. this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
  144. this.label13 = new System.Windows.Forms.Label();
  145. this.comboBox1 = new System.Windows.Forms.ComboBox();
  146. this.panel4 = new System.Windows.Forms.Panel();
  147. this.label12 = new System.Windows.Forms.Label();
  148. this.label11 = new System.Windows.Forms.Label();
  149. this.radioButton8 = new System.Windows.Forms.RadioButton();
  150. this.radioButton6 = new System.Windows.Forms.RadioButton();
  151. this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
  152. this.panel3 = new System.Windows.Forms.Panel();
  153. this.label10 = new System.Windows.Forms.Label();
  154. this.label9 = new System.Windows.Forms.Label();
  155. this.label7 = new System.Windows.Forms.Label();
  156. this.panel5 = new System.Windows.Forms.Panel();
  157. this.radioButton7 = new System.Windows.Forms.RadioButton();
  158. this.radioButton5 = new System.Windows.Forms.RadioButton();
  159. this.label8 = new System.Windows.Forms.Label();
  160. this.groupBox1.SuspendLayout();
  161. this.groupBox2.SuspendLayout();
  162. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
  163. this.groupBox3.SuspendLayout();
  164. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
  165. this.groupBox4.SuspendLayout();
  166. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
  167. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
  168. this.panel5.SuspendLayout();
  169. this.SuspendLayout();
  170. //
  171. // groupBox1
  172. //
  173. this.groupBox1.Controls.Add(this.button2);
  174. this.groupBox1.Controls.Add(this.button1);
  175. this.groupBox1.Location = new System.Drawing.Point(13, 13);
  176. this.groupBox1.Name = "groupBox1";
  177. this.groupBox1.Size = new System.Drawing.Size(509, 58);
  178. this.groupBox1.TabIndex = 0;
  179. this.groupBox1.TabStop = false;
  180. this.groupBox1.Text = "操作";
  181. //
  182. // button2
  183. //
  184. this.button2.Location = new System.Drawing.Point(401, 20);
  185. this.button2.Name = "button2";
  186. this.button2.Size = new System.Drawing.Size(75, 23);
  187. this.button2.TabIndex = 1;
  188. this.button2.Text = "关闭";
  189. this.button2.UseVisualStyleBackColor = true;
  190. this.button2.Click += new System.EventHandler(this.button2_Click);
  191. //
  192. // button1
  193. //
  194. this.button1.Location = new System.Drawing.Point(283, 20);
  195. this.button1.Name = "button1";
  196. this.button1.Size = new System.Drawing.Size(75, 23);
  197. this.button1.TabIndex = 0;
  198. this.button1.Text = "应用";
  199. this.button1.UseVisualStyleBackColor = true;
  200. this.button1.Click += new System.EventHandler(this.button1_Click);
  201. //
  202. // groupBox2
  203. //
  204. this.groupBox2.Controls.Add(this.numericUpDown1);
  205. this.groupBox2.Controls.Add(this.label3);
  206. this.groupBox2.Controls.Add(this.radioButton2);
  207. this.groupBox2.Controls.Add(this.radioButton1);
  208. this.groupBox2.Controls.Add(this.panel1);
  209. this.groupBox2.Controls.Add(this.label2);
  210. this.groupBox2.Controls.Add(this.label1);
  211. this.groupBox2.Location = new System.Drawing.Point(13, 78);
  212. this.groupBox2.Name = "groupBox2";
  213. this.groupBox2.Size = new System.Drawing.Size(509, 79);
  214. this.groupBox2.TabIndex = 1;
  215. this.groupBox2.TabStop = false;
  216. this.groupBox2.Text = "辅助线设置";
  217. //
  218. // numericUpDown1
  219. //
  220. this.numericUpDown1.Location = new System.Drawing.Point(328, 21);
  221. this.numericUpDown1.Name = "numericUpDown1";
  222. this.numericUpDown1.Size = new System.Drawing.Size(161, 21);
  223. this.numericUpDown1.TabIndex = 6;
  224. this.numericUpDown1.Value = new decimal(new int[] {
  225. 1,
  226. 0,
  227. 0,
  228. 0});
  229. //
  230. // label3
  231. //
  232. this.label3.AutoSize = true;
  233. this.label3.Location = new System.Drawing.Point(280, 24);
  234. this.label3.Name = "label3";
  235. this.label3.Size = new System.Drawing.Size(41, 12);
  236. this.label3.TabIndex = 5;
  237. this.label3.Text = "线宽:";
  238. //
  239. // radioButton2
  240. //
  241. this.radioButton2.AutoSize = true;
  242. this.radioButton2.Location = new System.Drawing.Point(141, 51);
  243. this.radioButton2.Name = "radioButton2";
  244. this.radioButton2.Size = new System.Drawing.Size(35, 16);
  245. this.radioButton2.TabIndex = 4;
  246. this.radioButton2.TabStop = true;
  247. this.radioButton2.Text = "否";
  248. this.radioButton2.UseVisualStyleBackColor = true;
  249. //
  250. // radioButton1
  251. //
  252. this.radioButton1.AutoSize = true;
  253. this.radioButton1.Location = new System.Drawing.Point(65, 51);
  254. this.radioButton1.Name = "radioButton1";
  255. this.radioButton1.Size = new System.Drawing.Size(35, 16);
  256. this.radioButton1.TabIndex = 3;
  257. this.radioButton1.TabStop = true;
  258. this.radioButton1.Text = "是";
  259. this.radioButton1.UseVisualStyleBackColor = true;
  260. //
  261. // panel1
  262. //
  263. this.panel1.BackColor = System.Drawing.SystemColors.ButtonHighlight;
  264. this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  265. this.panel1.Location = new System.Drawing.Point(64, 20);
  266. this.panel1.Name = "panel1";
  267. this.panel1.Size = new System.Drawing.Size(161, 21);
  268. this.panel1.TabIndex = 2;
  269. this.panel1.Click += new System.EventHandler(this.panel1_Click);
  270. //
  271. // label2
  272. //
  273. this.label2.AutoSize = true;
  274. this.label2.Location = new System.Drawing.Point(17, 51);
  275. this.label2.Name = "label2";
  276. this.label2.Size = new System.Drawing.Size(41, 12);
  277. this.label2.TabIndex = 1;
  278. this.label2.Text = "显示:";
  279. //
  280. // label1
  281. //
  282. this.label1.AutoSize = true;
  283. this.label1.Location = new System.Drawing.Point(17, 23);
  284. this.label1.Name = "label1";
  285. this.label1.Size = new System.Drawing.Size(41, 12);
  286. this.label1.TabIndex = 0;
  287. this.label1.Text = "颜色:";
  288. //
  289. // groupBox3
  290. //
  291. this.groupBox3.Controls.Add(this.numericUpDown2);
  292. this.groupBox3.Controls.Add(this.label6);
  293. this.groupBox3.Controls.Add(this.radioButton4);
  294. this.groupBox3.Controls.Add(this.radioButton3);
  295. this.groupBox3.Controls.Add(this.panel2);
  296. this.groupBox3.Controls.Add(this.label5);
  297. this.groupBox3.Controls.Add(this.label4);
  298. this.groupBox3.Location = new System.Drawing.Point(13, 164);
  299. this.groupBox3.Name = "groupBox3";
  300. this.groupBox3.Size = new System.Drawing.Size(509, 79);
  301. this.groupBox3.TabIndex = 2;
  302. this.groupBox3.TabStop = false;
  303. this.groupBox3.Text = "连接线设置";
  304. //
  305. // numericUpDown2
  306. //
  307. this.numericUpDown2.Location = new System.Drawing.Point(328, 23);
  308. this.numericUpDown2.Name = "numericUpDown2";
  309. this.numericUpDown2.Size = new System.Drawing.Size(161, 21);
  310. this.numericUpDown2.TabIndex = 6;
  311. this.numericUpDown2.Value = new decimal(new int[] {
  312. 1,
  313. 0,
  314. 0,
  315. 0});
  316. //
  317. // label6
  318. //
  319. this.label6.AutoSize = true;
  320. this.label6.Location = new System.Drawing.Point(283, 25);
  321. this.label6.Name = "label6";
  322. this.label6.Size = new System.Drawing.Size(41, 12);
  323. this.label6.TabIndex = 5;
  324. this.label6.Text = "线宽:";
  325. //
  326. // radioButton4
  327. //
  328. this.radioButton4.AutoSize = true;
  329. this.radioButton4.Location = new System.Drawing.Point(141, 50);
  330. this.radioButton4.Name = "radioButton4";
  331. this.radioButton4.Size = new System.Drawing.Size(35, 16);
  332. this.radioButton4.TabIndex = 4;
  333. this.radioButton4.TabStop = true;
  334. this.radioButton4.Text = "否";
  335. this.radioButton4.UseVisualStyleBackColor = true;
  336. //
  337. // radioButton3
  338. //
  339. this.radioButton3.AutoSize = true;
  340. this.radioButton3.Location = new System.Drawing.Point(64, 50);
  341. this.radioButton3.Name = "radioButton3";
  342. this.radioButton3.Size = new System.Drawing.Size(35, 16);
  343. this.radioButton3.TabIndex = 3;
  344. this.radioButton3.TabStop = true;
  345. this.radioButton3.Text = "是";
  346. this.radioButton3.UseVisualStyleBackColor = true;
  347. //
  348. // panel2
  349. //
  350. this.panel2.BackColor = System.Drawing.SystemColors.ButtonHighlight;
  351. this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  352. this.panel2.Location = new System.Drawing.Point(64, 20);
  353. this.panel2.Name = "panel2";
  354. this.panel2.Size = new System.Drawing.Size(161, 21);
  355. this.panel2.TabIndex = 2;
  356. this.panel2.Click += new System.EventHandler(this.panel2_Click);
  357. //
  358. // label5
  359. //
  360. this.label5.AutoSize = true;
  361. this.label5.Location = new System.Drawing.Point(19, 53);
  362. this.label5.Name = "label5";
  363. this.label5.Size = new System.Drawing.Size(41, 12);
  364. this.label5.TabIndex = 1;
  365. this.label5.Text = "显示:";
  366. //
  367. // label4
  368. //
  369. this.label4.AutoSize = true;
  370. this.label4.Location = new System.Drawing.Point(19, 25);
  371. this.label4.Name = "label4";
  372. this.label4.Size = new System.Drawing.Size(41, 12);
  373. this.label4.TabIndex = 0;
  374. this.label4.Text = "颜色:";
  375. //
  376. // groupBox4
  377. //
  378. this.groupBox4.Controls.Add(this.numericUpDown4);
  379. this.groupBox4.Controls.Add(this.label13);
  380. this.groupBox4.Controls.Add(this.comboBox1);
  381. this.groupBox4.Controls.Add(this.panel4);
  382. this.groupBox4.Controls.Add(this.label12);
  383. this.groupBox4.Controls.Add(this.label11);
  384. this.groupBox4.Controls.Add(this.radioButton8);
  385. this.groupBox4.Controls.Add(this.radioButton6);
  386. this.groupBox4.Controls.Add(this.numericUpDown3);
  387. this.groupBox4.Controls.Add(this.panel3);
  388. this.groupBox4.Controls.Add(this.label10);
  389. this.groupBox4.Controls.Add(this.label9);
  390. this.groupBox4.Controls.Add(this.label7);
  391. this.groupBox4.Controls.Add(this.panel5);
  392. this.groupBox4.Location = new System.Drawing.Point(13, 250);
  393. this.groupBox4.Name = "groupBox4";
  394. this.groupBox4.Size = new System.Drawing.Size(509, 100);
  395. this.groupBox4.TabIndex = 3;
  396. this.groupBox4.TabStop = false;
  397. this.groupBox4.Text = "测量线设置";
  398. //
  399. // numericUpDown4
  400. //
  401. this.numericUpDown4.Location = new System.Drawing.Point(431, 74);
  402. this.numericUpDown4.Name = "numericUpDown4";
  403. this.numericUpDown4.Size = new System.Drawing.Size(58, 21);
  404. this.numericUpDown4.TabIndex = 15;
  405. this.numericUpDown4.Value = new decimal(new int[] {
  406. 12,
  407. 0,
  408. 0,
  409. 0});
  410. //
  411. // label13
  412. //
  413. this.label13.AutoSize = true;
  414. this.label13.Location = new System.Drawing.Point(396, 78);
  415. this.label13.Name = "label13";
  416. this.label13.Size = new System.Drawing.Size(41, 12);
  417. this.label13.TabIndex = 14;
  418. this.label13.Text = "字号:";
  419. //
  420. // comboBox1
  421. //
  422. this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  423. this.comboBox1.FormattingEnabled = true;
  424. this.comboBox1.Location = new System.Drawing.Point(328, 74);
  425. this.comboBox1.Name = "comboBox1";
  426. this.comboBox1.Size = new System.Drawing.Size(57, 20);
  427. this.comboBox1.TabIndex = 13;
  428. //
  429. // panel4
  430. //
  431. this.panel4.BackColor = System.Drawing.SystemColors.ButtonHighlight;
  432. this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  433. this.panel4.Location = new System.Drawing.Point(328, 46);
  434. this.panel4.Name = "panel4";
  435. this.panel4.Size = new System.Drawing.Size(161, 23);
  436. this.panel4.TabIndex = 12;
  437. this.panel4.Click += new System.EventHandler(this.panel4_Click);
  438. //
  439. // label12
  440. //
  441. this.label12.AutoSize = true;
  442. this.label12.Location = new System.Drawing.Point(283, 77);
  443. this.label12.Name = "label12";
  444. this.label12.Size = new System.Drawing.Size(41, 12);
  445. this.label12.TabIndex = 11;
  446. this.label12.Text = "字体:";
  447. //
  448. // label11
  449. //
  450. this.label11.AutoSize = true;
  451. this.label11.Location = new System.Drawing.Point(258, 51);
  452. this.label11.Name = "label11";
  453. this.label11.Size = new System.Drawing.Size(65, 12);
  454. this.label11.TabIndex = 10;
  455. this.label11.Text = "字体颜色:";
  456. //
  457. // radioButton8
  458. //
  459. this.radioButton8.AutoSize = true;
  460. this.radioButton8.Location = new System.Drawing.Point(171, 75);
  461. this.radioButton8.Name = "radioButton8";
  462. this.radioButton8.Size = new System.Drawing.Size(35, 16);
  463. this.radioButton8.TabIndex = 9;
  464. this.radioButton8.TabStop = true;
  465. this.radioButton8.Text = "否";
  466. this.radioButton8.UseVisualStyleBackColor = true;
  467. //
  468. // radioButton6
  469. //
  470. this.radioButton6.AutoSize = true;
  471. this.radioButton6.Checked = true;
  472. this.radioButton6.Location = new System.Drawing.Point(118, 75);
  473. this.radioButton6.Name = "radioButton6";
  474. this.radioButton6.Size = new System.Drawing.Size(35, 16);
  475. this.radioButton6.TabIndex = 7;
  476. this.radioButton6.TabStop = true;
  477. this.radioButton6.Text = "是";
  478. this.radioButton6.UseVisualStyleBackColor = true;
  479. //
  480. // numericUpDown3
  481. //
  482. this.numericUpDown3.Location = new System.Drawing.Point(328, 19);
  483. this.numericUpDown3.Name = "numericUpDown3";
  484. this.numericUpDown3.Size = new System.Drawing.Size(161, 21);
  485. this.numericUpDown3.TabIndex = 5;
  486. this.numericUpDown3.Value = new decimal(new int[] {
  487. 1,
  488. 0,
  489. 0,
  490. 0});
  491. //
  492. // panel3
  493. //
  494. this.panel3.BackColor = System.Drawing.SystemColors.ButtonHighlight;
  495. this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  496. this.panel3.Location = new System.Drawing.Point(64, 17);
  497. this.panel3.Name = "panel3";
  498. this.panel3.Size = new System.Drawing.Size(161, 21);
  499. this.panel3.TabIndex = 4;
  500. this.panel3.Click += new System.EventHandler(this.panel3_Click);
  501. //
  502. // label10
  503. //
  504. this.label10.AutoSize = true;
  505. this.label10.Location = new System.Drawing.Point(282, 23);
  506. this.label10.Name = "label10";
  507. this.label10.Size = new System.Drawing.Size(41, 12);
  508. this.label10.TabIndex = 3;
  509. this.label10.Text = "线宽:";
  510. //
  511. // label9
  512. //
  513. this.label9.AutoSize = true;
  514. this.label9.Location = new System.Drawing.Point(19, 76);
  515. this.label9.Name = "label9";
  516. this.label9.Size = new System.Drawing.Size(101, 12);
  517. this.label9.TabIndex = 2;
  518. this.label9.Text = "显示测量线长度:";
  519. //
  520. // label7
  521. //
  522. this.label7.AutoSize = true;
  523. this.label7.Location = new System.Drawing.Point(19, 21);
  524. this.label7.Name = "label7";
  525. this.label7.Size = new System.Drawing.Size(41, 12);
  526. this.label7.TabIndex = 0;
  527. this.label7.Text = "颜色:";
  528. //
  529. // panel5
  530. //
  531. this.panel5.Controls.Add(this.radioButton7);
  532. this.panel5.Controls.Add(this.radioButton5);
  533. this.panel5.Controls.Add(this.label8);
  534. this.panel5.Location = new System.Drawing.Point(14, 41);
  535. this.panel5.Name = "panel5";
  536. this.panel5.Size = new System.Drawing.Size(211, 28);
  537. this.panel5.TabIndex = 16;
  538. //
  539. // radioButton7
  540. //
  541. this.radioButton7.AutoSize = true;
  542. this.radioButton7.Location = new System.Drawing.Point(157, 8);
  543. this.radioButton7.Name = "radioButton7";
  544. this.radioButton7.Size = new System.Drawing.Size(35, 16);
  545. this.radioButton7.TabIndex = 2;
  546. this.radioButton7.TabStop = true;
  547. this.radioButton7.Text = "否";
  548. this.radioButton7.UseVisualStyleBackColor = true;
  549. //
  550. // radioButton5
  551. //
  552. this.radioButton5.AutoSize = true;
  553. this.radioButton5.Checked = true;
  554. this.radioButton5.Location = new System.Drawing.Point(104, 8);
  555. this.radioButton5.Name = "radioButton5";
  556. this.radioButton5.Size = new System.Drawing.Size(35, 16);
  557. this.radioButton5.TabIndex = 1;
  558. this.radioButton5.TabStop = true;
  559. this.radioButton5.Text = "是";
  560. this.radioButton5.UseVisualStyleBackColor = true;
  561. //
  562. // label8
  563. //
  564. this.label8.AutoSize = true;
  565. this.label8.Location = new System.Drawing.Point(5, 10);
  566. this.label8.Name = "label8";
  567. this.label8.Size = new System.Drawing.Size(101, 12);
  568. this.label8.TabIndex = 0;
  569. this.label8.Text = "显示测量线距离:";
  570. //
  571. // LabelWorkTypeStyleDialog
  572. //
  573. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  574. this.ClientSize = new System.Drawing.Size(533, 367);
  575. this.Controls.Add(this.groupBox4);
  576. this.Controls.Add(this.groupBox3);
  577. this.Controls.Add(this.groupBox2);
  578. this.Controls.Add(this.groupBox1);
  579. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  580. this.MaximizeBox = false;
  581. this.MinimizeBox = false;
  582. this.Name = "LabelWorkTypeStyleDialog";
  583. this.Text = "工型设置";
  584. this.Controls.SetChildIndex(this.groupBox1, 0);
  585. this.Controls.SetChildIndex(this.groupBox2, 0);
  586. this.Controls.SetChildIndex(this.groupBox3, 0);
  587. this.Controls.SetChildIndex(this.groupBox4, 0);
  588. this.groupBox1.ResumeLayout(false);
  589. this.groupBox2.ResumeLayout(false);
  590. this.groupBox2.PerformLayout();
  591. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
  592. this.groupBox3.ResumeLayout(false);
  593. this.groupBox3.PerformLayout();
  594. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
  595. this.groupBox4.ResumeLayout(false);
  596. this.groupBox4.PerformLayout();
  597. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
  598. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
  599. this.panel5.ResumeLayout(false);
  600. this.panel5.PerformLayout();
  601. this.ResumeLayout(false);
  602. }
  603. /// <summary>
  604. /// 初始化颜色组件
  605. /// </summary>
  606. private void InitializeColorForm()
  607. {
  608. this.colorsFormfzx = new ColorsForm();
  609. this.colorsFormfzx.StartPosition = FormStartPosition.CenterScreen;
  610. this.colorsFormfzx.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  611. this.colorsFormljx = new ColorsForm();
  612. this.colorsFormljx.StartPosition = FormStartPosition.CenterScreen;
  613. this.colorsFormljx.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  614. this.colorsFormclx = new ColorsForm();
  615. this.colorsFormclx.StartPosition = FormStartPosition.CenterScreen;
  616. this.colorsFormclx.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  617. this.colorsFormfont = new ColorsForm();
  618. this.colorsFormfont.StartPosition = FormStartPosition.CenterScreen;
  619. this.colorsFormfont.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  620. }
  621. /// <summary>
  622. /// 初始化当前控件属性
  623. /// </summary>
  624. private void InitializeWorkTypeModel()
  625. {
  626. this.fontsItems.Clear();
  627. //绑定字体数据
  628. System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
  629. foreach (FontFamily fontFamily in fonts.Families)
  630. {
  631. fontsItems.Add(fontFamily.Name);
  632. }
  633. this.comboBox1.DataSource = fontsItems;
  634. workTypeModel = (WorkTypeStyleModel)this.parentStyleModel;
  635. //辅助线
  636. this.panel1.BackColor = Color.FromArgb(workTypeModel.guideColour);
  637. this.numericUpDown1.Value = workTypeModel.guideLineWidth;
  638. if (workTypeModel.guideShowFlag == 0)
  639. {
  640. this.radioButton2.Checked = true;
  641. }
  642. else
  643. {
  644. this.radioButton1.Checked = true;
  645. }
  646. //连接线
  647. this.panel2.BackColor = Color.FromArgb(workTypeModel.connectColour);
  648. this.numericUpDown2.Value = workTypeModel.connectLineWidth;
  649. if (workTypeModel.connectShowFlag == 0)
  650. {
  651. this.radioButton4.Checked = true;
  652. }
  653. else
  654. {
  655. this.radioButton3.Checked = true;
  656. }
  657. //测量线
  658. this.panel3.BackColor = Color.FromArgb(workTypeModel.measureColour);
  659. this.numericUpDown3.Value = workTypeModel.measureLineWidth;
  660. if (workTypeModel.measureRangeShowFlag == 0)
  661. {
  662. this.radioButton7.Checked = true;
  663. }
  664. else
  665. {
  666. this.radioButton5.Checked = true;
  667. }
  668. if (workTypeModel.measureLengthShowFlag == 0)
  669. {
  670. this.radioButton8.Checked = true;
  671. }
  672. else
  673. {
  674. this.radioButton6.Checked = true;
  675. }
  676. //文字
  677. this.panel4.BackColor = Color.FromArgb(workTypeModel.fontColour);
  678. this.comboBox1.Text = workTypeModel.font;
  679. this.numericUpDown4.Value = workTypeModel.fontSize;
  680. }
  681. /// <summary>
  682. /// 关闭
  683. /// </summary>
  684. /// <param name="sender"></param>
  685. /// <param name="e"></param>
  686. private void button2_Click(object sender, EventArgs e)
  687. {
  688. this.Close();
  689. }
  690. /// <summary>
  691. /// 调色板回调函数
  692. /// </summary>
  693. /// <param name="sender"></param>
  694. /// <param name="ce"></param>
  695. private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
  696. {
  697. }
  698. /// <summary>
  699. /// 辅助线Panel被点击
  700. /// </summary>
  701. /// <param name="sender"></param>
  702. /// <param name="e"></param>
  703. private void panel1_Click(object sender, EventArgs e)
  704. {
  705. this.colorsFormfzx.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor);
  706. this.colorsFormfzx.setSaveBtn_Click(new System.EventHandler(this.fzxColorChanged));
  707. this.colorsFormfzx.ShowDialog();
  708. }
  709. /// <summary>
  710. /// 辅助线Panel的调色板颜色改变
  711. /// </summary>
  712. /// <param name="sender"></param>
  713. /// <param name="e"></param>
  714. private void fzxColorChanged(object sender, EventArgs e)
  715. {
  716. this.panel1.BackColor = this.colorsFormfzx.UserPrimaryColor.ToColor();
  717. this.colorsFormfzx.Close();
  718. }
  719. /// <summary>
  720. /// 连接线Panel被点击
  721. /// </summary>
  722. /// <param name="sender"></param>
  723. /// <param name="e"></param>
  724. private void panel2_Click(object sender, EventArgs e)
  725. {
  726. this.colorsFormljx.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
  727. this.colorsFormljx.setSaveBtn_Click(new System.EventHandler(this.ljxColorChanged));
  728. this.colorsFormljx.ShowDialog();
  729. }
  730. /// <summary>
  731. /// 连接线Panel的调色板颜色改变
  732. /// </summary>
  733. /// <param name="sender"></param>
  734. /// <param name="e"></param>
  735. private void ljxColorChanged(object sender, EventArgs e)
  736. {
  737. this.panel2.BackColor = this.colorsFormljx.UserPrimaryColor.ToColor();
  738. this.colorsFormljx.Close();
  739. }
  740. /// <summary>
  741. /// 测量线Panel被点击
  742. /// </summary>
  743. /// <param name="sender"></param>
  744. /// <param name="e"></param>
  745. private void panel3_Click(object sender, EventArgs e)
  746. {
  747. this.colorsFormclx.UserPrimaryColor = ColorBgra.FromColor(this.panel3.BackColor);
  748. this.colorsFormclx.setSaveBtn_Click(new System.EventHandler(this.clxColorChanged));
  749. this.colorsFormclx.ShowDialog();
  750. }
  751. /// <summary>
  752. /// 测量线Panel的调色板颜色改变
  753. /// </summary>
  754. /// <param name="sender"></param>
  755. /// <param name="e"></param>
  756. private void clxColorChanged(object sender, EventArgs e)
  757. {
  758. this.panel3.BackColor = this.colorsFormclx.UserPrimaryColor.ToColor();
  759. this.colorsFormclx.Close();
  760. }
  761. /// <summary>
  762. /// 字体颜色Panel被点击
  763. /// </summary>
  764. /// <param name="sender"></param>
  765. /// <param name="e"></param>
  766. private void panel4_Click(object sender, EventArgs e)
  767. {
  768. this.colorsFormfont.UserPrimaryColor = ColorBgra.FromColor(this.panel4.BackColor);
  769. this.colorsFormfont.setSaveBtn_Click(new System.EventHandler(this.fontColorChanged));
  770. this.colorsFormfont.ShowDialog();
  771. }
  772. /// <summary>
  773. /// 字体颜色Panel的调色板颜色改变
  774. /// </summary>
  775. /// <param name="sender"></param>
  776. /// <param name="e"></param>
  777. private void fontColorChanged(object sender, EventArgs e)
  778. {
  779. this.panel4.BackColor = this.colorsFormfont.UserPrimaryColor.ToColor();
  780. this.colorsFormfont.Close();
  781. }
  782. /// <summary>
  783. /// 应用
  784. /// </summary>
  785. /// <param name="sender"></param>
  786. /// <param name="e"></param>
  787. private void button1_Click(object sender, EventArgs e)
  788. {
  789. UpDownBase fzxLineWidthup = (UpDownBase)this.numericUpDown1;
  790. if (string.IsNullOrEmpty(fzxLineWidthup.Text))
  791. {
  792. this.numericUpDown1.Value = 1;
  793. }
  794. UpDownBase ljxLineWidthup = (UpDownBase)this.numericUpDown2;
  795. if (string.IsNullOrEmpty(ljxLineWidthup.Text))
  796. {
  797. this.numericUpDown2.Value = 1;
  798. }
  799. UpDownBase clxLineWidthup = (UpDownBase)this.numericUpDown3;
  800. if (string.IsNullOrEmpty(clxLineWidthup.Text))
  801. {
  802. this.numericUpDown3.Value = 1;
  803. }
  804. UpDownBase fontSizeWidthup = (UpDownBase)this.numericUpDown4;
  805. if (string.IsNullOrEmpty(fontSizeWidthup.Text))
  806. {
  807. this.numericUpDown4.Value = 1;
  808. }
  809. workTypeModel = new WorkTypeStyleModel();
  810. //辅助线
  811. workTypeModel.guideColour = Convert.ToInt32(this.panel1.BackColor.ToArgb());
  812. workTypeModel.guideLineWidth = Convert.ToInt32(this.numericUpDown1.Value);
  813. if (this.radioButton2.Checked)
  814. {
  815. workTypeModel.guideShowFlag = 0;
  816. }
  817. else
  818. {
  819. workTypeModel.guideShowFlag = 1;
  820. }
  821. //连接线
  822. workTypeModel.connectColour = Convert.ToInt32(this.panel2.BackColor.ToArgb());
  823. workTypeModel.connectLineWidth = Convert.ToInt32(this.numericUpDown2.Value);
  824. if (this.radioButton4.Checked)
  825. {
  826. workTypeModel.connectShowFlag = 0;
  827. }
  828. else
  829. {
  830. workTypeModel.connectShowFlag = 1;
  831. }
  832. //测量线
  833. workTypeModel.measureColour = Convert.ToInt32(this.panel3.BackColor.ToArgb());
  834. workTypeModel.measureLineWidth = Convert.ToInt32(this.numericUpDown3.Value);
  835. if (this.radioButton7.Checked)
  836. {
  837. workTypeModel.measureRangeShowFlag = 0;
  838. }
  839. else
  840. {
  841. workTypeModel.measureRangeShowFlag = 1;
  842. }
  843. if (this.radioButton8.Checked)
  844. {
  845. workTypeModel.measureLengthShowFlag = 0;
  846. }
  847. else
  848. {
  849. workTypeModel.measureLengthShowFlag = 1;
  850. }
  851. //文字
  852. workTypeModel.fontColour = Convert.ToInt32(this.panel4.BackColor.ToArgb());
  853. workTypeModel.font = this.comboBox1.Text;
  854. workTypeModel.fontSize = Convert.ToInt32(this.numericUpDown4.Value);
  855. DrawWorkType drawWorkType = (DrawWorkType)this.drawObject;
  856. drawWorkType.labelWorkTypeStyleMode = workTypeModel;
  857. this.appWorkspace.ActiveDocumentWorkspace.Refresh();
  858. this.Close();
  859. }
  860. }
  861. }