MethodBDialog.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. using PaintDotNet.Base.DedicatedAnalysis.Inclusions;
  2. using PaintDotNet.Base.DedicatedAnalysis.Inclusions.Standard.ISO4967_1998.TypesOfAssessment;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. namespace PaintDotNet.DedicatedAnalysis.Inclusions.ISO4967_1998
  13. {
  14. internal class MethodBDialog : InclusionsStandardDialog
  15. {
  16. #region 组件
  17. private Button label_displaySetting_DS;
  18. private Panel panel_displaySetting_A;
  19. private Panel panel_displaySetting_C;
  20. private Button label_displaySetting_D;
  21. private Panel panel_displaySetting_B;
  22. private Panel panel_displaySetting_D;
  23. private Button label_displaySetting_C;
  24. private Panel panel_displaySetting_DS;
  25. private Button label_displaySetting_A;
  26. private RadioButton radioButton_DarkGray;
  27. private RadioButton radioButton_Gray;
  28. private RadioButton radioButton_LightBlue;
  29. private RadioButton radioButton_Black;
  30. private Button label_displaySetting_B;
  31. #endregion 组件
  32. #region 构造函数
  33. public MethodBDialog(AppWorkspace appWorkspace, string dialogText, PdnMenuItem menuItem) : base(appWorkspace, dialogText, menuItem)
  34. {
  35. }
  36. #endregion
  37. #region 初始化组件
  38. private void InitializeComponent()
  39. {
  40. this.radioButton_DarkGray = new System.Windows.Forms.RadioButton();
  41. this.radioButton_Gray = new System.Windows.Forms.RadioButton();
  42. this.radioButton_LightBlue = new System.Windows.Forms.RadioButton();
  43. this.radioButton_Black = new System.Windows.Forms.RadioButton();
  44. this.label_displaySetting_DS = new System.Windows.Forms.Button();
  45. this.panel_displaySetting_A = new System.Windows.Forms.Panel();
  46. this.panel_displaySetting_C = new System.Windows.Forms.Panel();
  47. this.label_displaySetting_D = new System.Windows.Forms.Button();
  48. this.panel_displaySetting_B = new System.Windows.Forms.Panel();
  49. this.panel_displaySetting_D = new System.Windows.Forms.Panel();
  50. this.label_displaySetting_C = new System.Windows.Forms.Button();
  51. this.panel_displaySetting_DS = new System.Windows.Forms.Panel();
  52. this.label_displaySetting_A = new System.Windows.Forms.Button();
  53. this.label_displaySetting_B = new System.Windows.Forms.Button();
  54. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).BeginInit();
  55. this.groupBox_colorSetting.SuspendLayout();
  56. this.groupBox_displaySetting.SuspendLayout();
  57. this.SuspendLayout();
  58. //
  59. // groupBox_colorSetting
  60. //
  61. this.groupBox_colorSetting.Controls.Add(this.radioButton_DarkGray);
  62. this.groupBox_colorSetting.Controls.Add(this.radioButton_Gray);
  63. this.groupBox_colorSetting.Controls.Add(this.radioButton_LightBlue);
  64. this.groupBox_colorSetting.Controls.Add(this.radioButton_Black);
  65. this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Black, 0);
  66. this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_LightBlue, 0);
  67. this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Gray, 0);
  68. this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_DarkGray, 0);
  69. //
  70. // groupBox_displaySetting
  71. //
  72. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_DS);
  73. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_A);
  74. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_C);
  75. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_D);
  76. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_B);
  77. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_D);
  78. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_C);
  79. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_DS);
  80. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_A);
  81. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_B);
  82. //
  83. // radioButton_DarkGray
  84. //
  85. this.radioButton_DarkGray.AutoSize = true;
  86. this.radioButton_DarkGray.Location = new System.Drawing.Point(178, 20);
  87. this.radioButton_DarkGray.Name = "radioButton_DarkGray";
  88. this.radioButton_DarkGray.Size = new System.Drawing.Size(59, 16);
  89. this.radioButton_DarkGray.TabIndex = 38;
  90. this.radioButton_DarkGray.TabStop = true;
  91. this.radioButton_DarkGray.Text = PdnResources.GetString("Menu.Darkgray.text");
  92. this.radioButton_DarkGray.UseVisualStyleBackColor = true;
  93. //
  94. // radioButton_Gray
  95. //
  96. this.radioButton_Gray.AutoSize = true;
  97. this.radioButton_Gray.Location = new System.Drawing.Point(125, 20);
  98. this.radioButton_Gray.Name = "radioButton_Gray";
  99. this.radioButton_Gray.Size = new System.Drawing.Size(47, 16);
  100. this.radioButton_Gray.TabIndex = 37;
  101. this.radioButton_Gray.TabStop = true;
  102. this.radioButton_Gray.Text = PdnResources.GetString("Menu.gray.text");
  103. this.radioButton_Gray.UseVisualStyleBackColor = true;
  104. //
  105. // radioButton_LightBlue
  106. //
  107. this.radioButton_LightBlue.AutoSize = true;
  108. this.radioButton_LightBlue.Location = new System.Drawing.Point(60, 20);
  109. this.radioButton_LightBlue.Name = "radioButton_LightBlue";
  110. this.radioButton_LightBlue.Size = new System.Drawing.Size(59, 16);
  111. this.radioButton_LightBlue.TabIndex = 36;
  112. this.radioButton_LightBlue.TabStop = true;
  113. this.radioButton_LightBlue.Text = PdnResources.GetString("Menu.Bluish.text");
  114. this.radioButton_LightBlue.UseVisualStyleBackColor = true;
  115. //
  116. // radioButton_Black
  117. //
  118. this.radioButton_Black.AutoSize = true;
  119. this.radioButton_Black.Location = new System.Drawing.Point(7, 20);
  120. this.radioButton_Black.Name = "radioButton_Black";
  121. this.radioButton_Black.Size = new System.Drawing.Size(47, 16);
  122. this.radioButton_Black.TabIndex = 35;
  123. this.radioButton_Black.TabStop = true;
  124. this.radioButton_Black.Text = PdnResources.GetString("Menu.black.text");
  125. this.radioButton_Black.UseVisualStyleBackColor = true;
  126. //
  127. // label_displaySetting_DS
  128. //
  129. this.label_displaySetting_DS.AutoSize = true;
  130. this.label_displaySetting_DS.Location = new System.Drawing.Point(227, 24);
  131. this.label_displaySetting_DS.Name = "label_displaySetting_DS";
  132. this.label_displaySetting_DS.Size = new System.Drawing.Size(27, 22);
  133. this.label_displaySetting_DS.TabIndex = 42;
  134. this.label_displaySetting_DS.Text = "DS";
  135. //
  136. // panel_displaySetting_A
  137. //
  138. this.panel_displaySetting_A.Location = new System.Drawing.Point(39, 24);
  139. this.panel_displaySetting_A.Name = "panel_displaySetting_A";
  140. this.panel_displaySetting_A.Size = new System.Drawing.Size(21, 21);
  141. this.panel_displaySetting_A.TabIndex = 34;
  142. //
  143. // panel_displaySetting_C
  144. //
  145. this.panel_displaySetting_C.BackColor = System.Drawing.SystemColors.Control;
  146. this.panel_displaySetting_C.Location = new System.Drawing.Point(146, 24);
  147. this.panel_displaySetting_C.Name = "panel_displaySetting_C";
  148. this.panel_displaySetting_C.Size = new System.Drawing.Size(21, 21);
  149. this.panel_displaySetting_C.TabIndex = 35;
  150. //
  151. // label_displaySetting_D
  152. //
  153. this.label_displaySetting_D.AutoSize = true;
  154. this.label_displaySetting_D.Location = new System.Drawing.Point(171, 24);
  155. this.label_displaySetting_D.Name = "label_displaySetting_D";
  156. this.label_displaySetting_D.Size = new System.Drawing.Size(21, 22);
  157. this.label_displaySetting_D.TabIndex = 41;
  158. this.label_displaySetting_D.Text = "D";
  159. //
  160. // panel_displaySetting_B
  161. //
  162. this.panel_displaySetting_B.BackColor = System.Drawing.SystemColors.Control;
  163. this.panel_displaySetting_B.Location = new System.Drawing.Point(92, 24);
  164. this.panel_displaySetting_B.Name = "panel_displaySetting_B";
  165. this.panel_displaySetting_B.Size = new System.Drawing.Size(21, 21);
  166. this.panel_displaySetting_B.TabIndex = 33;
  167. //
  168. // panel_displaySetting_D
  169. //
  170. this.panel_displaySetting_D.BackColor = System.Drawing.SystemColors.Control;
  171. this.panel_displaySetting_D.Location = new System.Drawing.Point(198, 24);
  172. this.panel_displaySetting_D.Name = "panel_displaySetting_D";
  173. this.panel_displaySetting_D.Size = new System.Drawing.Size(21, 21);
  174. this.panel_displaySetting_D.TabIndex = 36;
  175. //
  176. // label_displaySetting_C
  177. //
  178. this.label_displaySetting_C.AutoSize = true;
  179. this.label_displaySetting_C.Location = new System.Drawing.Point(119, 24);
  180. this.label_displaySetting_C.Name = "label_displaySetting_C";
  181. this.label_displaySetting_C.Size = new System.Drawing.Size(21, 22);
  182. this.label_displaySetting_C.TabIndex = 40;
  183. this.label_displaySetting_C.Text = "C";
  184. //
  185. // panel_displaySetting_DS
  186. //
  187. this.panel_displaySetting_DS.BackColor = System.Drawing.SystemColors.Control;
  188. this.panel_displaySetting_DS.Location = new System.Drawing.Point(260, 24);
  189. this.panel_displaySetting_DS.Name = "panel_displaySetting_DS";
  190. this.panel_displaySetting_DS.Size = new System.Drawing.Size(21, 21);
  191. this.panel_displaySetting_DS.TabIndex = 37;
  192. //
  193. // label_displaySetting_A
  194. //
  195. this.label_displaySetting_A.AutoSize = true;
  196. this.label_displaySetting_A.Location = new System.Drawing.Point(13, 24);
  197. this.label_displaySetting_A.Name = "label_displaySetting_A";
  198. this.label_displaySetting_A.Size = new System.Drawing.Size(21, 22);
  199. this.label_displaySetting_A.TabIndex = 38;
  200. this.label_displaySetting_A.Text = "A";
  201. //
  202. // label_displaySetting_B
  203. //
  204. this.label_displaySetting_B.AutoSize = true;
  205. this.label_displaySetting_B.Location = new System.Drawing.Point(67, 24);
  206. this.label_displaySetting_B.Name = "label_displaySetting_B";
  207. this.label_displaySetting_B.Size = new System.Drawing.Size(21, 22);
  208. this.label_displaySetting_B.TabIndex = 39;
  209. this.label_displaySetting_B.Text = "B";
  210. //
  211. // MethodBDialog
  212. //
  213. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  214. this.ClientSize = new System.Drawing.Size(1177, 908);
  215. this.Name = "MethodBDialog";
  216. this.Text = "ISO4967_1998_MethodB("+ PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.Inclusion.Text")+ ")";
  217. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).EndInit();
  218. this.groupBox_colorSetting.ResumeLayout(false);
  219. this.groupBox_colorSetting.PerformLayout();
  220. this.groupBox_displaySetting.ResumeLayout(false);
  221. this.groupBox_displaySetting.PerformLayout();
  222. this.ResumeLayout(false);
  223. }
  224. #endregion 初始化组件
  225. #region 需继承方法
  226. protected override void SubclassInitialize()
  227. {
  228. InitializeComponent();
  229. this.radioButton_Black.Checked = true;
  230. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"];
  231. }
  232. protected override MethodOfAssessment getMethodOfAssessment()
  233. {
  234. return new MethodB(this.imgPxPerUnit);
  235. }
  236. protected override void initColorSetting()
  237. {
  238. this.radioButton_Black.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  239. this.radioButton_Gray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  240. this.radioButton_LightBlue.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  241. this.radioButton_DarkGray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  242. }
  243. protected override void initDisplaySetting()
  244. {
  245. this.panel_displaySetting_A.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["A"].showColor);
  246. this.panel_displaySetting_B.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["B"].showColor);
  247. this.panel_displaySetting_C.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["C"].showColor);
  248. this.panel_displaySetting_D.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["D"].showColor);
  249. this.panel_displaySetting_DS.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["DS"].showColor);
  250. }
  251. protected override void getInclusionParameters()
  252. {
  253. switch (whichChecked)
  254. {
  255. case 0:
  256. radioButton_Black.Checked = true;
  257. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"];
  258. break;
  259. case 1:
  260. radioButton_Black.Checked = true;
  261. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"];
  262. break;
  263. case 2:
  264. radioButton_LightBlue.Checked = true;
  265. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["LightBlue"];
  266. break;
  267. case 3:
  268. radioButton_Gray.Checked = true;
  269. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Gray"];
  270. break;
  271. case 4:
  272. radioButton_DarkGray.Checked = true;
  273. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["DarkGray"];
  274. break;
  275. }
  276. }
  277. protected override void saveInclusionParameters()
  278. {
  279. if (radioButton_Black.Checked)
  280. {
  281. thisParameters.parameter3 = 1;
  282. }
  283. else if (radioButton_LightBlue.Checked)
  284. {
  285. thisParameters.parameter3 = 2;
  286. }
  287. else if (radioButton_Gray.Checked)
  288. {
  289. thisParameters.parameter3 = 3;
  290. }
  291. else if (radioButton_DarkGray.Checked)
  292. {
  293. thisParameters.parameter3 = 4;
  294. }
  295. }
  296. protected override void getOldCheck()
  297. {
  298. this.radioButton_Black.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
  299. this.radioButton_Gray.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
  300. this.radioButton_LightBlue.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
  301. this.radioButton_DarkGray.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
  302. switch (colorName)
  303. {
  304. case "Black":
  305. radioButton_Black.Checked = true;
  306. break;
  307. case "Gray":
  308. radioButton_Gray.Checked = true;
  309. break;
  310. case "DarkGray":
  311. radioButton_DarkGray.Checked = true;
  312. break;
  313. case "LightBlue":
  314. radioButton_LightBlue.Checked = true;
  315. break;
  316. }
  317. this.radioButton_Black.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  318. this.radioButton_Gray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  319. this.radioButton_LightBlue.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  320. this.radioButton_DarkGray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  321. }
  322. #endregion 需继承方法
  323. }
  324. }