LabelWorkTypeStyleDialog.cs 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  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.Maximum = new decimal(new int[] {
  403. 49000,
  404. 0,
  405. 0,
  406. 0});
  407. this.numericUpDown4.Minimum = new decimal(new int[] {
  408. 1,
  409. 0,
  410. 0,
  411. 0});
  412. this.numericUpDown4.Name = "numericUpDown4";
  413. this.numericUpDown4.Size = new System.Drawing.Size(58, 21);
  414. this.numericUpDown4.TabIndex = 15;
  415. this.numericUpDown4.Value = new decimal(new int[] {
  416. 12,
  417. 0,
  418. 0,
  419. 0});
  420. //
  421. // label13
  422. //
  423. this.label13.AutoSize = true;
  424. this.label13.Location = new System.Drawing.Point(396, 78);
  425. this.label13.Name = "label13";
  426. this.label13.Size = new System.Drawing.Size(41, 12);
  427. this.label13.TabIndex = 14;
  428. this.label13.Text = "字号:";
  429. //
  430. // comboBox1
  431. //
  432. this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  433. this.comboBox1.FormattingEnabled = true;
  434. this.comboBox1.Location = new System.Drawing.Point(328, 74);
  435. this.comboBox1.Name = "comboBox1";
  436. this.comboBox1.Size = new System.Drawing.Size(57, 20);
  437. this.comboBox1.TabIndex = 13;
  438. //
  439. // panel4
  440. //
  441. this.panel4.BackColor = System.Drawing.SystemColors.ButtonHighlight;
  442. this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  443. this.panel4.Location = new System.Drawing.Point(328, 46);
  444. this.panel4.Name = "panel4";
  445. this.panel4.Size = new System.Drawing.Size(161, 23);
  446. this.panel4.TabIndex = 12;
  447. this.panel4.Click += new System.EventHandler(this.panel4_Click);
  448. //
  449. // label12
  450. //
  451. this.label12.AutoSize = true;
  452. this.label12.Location = new System.Drawing.Point(283, 77);
  453. this.label12.Name = "label12";
  454. this.label12.Size = new System.Drawing.Size(41, 12);
  455. this.label12.TabIndex = 11;
  456. this.label12.Text = "字体:";
  457. //
  458. // label11
  459. //
  460. this.label11.AutoSize = true;
  461. this.label11.Location = new System.Drawing.Point(258, 51);
  462. this.label11.Name = "label11";
  463. this.label11.Size = new System.Drawing.Size(65, 12);
  464. this.label11.TabIndex = 10;
  465. this.label11.Text = "字体颜色:";
  466. //
  467. // radioButton8
  468. //
  469. this.radioButton8.AutoSize = true;
  470. this.radioButton8.Location = new System.Drawing.Point(171, 75);
  471. this.radioButton8.Name = "radioButton8";
  472. this.radioButton8.Size = new System.Drawing.Size(35, 16);
  473. this.radioButton8.TabIndex = 9;
  474. this.radioButton8.TabStop = true;
  475. this.radioButton8.Text = "否";
  476. this.radioButton8.UseVisualStyleBackColor = true;
  477. //
  478. // radioButton6
  479. //
  480. this.radioButton6.AutoSize = true;
  481. this.radioButton6.Checked = true;
  482. this.radioButton6.Location = new System.Drawing.Point(118, 75);
  483. this.radioButton6.Name = "radioButton6";
  484. this.radioButton6.Size = new System.Drawing.Size(35, 16);
  485. this.radioButton6.TabIndex = 7;
  486. this.radioButton6.TabStop = true;
  487. this.radioButton6.Text = "是";
  488. this.radioButton6.UseVisualStyleBackColor = true;
  489. //
  490. // numericUpDown3
  491. //
  492. this.numericUpDown3.Location = new System.Drawing.Point(328, 19);
  493. this.numericUpDown3.Name = "numericUpDown3";
  494. this.numericUpDown3.Size = new System.Drawing.Size(161, 21);
  495. this.numericUpDown3.TabIndex = 5;
  496. this.numericUpDown3.Value = new decimal(new int[] {
  497. 1,
  498. 0,
  499. 0,
  500. 0});
  501. //
  502. // panel3
  503. //
  504. this.panel3.BackColor = System.Drawing.SystemColors.ButtonHighlight;
  505. this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  506. this.panel3.Location = new System.Drawing.Point(64, 17);
  507. this.panel3.Name = "panel3";
  508. this.panel3.Size = new System.Drawing.Size(161, 21);
  509. this.panel3.TabIndex = 4;
  510. this.panel3.Click += new System.EventHandler(this.panel3_Click);
  511. //
  512. // label10
  513. //
  514. this.label10.AutoSize = true;
  515. this.label10.Location = new System.Drawing.Point(282, 23);
  516. this.label10.Name = "label10";
  517. this.label10.Size = new System.Drawing.Size(41, 12);
  518. this.label10.TabIndex = 3;
  519. this.label10.Text = "线宽:";
  520. //
  521. // label9
  522. //
  523. this.label9.AutoSize = true;
  524. this.label9.Location = new System.Drawing.Point(19, 76);
  525. this.label9.Name = "label9";
  526. this.label9.Size = new System.Drawing.Size(101, 12);
  527. this.label9.TabIndex = 2;
  528. this.label9.Text = "显示测量线长度:";
  529. //
  530. // label7
  531. //
  532. this.label7.AutoSize = true;
  533. this.label7.Location = new System.Drawing.Point(19, 21);
  534. this.label7.Name = "label7";
  535. this.label7.Size = new System.Drawing.Size(41, 12);
  536. this.label7.TabIndex = 0;
  537. this.label7.Text = "颜色:";
  538. //
  539. // panel5
  540. //
  541. this.panel5.Controls.Add(this.radioButton7);
  542. this.panel5.Controls.Add(this.radioButton5);
  543. this.panel5.Controls.Add(this.label8);
  544. this.panel5.Location = new System.Drawing.Point(14, 41);
  545. this.panel5.Name = "panel5";
  546. this.panel5.Size = new System.Drawing.Size(211, 28);
  547. this.panel5.TabIndex = 16;
  548. //
  549. // radioButton7
  550. //
  551. this.radioButton7.AutoSize = true;
  552. this.radioButton7.Location = new System.Drawing.Point(157, 8);
  553. this.radioButton7.Name = "radioButton7";
  554. this.radioButton7.Size = new System.Drawing.Size(35, 16);
  555. this.radioButton7.TabIndex = 2;
  556. this.radioButton7.TabStop = true;
  557. this.radioButton7.Text = "否";
  558. this.radioButton7.UseVisualStyleBackColor = true;
  559. //
  560. // radioButton5
  561. //
  562. this.radioButton5.AutoSize = true;
  563. this.radioButton5.Checked = true;
  564. this.radioButton5.Location = new System.Drawing.Point(104, 8);
  565. this.radioButton5.Name = "radioButton5";
  566. this.radioButton5.Size = new System.Drawing.Size(35, 16);
  567. this.radioButton5.TabIndex = 1;
  568. this.radioButton5.TabStop = true;
  569. this.radioButton5.Text = "是";
  570. this.radioButton5.UseVisualStyleBackColor = true;
  571. //
  572. // label8
  573. //
  574. this.label8.AutoSize = true;
  575. this.label8.Location = new System.Drawing.Point(5, 10);
  576. this.label8.Name = "label8";
  577. this.label8.Size = new System.Drawing.Size(101, 12);
  578. this.label8.TabIndex = 0;
  579. this.label8.Text = "显示测量线距离:";
  580. //
  581. // LabelWorkTypeStyleDialog
  582. //
  583. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  584. this.ClientSize = new System.Drawing.Size(533, 367);
  585. this.Controls.Add(this.groupBox4);
  586. this.Controls.Add(this.groupBox3);
  587. this.Controls.Add(this.groupBox2);
  588. this.Controls.Add(this.groupBox1);
  589. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  590. this.MaximizeBox = false;
  591. this.MinimizeBox = false;
  592. this.Name = "LabelWorkTypeStyleDialog";
  593. this.Text = "工型设置";
  594. this.Controls.SetChildIndex(this.groupBox1, 0);
  595. this.Controls.SetChildIndex(this.groupBox2, 0);
  596. this.Controls.SetChildIndex(this.groupBox3, 0);
  597. this.Controls.SetChildIndex(this.groupBox4, 0);
  598. this.groupBox1.ResumeLayout(false);
  599. this.groupBox2.ResumeLayout(false);
  600. this.groupBox2.PerformLayout();
  601. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
  602. this.groupBox3.ResumeLayout(false);
  603. this.groupBox3.PerformLayout();
  604. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
  605. this.groupBox4.ResumeLayout(false);
  606. this.groupBox4.PerformLayout();
  607. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
  608. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
  609. this.panel5.ResumeLayout(false);
  610. this.panel5.PerformLayout();
  611. this.ResumeLayout(false);
  612. }
  613. /// <summary>
  614. /// 初始化颜色组件
  615. /// </summary>
  616. private void InitializeColorForm()
  617. {
  618. this.colorsFormfzx = new ColorsForm();
  619. this.colorsFormfzx.StartPosition = FormStartPosition.CenterScreen;
  620. this.colorsFormfzx.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  621. this.colorsFormljx = new ColorsForm();
  622. this.colorsFormljx.StartPosition = FormStartPosition.CenterScreen;
  623. this.colorsFormljx.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  624. this.colorsFormclx = new ColorsForm();
  625. this.colorsFormclx.StartPosition = FormStartPosition.CenterScreen;
  626. this.colorsFormclx.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  627. this.colorsFormfont = new ColorsForm();
  628. this.colorsFormfont.StartPosition = FormStartPosition.CenterScreen;
  629. this.colorsFormfont.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  630. }
  631. /// <summary>
  632. /// 初始化当前控件属性
  633. /// </summary>
  634. private void InitializeWorkTypeModel()
  635. {
  636. this.fontsItems.Clear();
  637. //绑定字体数据
  638. System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
  639. foreach (FontFamily fontFamily in fonts.Families)
  640. {
  641. fontsItems.Add(fontFamily.Name);
  642. }
  643. this.comboBox1.DataSource = fontsItems;
  644. workTypeModel = (WorkTypeStyleModel)this.parentStyleModel;
  645. //辅助线
  646. this.panel1.BackColor = Color.FromArgb(workTypeModel.guideColour);
  647. this.numericUpDown1.Value = workTypeModel.guideLineWidth;
  648. if (workTypeModel.guideShowFlag == 0)
  649. {
  650. this.radioButton2.Checked = true;
  651. }
  652. else
  653. {
  654. this.radioButton1.Checked = true;
  655. }
  656. //连接线
  657. this.panel2.BackColor = Color.FromArgb(workTypeModel.connectColour);
  658. this.numericUpDown2.Value = workTypeModel.connectLineWidth;
  659. if (workTypeModel.connectShowFlag == 0)
  660. {
  661. this.radioButton4.Checked = true;
  662. }
  663. else
  664. {
  665. this.radioButton3.Checked = true;
  666. }
  667. //测量线
  668. this.panel3.BackColor = Color.FromArgb(workTypeModel.measureColour);
  669. this.numericUpDown3.Value = workTypeModel.measureLineWidth;
  670. if (workTypeModel.measureRangeShowFlag == 0)
  671. {
  672. this.radioButton7.Checked = true;
  673. }
  674. else
  675. {
  676. this.radioButton5.Checked = true;
  677. }
  678. if (workTypeModel.measureLengthShowFlag == 0)
  679. {
  680. this.radioButton8.Checked = true;
  681. }
  682. else
  683. {
  684. this.radioButton6.Checked = true;
  685. }
  686. //文字
  687. this.panel4.BackColor = Color.FromArgb(workTypeModel.fontColour);
  688. this.comboBox1.Text = workTypeModel.font;
  689. this.numericUpDown4.Value = workTypeModel.fontSize;
  690. }
  691. /// <summary>
  692. /// 关闭
  693. /// </summary>
  694. /// <param name="sender"></param>
  695. /// <param name="e"></param>
  696. private void button2_Click(object sender, EventArgs e)
  697. {
  698. this.Close();
  699. }
  700. /// <summary>
  701. /// 调色板回调函数
  702. /// </summary>
  703. /// <param name="sender"></param>
  704. /// <param name="ce"></param>
  705. private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
  706. {
  707. }
  708. /// <summary>
  709. /// 辅助线Panel被点击
  710. /// </summary>
  711. /// <param name="sender"></param>
  712. /// <param name="e"></param>
  713. private void panel1_Click(object sender, EventArgs e)
  714. {
  715. this.colorsFormfzx.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor);
  716. this.colorsFormfzx.setSaveBtn_Click(new System.EventHandler(this.fzxColorChanged));
  717. this.colorsFormfzx.ShowDialog();
  718. }
  719. /// <summary>
  720. /// 辅助线Panel的调色板颜色改变
  721. /// </summary>
  722. /// <param name="sender"></param>
  723. /// <param name="e"></param>
  724. private void fzxColorChanged(object sender, EventArgs e)
  725. {
  726. this.panel1.BackColor = this.colorsFormfzx.UserPrimaryColor.ToColor();
  727. this.colorsFormfzx.Close();
  728. }
  729. /// <summary>
  730. /// 连接线Panel被点击
  731. /// </summary>
  732. /// <param name="sender"></param>
  733. /// <param name="e"></param>
  734. private void panel2_Click(object sender, EventArgs e)
  735. {
  736. this.colorsFormljx.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
  737. this.colorsFormljx.setSaveBtn_Click(new System.EventHandler(this.ljxColorChanged));
  738. this.colorsFormljx.ShowDialog();
  739. }
  740. /// <summary>
  741. /// 连接线Panel的调色板颜色改变
  742. /// </summary>
  743. /// <param name="sender"></param>
  744. /// <param name="e"></param>
  745. private void ljxColorChanged(object sender, EventArgs e)
  746. {
  747. this.panel2.BackColor = this.colorsFormljx.UserPrimaryColor.ToColor();
  748. this.colorsFormljx.Close();
  749. }
  750. /// <summary>
  751. /// 测量线Panel被点击
  752. /// </summary>
  753. /// <param name="sender"></param>
  754. /// <param name="e"></param>
  755. private void panel3_Click(object sender, EventArgs e)
  756. {
  757. this.colorsFormclx.UserPrimaryColor = ColorBgra.FromColor(this.panel3.BackColor);
  758. this.colorsFormclx.setSaveBtn_Click(new System.EventHandler(this.clxColorChanged));
  759. this.colorsFormclx.ShowDialog();
  760. }
  761. /// <summary>
  762. /// 测量线Panel的调色板颜色改变
  763. /// </summary>
  764. /// <param name="sender"></param>
  765. /// <param name="e"></param>
  766. private void clxColorChanged(object sender, EventArgs e)
  767. {
  768. this.panel3.BackColor = this.colorsFormclx.UserPrimaryColor.ToColor();
  769. this.colorsFormclx.Close();
  770. }
  771. /// <summary>
  772. /// 字体颜色Panel被点击
  773. /// </summary>
  774. /// <param name="sender"></param>
  775. /// <param name="e"></param>
  776. private void panel4_Click(object sender, EventArgs e)
  777. {
  778. this.colorsFormfont.UserPrimaryColor = ColorBgra.FromColor(this.panel4.BackColor);
  779. this.colorsFormfont.setSaveBtn_Click(new System.EventHandler(this.fontColorChanged));
  780. this.colorsFormfont.ShowDialog();
  781. }
  782. /// <summary>
  783. /// 字体颜色Panel的调色板颜色改变
  784. /// </summary>
  785. /// <param name="sender"></param>
  786. /// <param name="e"></param>
  787. private void fontColorChanged(object sender, EventArgs e)
  788. {
  789. this.panel4.BackColor = this.colorsFormfont.UserPrimaryColor.ToColor();
  790. this.colorsFormfont.Close();
  791. }
  792. /// <summary>
  793. /// 应用
  794. /// </summary>
  795. /// <param name="sender"></param>
  796. /// <param name="e"></param>
  797. private void button1_Click(object sender, EventArgs e)
  798. {
  799. UpDownBase fzxLineWidthup = (UpDownBase)this.numericUpDown1;
  800. if (string.IsNullOrEmpty(fzxLineWidthup.Text))
  801. {
  802. this.numericUpDown1.Value = 1;
  803. }
  804. UpDownBase ljxLineWidthup = (UpDownBase)this.numericUpDown2;
  805. if (string.IsNullOrEmpty(ljxLineWidthup.Text))
  806. {
  807. this.numericUpDown2.Value = 1;
  808. }
  809. UpDownBase clxLineWidthup = (UpDownBase)this.numericUpDown3;
  810. if (string.IsNullOrEmpty(clxLineWidthup.Text))
  811. {
  812. this.numericUpDown3.Value = 1;
  813. }
  814. UpDownBase fontSizeWidthup = (UpDownBase)this.numericUpDown4;
  815. if (string.IsNullOrEmpty(fontSizeWidthup.Text))
  816. {
  817. this.numericUpDown4.Value = 1;
  818. }
  819. workTypeModel = new WorkTypeStyleModel();
  820. //辅助线
  821. workTypeModel.guideColour = Convert.ToInt32(this.panel1.BackColor.ToArgb());
  822. workTypeModel.guideLineWidth = Convert.ToInt32(this.numericUpDown1.Value);
  823. if (this.radioButton2.Checked)
  824. {
  825. workTypeModel.guideShowFlag = 0;
  826. }
  827. else
  828. {
  829. workTypeModel.guideShowFlag = 1;
  830. }
  831. //连接线
  832. workTypeModel.connectColour = Convert.ToInt32(this.panel2.BackColor.ToArgb());
  833. workTypeModel.connectLineWidth = Convert.ToInt32(this.numericUpDown2.Value);
  834. if (this.radioButton4.Checked)
  835. {
  836. workTypeModel.connectShowFlag = 0;
  837. }
  838. else
  839. {
  840. workTypeModel.connectShowFlag = 1;
  841. }
  842. //测量线
  843. workTypeModel.measureColour = Convert.ToInt32(this.panel3.BackColor.ToArgb());
  844. workTypeModel.measureLineWidth = Convert.ToInt32(this.numericUpDown3.Value);
  845. if (this.radioButton7.Checked)
  846. {
  847. workTypeModel.measureRangeShowFlag = 0;
  848. }
  849. else
  850. {
  851. workTypeModel.measureRangeShowFlag = 1;
  852. }
  853. if (this.radioButton8.Checked)
  854. {
  855. workTypeModel.measureLengthShowFlag = 0;
  856. }
  857. else
  858. {
  859. workTypeModel.measureLengthShowFlag = 1;
  860. }
  861. //文字
  862. workTypeModel.fontColour = Convert.ToInt32(this.panel4.BackColor.ToArgb());
  863. workTypeModel.font = this.comboBox1.Text;
  864. workTypeModel.fontSize = Convert.ToInt32(this.numericUpDown4.Value);
  865. DrawWorkType drawWorkType = (DrawWorkType)this.drawObject;
  866. drawWorkType.labelWorkTypeStyleMode = workTypeModel;
  867. this.appWorkspace.ActiveDocumentWorkspace.Refresh();
  868. this.Close();
  869. }
  870. }
  871. }