using PaintDotNet.Base.DedicatedAnalysis.Inclusions; using PaintDotNet.Base.DedicatedAnalysis.Inclusions.Standard.DIN50602_1985.TypesOfAssessment; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace PaintDotNet.DedicatedAnalysis.Inclusions.DIN50602_1985 { internal class MethodKDialog : InclusionsStandardDialog { #region 组件 private RadioButton radioButton_DarkGray; private RadioButton radioButton_Gray; private RadioButton radioButton_LightBlue; private RadioButton radioButton_Black; private Button label_displaySetting_SS; private Panel panel_displaySetting_SS; private Panel panel_displaySetting_OA; private Button label_displaySetting_OA; private Panel panel_displaySetting_OS; private Button label_displaySetting_OS; private Button label_displaySetting_OG; private Panel panel_displaySetting_OG; #endregion 组件 #region 构造函数 public MethodKDialog(AppWorkspace appWorkspace, string dialogText, PdnMenuItem menuItem) : base(appWorkspace, dialogText, menuItem) { } #endregion 构造函数 #region 初始化组件 private void InitializeComponent() { this.radioButton_DarkGray = new System.Windows.Forms.RadioButton(); this.radioButton_Gray = new System.Windows.Forms.RadioButton(); this.radioButton_LightBlue = new System.Windows.Forms.RadioButton(); this.radioButton_Black = new System.Windows.Forms.RadioButton(); this.label_displaySetting_SS = new System.Windows.Forms.Button(); this.panel_displaySetting_SS = new System.Windows.Forms.Panel(); this.panel_displaySetting_OA = new System.Windows.Forms.Panel(); this.label_displaySetting_OA = new System.Windows.Forms.Button(); this.panel_displaySetting_OS = new System.Windows.Forms.Panel(); this.label_displaySetting_OS = new System.Windows.Forms.Button(); this.label_displaySetting_OG = new System.Windows.Forms.Button(); this.panel_displaySetting_OG = new System.Windows.Forms.Panel(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).BeginInit(); this.groupBox_colorSetting.SuspendLayout(); this.groupBox_displaySetting.SuspendLayout(); this.SuspendLayout(); // // groupBox_colorSetting // this.groupBox_colorSetting.Controls.Add(this.radioButton_DarkGray); this.groupBox_colorSetting.Controls.Add(this.radioButton_Gray); this.groupBox_colorSetting.Controls.Add(this.radioButton_LightBlue); this.groupBox_colorSetting.Controls.Add(this.radioButton_Black); this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Black, 0); this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_LightBlue, 0); this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Gray, 0); this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_DarkGray, 0); // // groupBox_displaySetting // this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_SS); this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_SS); this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_OA); this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_OA); this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_OS); this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_OS); this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_OG); this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_OG); // // radioButton_DarkGray // this.radioButton_DarkGray.AutoSize = true; this.radioButton_DarkGray.Location = new System.Drawing.Point(178, 20); this.radioButton_DarkGray.Name = "radioButton_DarkGray"; this.radioButton_DarkGray.Size = new System.Drawing.Size(59, 16); this.radioButton_DarkGray.TabIndex = 38; this.radioButton_DarkGray.TabStop = true; this.radioButton_DarkGray.Text = PdnResources.GetString("Menu.Darkgray.text"); this.radioButton_DarkGray.UseVisualStyleBackColor = true; // // radioButton_Gray // this.radioButton_Gray.AutoSize = true; this.radioButton_Gray.Location = new System.Drawing.Point(125, 20); this.radioButton_Gray.Name = "radioButton_Gray"; this.radioButton_Gray.Size = new System.Drawing.Size(47, 16); this.radioButton_Gray.TabIndex = 37; this.radioButton_Gray.TabStop = true; this.radioButton_Gray.Text = PdnResources.GetString("Menu.gray.text"); this.radioButton_Gray.UseVisualStyleBackColor = true; // // radioButton_LightBlue // this.radioButton_LightBlue.AutoSize = true; this.radioButton_LightBlue.Location = new System.Drawing.Point(60, 20); this.radioButton_LightBlue.Name = "radioButton_LightBlue"; this.radioButton_LightBlue.Size = new System.Drawing.Size(59, 16); this.radioButton_LightBlue.TabIndex = 36; this.radioButton_LightBlue.TabStop = true; this.radioButton_LightBlue.Text = PdnResources.GetString("Menu.Bluish.text"); this.radioButton_LightBlue.UseVisualStyleBackColor = true; // // radioButton_Black // this.radioButton_Black.AutoSize = true; this.radioButton_Black.Location = new System.Drawing.Point(7, 20); this.radioButton_Black.Name = "radioButton_Black"; this.radioButton_Black.Size = new System.Drawing.Size(47, 16); this.radioButton_Black.TabIndex = 35; this.radioButton_Black.TabStop = true; this.radioButton_Black.Text = PdnResources.GetString("Menu.black.text"); this.radioButton_Black.UseVisualStyleBackColor = true; // // label_displaySetting_SS // this.label_displaySetting_SS.AutoSize = true; this.label_displaySetting_SS.Location = new System.Drawing.Point(7, 24); this.label_displaySetting_SS.Name = "label_displaySetting_SS"; this.label_displaySetting_SS.Size = new System.Drawing.Size(27, 22); this.label_displaySetting_SS.TabIndex = 42; this.label_displaySetting_SS.Text = "SS"; // // panel_displaySetting_SS // this.panel_displaySetting_SS.Location = new System.Drawing.Point(40, 24); this.panel_displaySetting_SS.Name = "panel_displaySetting_SS"; this.panel_displaySetting_SS.Size = new System.Drawing.Size(21, 21); this.panel_displaySetting_SS.TabIndex = 34; // // panel_displaySetting_OA // this.panel_displaySetting_OA.BackColor = System.Drawing.SystemColors.Control; this.panel_displaySetting_OA.Location = new System.Drawing.Point(162, 24); this.panel_displaySetting_OA.Name = "panel_displaySetting_OA"; this.panel_displaySetting_OA.Size = new System.Drawing.Size(21, 21); this.panel_displaySetting_OA.TabIndex = 35; // // label_displaySetting_OA // this.label_displaySetting_OA.AutoSize = true; this.label_displaySetting_OA.Location = new System.Drawing.Point(69, 24); this.label_displaySetting_OA.Name = "label_displaySetting_OA"; this.label_displaySetting_OA.Size = new System.Drawing.Size(27, 22); this.label_displaySetting_OA.TabIndex = 41; this.label_displaySetting_OA.Text = "OA"; // // panel_displaySetting_OS // this.panel_displaySetting_OS.BackColor = System.Drawing.SystemColors.Control; this.panel_displaySetting_OS.Location = new System.Drawing.Point(102, 24); this.panel_displaySetting_OS.Name = "panel_displaySetting_OS"; this.panel_displaySetting_OS.Size = new System.Drawing.Size(21, 21); this.panel_displaySetting_OS.TabIndex = 33; // // label_displaySetting_OS // this.label_displaySetting_OS.AutoSize = true; this.label_displaySetting_OS.Location = new System.Drawing.Point(129, 24); this.label_displaySetting_OS.Name = "label_displaySetting_OS"; this.label_displaySetting_OS.Size = new System.Drawing.Size(27, 22); this.label_displaySetting_OS.TabIndex = 40; this.label_displaySetting_OS.Text = "OS"; // // label_displaySetting_OG // this.label_displaySetting_OG.AutoSize = true; this.label_displaySetting_OG.Location = new System.Drawing.Point(189, 24); this.label_displaySetting_OG.Name = "label_displaySetting_OG"; this.label_displaySetting_OG.Size = new System.Drawing.Size(27, 22); this.label_displaySetting_OG.TabIndex = 38; this.label_displaySetting_OG.Text = "OG"; // // panel_displaySetting_OG // this.panel_displaySetting_OG.BackColor = System.Drawing.SystemColors.Control; this.panel_displaySetting_OG.Location = new System.Drawing.Point(222, 24); this.panel_displaySetting_OG.Name = "panel_displaySetting_OG"; this.panel_displaySetting_OG.Size = new System.Drawing.Size(21, 21); this.panel_displaySetting_OG.TabIndex = 36; // // MethodKDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.ClientSize = new System.Drawing.Size(1177, 908); this.Location = new System.Drawing.Point(0, 0); this.Name = "MethodKDialog"; this.Text = "DIN50602_1985_MethodK("+ PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.Inclusion.Text")+ ")"; ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).EndInit(); this.groupBox_colorSetting.ResumeLayout(false); this.groupBox_colorSetting.PerformLayout(); this.groupBox_displaySetting.ResumeLayout(false); this.groupBox_displaySetting.PerformLayout(); this.ResumeLayout(false); } #endregion 初始化组件 #region 需继承方法 protected override void SubclassInitialize() { InitializeComponent(); this.radioButton_Black.Checked = true; this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"]; } protected override MethodOfAssessment getMethodOfAssessment() { return new MethodK(this.imgPxPerUnit); } protected override void initColorSetting() { this.radioButton_Black.CheckedChanged += new System.EventHandler(colorSettingRadioButton); this.radioButton_Gray.CheckedChanged += new System.EventHandler(colorSettingRadioButton); this.radioButton_LightBlue.CheckedChanged += new System.EventHandler(colorSettingRadioButton); this.radioButton_DarkGray.CheckedChanged += new System.EventHandler(colorSettingRadioButton); } protected override void initDisplaySetting() { this.panel_displaySetting_SS.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["SS"].showColor); this.panel_displaySetting_OA.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["OS"].showColor); this.panel_displaySetting_OS.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["OA"].showColor); this.panel_displaySetting_OG.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["OG"].showColor); } protected override void getInclusionParameters() { switch (whichChecked) { case 0: radioButton_Black.Checked = true; this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"]; break; case 1: radioButton_Black.Checked = true; this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"]; break; case 2: radioButton_LightBlue.Checked = true; this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["LightBlue"]; break; case 3: radioButton_Gray.Checked = true; this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Gray"]; break; case 4: radioButton_DarkGray.Checked = true; this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["DarkGray"]; break; } } protected override void saveInclusionParameters() { if (radioButton_Black.Checked) { thisParameters.parameter3 = 1; } else if (radioButton_LightBlue.Checked) { thisParameters.parameter3 = 2; } else if (radioButton_Gray.Checked) { thisParameters.parameter3 = 3; } else if (radioButton_DarkGray.Checked) { thisParameters.parameter3 = 4; } } protected override void getOldCheck() { this.radioButton_Black.CheckedChanged -= new System.EventHandler(colorSettingRadioButton); this.radioButton_Gray.CheckedChanged -= new System.EventHandler(colorSettingRadioButton); this.radioButton_LightBlue.CheckedChanged -= new System.EventHandler(colorSettingRadioButton); this.radioButton_DarkGray.CheckedChanged -= new System.EventHandler(colorSettingRadioButton); switch (colorName) { case "Black": radioButton_Black.Checked = true; break; case "Gray": radioButton_Gray.Checked = true; break; case "DarkGray": radioButton_DarkGray.Checked = true; break; case "LightBlue": radioButton_LightBlue.Checked = true; break; } this.radioButton_Black.CheckedChanged += new System.EventHandler(colorSettingRadioButton); this.radioButton_Gray.CheckedChanged += new System.EventHandler(colorSettingRadioButton); this.radioButton_LightBlue.CheckedChanged += new System.EventHandler(colorSettingRadioButton); this.radioButton_DarkGray.CheckedChanged += new System.EventHandler(colorSettingRadioButton); } #endregion 需继承方法 } }