123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444 |
- 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.DuctileIron.GBT9441_2009
- {
- public partial class ColorSetting : Form
- {
- #region
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- #region Windows Form Designer generated code
- private void InitializeLanguageText()
- {
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- this.btnClose.Text = PdnResources.GetString("Menu.File.Close.Text");
- this.btnPreservation.Text = PdnResources.GetString("CommonAction.Save");
- this.groupBox2.Text = PdnResources.GetString("Menu.Colorsetting.text");
- this.Text = PdnResources.GetString("Menu.Colorsetting.text");
- }
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.btnClose = new System.Windows.Forms.Button();
- this.btnPreservation = new System.Windows.Forms.Button();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.panelColour01_0 = new System.Windows.Forms.Panel();
- this.label4 = new System.Windows.Forms.Label();
- this.panelColour02_01 = new System.Windows.Forms.Panel();
- this.label5 = new System.Windows.Forms.Label();
- this.panelColour04_02 = new System.Windows.Forms.Panel();
- this.label6 = new System.Windows.Forms.Label();
- this.panelColour06_04 = new System.Windows.Forms.Panel();
- this.label3 = new System.Windows.Forms.Label();
- this.panelColour08_06 = new System.Windows.Forms.Panel();
- this.label2 = new System.Windows.Forms.Label();
- this.panelColour1_08 = new System.Windows.Forms.Panel();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.btnClose);
- this.groupBox1.Controls.Add(this.btnPreservation);
- this.groupBox1.Location = new System.Drawing.Point(3, 2);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(597, 64);
- this.groupBox1.TabIndex = 0;
- this.groupBox1.TabStop = false;
- //
- // btnClose
- //
- this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.btnClose.Location = new System.Drawing.Point(399, 21);
- this.btnClose.Name = "btnClose";
- this.btnClose.Size = new System.Drawing.Size(84, 30);
- this.btnClose.TabIndex = 4;
- this.btnClose.UseVisualStyleBackColor = true;
- this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
- //
- // btnPreservation
- //
- this.btnPreservation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.btnPreservation.Location = new System.Drawing.Point(500, 21);
- this.btnPreservation.Name = "btnPreservation";
- this.btnPreservation.Size = new System.Drawing.Size(84, 30);
- this.btnPreservation.TabIndex = 3;
- this.btnPreservation.UseVisualStyleBackColor = true;
- this.btnPreservation.Click += new System.EventHandler(this.btnPreservation_Click);
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.panelColour01_0);
- this.groupBox2.Controls.Add(this.label4);
- this.groupBox2.Controls.Add(this.panelColour02_01);
- this.groupBox2.Controls.Add(this.label5);
- this.groupBox2.Controls.Add(this.panelColour04_02);
- this.groupBox2.Controls.Add(this.label6);
- this.groupBox2.Controls.Add(this.panelColour06_04);
- this.groupBox2.Controls.Add(this.label3);
- this.groupBox2.Controls.Add(this.panelColour08_06);
- this.groupBox2.Controls.Add(this.label2);
- this.groupBox2.Controls.Add(this.panelColour1_08);
- this.groupBox2.Controls.Add(this.label1);
- this.groupBox2.Location = new System.Drawing.Point(3, 72);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(597, 130);
- this.groupBox2.TabIndex = 1;
- this.groupBox2.TabStop = false;
- //
- // panelColour01_0
- //
- this.panelColour01_0.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour01_0.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour01_0.Location = new System.Drawing.Point(423, 74);
- this.panelColour01_0.Name = "panelColour01_0";
- this.panelColour01_0.Size = new System.Drawing.Size(70, 28);
- this.panelColour01_0.TabIndex = 16;
- this.panelColour01_0.Click += new System.EventHandler(this.panelColour01_0_Click);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label4.Location = new System.Drawing.Point(361, 80);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(56, 14);
- this.label4.TabIndex = 15;
- this.label4.Text = "0.1-0:";
- //
- // panelColour02_01
- //
- this.panelColour02_01.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour02_01.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour02_01.Location = new System.Drawing.Point(249, 74);
- this.panelColour02_01.Name = "panelColour02_01";
- this.panelColour02_01.Size = new System.Drawing.Size(70, 28);
- this.panelColour02_01.TabIndex = 14;
- this.panelColour02_01.Click += new System.EventHandler(this.panelColour02_01_Click);
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label5.Location = new System.Drawing.Point(187, 80);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(70, 14);
- this.label5.TabIndex = 13;
- this.label5.Text = "0.2-0.1:";
- //
- // panelColour04_02
- //
- this.panelColour04_02.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour04_02.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour04_02.Location = new System.Drawing.Point(76, 74);
- this.panelColour04_02.Name = "panelColour04_02";
- this.panelColour04_02.Size = new System.Drawing.Size(70, 28);
- this.panelColour04_02.TabIndex = 12;
- this.panelColour04_02.Click += new System.EventHandler(this.panelColour04_02_Click);
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label6.Location = new System.Drawing.Point(14, 80);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(70, 14);
- this.label6.TabIndex = 11;
- this.label6.Text = "0.4-0.2:";
- //
- // panelColour06_04
- //
- this.panelColour06_04.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour06_04.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour06_04.Location = new System.Drawing.Point(423, 27);
- this.panelColour06_04.Name = "panelColour06_04";
- this.panelColour06_04.Size = new System.Drawing.Size(70, 28);
- this.panelColour06_04.TabIndex = 10;
- this.panelColour06_04.Click += new System.EventHandler(this.panelColour06_04_Click);
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label3.Location = new System.Drawing.Point(361, 33);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(70, 14);
- this.label3.TabIndex = 9;
- this.label3.Text = "0.6-0.4:";
- //
- // panelColour08_06
- //
- this.panelColour08_06.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour08_06.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour08_06.Location = new System.Drawing.Point(249, 27);
- this.panelColour08_06.Name = "panelColour08_06";
- this.panelColour08_06.Size = new System.Drawing.Size(70, 28);
- this.panelColour08_06.TabIndex = 8;
- this.panelColour08_06.Click += new System.EventHandler(this.panelColour08_06_Click);
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label2.Location = new System.Drawing.Point(187, 33);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(70, 14);
- this.label2.TabIndex = 7;
- this.label2.Text = "0.8-0.6:";
- //
- // panelColour1_08
- //
- this.panelColour1_08.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour1_08.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour1_08.Location = new System.Drawing.Point(76, 27);
- this.panelColour1_08.Name = "panelColour1_08";
- this.panelColour1_08.Size = new System.Drawing.Size(70, 28);
- this.panelColour1_08.TabIndex = 6;
- this.panelColour1_08.Click += new System.EventHandler(this.panelColour1_08_Click);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label1.Location = new System.Drawing.Point(14, 33);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(56, 14);
- this.label1.TabIndex = 0;
- this.label1.Text = "1-0.8:";
- //
- // ColorSetting
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(604, 214);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "ColorSetting";
- this.groupBox1.ResumeLayout(false);
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.ResumeLayout(false);
- }
- #endregion
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.Button btnClose;
- private System.Windows.Forms.Button btnPreservation;
- private System.Windows.Forms.GroupBox groupBox2;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Panel panelColour01_0;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Panel panelColour02_01;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Panel panelColour04_02;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Panel panelColour06_04;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Panel panelColour08_06;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Panel panelColour1_08;
- #endregion
- /// <summary>
- /// 调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsForm1_08;
- PaintDotNet.ColorsForm colorsForm08_06;
- PaintDotNet.ColorsForm colorsForm06_04;
- PaintDotNet.ColorsForm colorsForm04_02;
- PaintDotNet.ColorsForm colorsForm02_01;
- PaintDotNet.ColorsForm colorsForm01_0;
- public ColorSetting()
- {
- InitializeComponent();
- InitializeLanguageText();
- InitOtherTools();
- }
- private void InitOtherTools()
- {
- //
- //调色板
- //
- this.colorsForm1_08 = new ColorsForm();
- this.colorsForm1_08.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm1_08.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm08_06 = new ColorsForm();
- this.colorsForm08_06.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm08_06.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm06_04 = new ColorsForm();
- this.colorsForm06_04.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm06_04.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm04_02 = new ColorsForm();
- this.colorsForm04_02.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm04_02.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm02_01 = new ColorsForm();
- this.colorsForm02_01.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm02_01.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm01_0 = new ColorsForm();
- this.colorsForm01_0.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm01_0.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- if (SpheroidizationLevelDialog.spheroidizationLevelDialog.colour != null)
- {
- this.panelColour1_08.BackColor = SpheroidizationLevelDialog.spheroidizationLevelDialog.colour["panelColour1_08"];;
- this.panelColour08_06.BackColor = SpheroidizationLevelDialog.spheroidizationLevelDialog.colour["panelColour08_06"];
- this.panelColour06_04.BackColor = SpheroidizationLevelDialog.spheroidizationLevelDialog.colour["panelColour06_04"];
- this.panelColour04_02.BackColor = SpheroidizationLevelDialog.spheroidizationLevelDialog.colour["panelColour04_02"];
- this.panelColour02_01.BackColor = SpheroidizationLevelDialog.spheroidizationLevelDialog.colour["panelColour02_01"];
- this.panelColour01_0.BackColor = SpheroidizationLevelDialog.spheroidizationLevelDialog.colour["panelColour01_0"];
- }
- else
- {
- this.panelColour1_08.BackColor = Color.Orange;
- this.panelColour08_06.BackColor = Color.Blue;
- this.panelColour06_04.BackColor = Color.Green;
- this.panelColour04_02.BackColor = Color.Pink;
- this.panelColour02_01.BackColor = Color.Violet;
- this.panelColour01_0.BackColor = Color.Yellow;
- }
- }
- private void panelColour1_08_Click(object sender, EventArgs e)
- {
- this.colorsForm1_08.UserPrimaryColor = ColorBgra.FromColor(this.panelColour1_08.BackColor);
- this.colorsForm1_08.setSaveBtn_Click(new System.EventHandler(this.colorsForm1_08Changed));
- this.colorsForm1_08.ShowDialog();
- }
- private void colorsForm1_08Changed(object sender, EventArgs e)
- {
- this.panelColour1_08.BackColor = this.colorsForm1_08.UserPrimaryColor.ToColor();
- this.colorsForm1_08.Close();
- }
- /// <summary>
- /// 调色板回调函数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ce"></param>
- private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
- {
- }
- private void panelColour08_06_Click(object sender, EventArgs e)
- {
- this.colorsForm08_06.UserPrimaryColor = ColorBgra.FromColor(this.panelColour08_06.BackColor);
- this.colorsForm08_06.setSaveBtn_Click(new System.EventHandler(this.colorsForm08_06Changed));
- this.colorsForm08_06.ShowDialog();
- }
- private void colorsForm08_06Changed(object sender, EventArgs e)
- {
- this.panelColour08_06.BackColor = this.colorsForm08_06.UserPrimaryColor.ToColor();
- this.colorsForm08_06.Close();
- }
- private void panelColour06_04_Click(object sender, EventArgs e)
- {
- this.colorsForm06_04.UserPrimaryColor = ColorBgra.FromColor(this.panelColour06_04.BackColor);
- this.colorsForm06_04.setSaveBtn_Click(new System.EventHandler(this.colorsForm06_04Changed));
- this.colorsForm06_04.ShowDialog();
- }
- private void colorsForm06_04Changed(object sender, EventArgs e)
- {
- this.panelColour06_04.BackColor = this.colorsForm06_04.UserPrimaryColor.ToColor();
- this.colorsForm06_04.Close();
- }
- private void panelColour04_02_Click(object sender, EventArgs e)
- {
- this.colorsForm04_02.UserPrimaryColor = ColorBgra.FromColor(this.panelColour04_02.BackColor);
- this.colorsForm04_02.setSaveBtn_Click(new System.EventHandler(this.colorsForm04_02Changed));
- this.colorsForm04_02.ShowDialog();
- }
- private void colorsForm04_02Changed(object sender, EventArgs e)
- {
- this.panelColour04_02.BackColor = this.colorsForm04_02.UserPrimaryColor.ToColor();
- this.colorsForm04_02.Close();
- }
- private void panelColour02_01_Click(object sender, EventArgs e)
- {
- this.colorsForm02_01.UserPrimaryColor = ColorBgra.FromColor(this.panelColour02_01.BackColor);
- this.colorsForm02_01.setSaveBtn_Click(new System.EventHandler(this.colorsForm02_01Changed));
- this.colorsForm02_01.ShowDialog();
- }
- private void colorsForm02_01Changed(object sender, EventArgs e)
- {
- this.panelColour02_01.BackColor = this.colorsForm02_01.UserPrimaryColor.ToColor();
- this.colorsForm02_01.Close();
- }
- private void panelColour01_0_Click(object sender, EventArgs e)
- {
- this.colorsForm01_0.UserPrimaryColor = ColorBgra.FromColor(this.panelColour01_0.BackColor);
- this.colorsForm01_0.setSaveBtn_Click(new System.EventHandler(this.colorsForm01_0Changed));
- this.colorsForm01_0.ShowDialog();
- }
- private void colorsForm01_0Changed(object sender, EventArgs e)
- {
- this.panelColour01_0.BackColor = this.colorsForm01_0.UserPrimaryColor.ToColor();
- this.colorsForm01_0.Close();
- }
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void btnPreservation_Click(object sender, EventArgs e)
- {
- SpheroidizationLevelDialog.spheroidizationLevelDialog.colour.Clear();
- foreach (Control panel in groupBox2.Controls)
- {
- if (panel is Panel)
- {
-
- SpheroidizationLevelDialog.spheroidizationLevelDialog.colour.Add(panel.Name, panel.BackColor);
- }
- }
- if (SpheroidizationLevelDialog.spheroidizationLevelDialog.checkBox4.Checked)
- {
- SpheroidizationLevelDialog.spheroidizationLevelDialog.DisplayColor();
- SpheroidizationLevelDialog.spheroidizationLevelDialog.documentWorkspace.Refresh();
- }
- this.Close();
- }
- }
- }
|