| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446 |
- 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.ISO945
- {
- 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.groupBox2.Text = PdnResources.GetString("Menu.Colorsetting.text");
- 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.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.groupBox2 = new System.Windows.Forms.GroupBox();
- this.panelColour6 = new System.Windows.Forms.Panel();
- this.label4 = new System.Windows.Forms.Label();
- this.panelColour5 = new System.Windows.Forms.Panel();
- this.label5 = new System.Windows.Forms.Label();
- this.panelColour4 = new System.Windows.Forms.Panel();
- this.label6 = new System.Windows.Forms.Label();
- this.panelColour3 = new System.Windows.Forms.Panel();
- this.label3 = new System.Windows.Forms.Label();
- this.panelColour2 = new System.Windows.Forms.Panel();
- this.label2 = new System.Windows.Forms.Label();
- this.panelColour1 = new System.Windows.Forms.Panel();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.btnClose = new System.Windows.Forms.Button();
- this.btnPreservation = new System.Windows.Forms.Button();
- this.groupBox2.SuspendLayout();
- this.groupBox1.SuspendLayout();
- this.SuspendLayout();
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.panelColour6);
- this.groupBox2.Controls.Add(this.label4);
- this.groupBox2.Controls.Add(this.panelColour5);
- this.groupBox2.Controls.Add(this.label5);
- this.groupBox2.Controls.Add(this.panelColour4);
- this.groupBox2.Controls.Add(this.label6);
- this.groupBox2.Controls.Add(this.panelColour3);
- this.groupBox2.Controls.Add(this.label3);
- this.groupBox2.Controls.Add(this.panelColour2);
- this.groupBox2.Controls.Add(this.label2);
- this.groupBox2.Controls.Add(this.panelColour1);
- 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 = 3;
- this.groupBox2.TabStop = false;
- //
- // panelColour6
- //
- this.panelColour6.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour6.Location = new System.Drawing.Point(423, 74);
- this.panelColour6.Name = "panelColour6";
- this.panelColour6.Size = new System.Drawing.Size(70, 28);
- this.panelColour6.TabIndex = 16;
- this.panelColour6.Click += new System.EventHandler(this.panelColour6_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(382, 80);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(35, 14);
- this.label4.TabIndex = 15;
- this.label4.Text = "Ⅵ:";
- //
- // panelColour5
- //
- this.panelColour5.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour5.Location = new System.Drawing.Point(249, 74);
- this.panelColour5.Name = "panelColour5";
- this.panelColour5.Size = new System.Drawing.Size(70, 28);
- this.panelColour5.TabIndex = 14;
- this.panelColour5.Click += new System.EventHandler(this.panelColour5_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(207, 80);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(35, 14);
- this.label5.TabIndex = 13;
- this.label5.Text = "Ⅴ:";
- //
- // panelColour4
- //
- this.panelColour4.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour4.Location = new System.Drawing.Point(76, 74);
- this.panelColour4.Name = "panelColour4";
- this.panelColour4.Size = new System.Drawing.Size(70, 28);
- this.panelColour4.TabIndex = 12;
- this.panelColour4.Click += new System.EventHandler(this.panelColour4_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(33, 80);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(35, 14);
- this.label6.TabIndex = 11;
- this.label6.Text = "Ⅳ:";
- //
- // panelColour3
- //
- this.panelColour3.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour3.Location = new System.Drawing.Point(423, 27);
- this.panelColour3.Name = "panelColour3";
- this.panelColour3.Size = new System.Drawing.Size(70, 28);
- this.panelColour3.TabIndex = 10;
- this.panelColour3.Click += new System.EventHandler(this.panelColour3_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(382, 33);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(35, 14);
- this.label3.TabIndex = 9;
- this.label3.Text = "Ⅲ:";
- //
- // panelColour2
- //
- this.panelColour2.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour2.Location = new System.Drawing.Point(249, 27);
- this.panelColour2.Name = "panelColour2";
- this.panelColour2.Size = new System.Drawing.Size(70, 28);
- this.panelColour2.TabIndex = 8;
- this.panelColour2.Click += new System.EventHandler(this.panelColour2_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(207, 33);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(35, 14);
- this.label2.TabIndex = 7;
- this.label2.Text = "Ⅱ:";
- //
- // panelColour1
- //
- this.panelColour1.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panelColour1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panelColour1.Location = new System.Drawing.Point(76, 27);
- this.panelColour1.Name = "panelColour1";
- this.panelColour1.Size = new System.Drawing.Size(70, 28);
- this.panelColour1.TabIndex = 6;
- this.panelColour1.Click += new System.EventHandler(this.panelColour1_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(33, 33);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(35, 14);
- this.label1.TabIndex = 0;
- this.label1.Text = "Ⅰ:";
- //
- // 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 = 2;
- 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);
- //
- // 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.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.groupBox1.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- #endregion
- private System.Windows.Forms.GroupBox groupBox2;
- private System.Windows.Forms.Panel panelColour6;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Panel panelColour5;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Panel panelColour4;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Panel panelColour3;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Panel panelColour2;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Panel panelColour1;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.Button btnClose;
- private System.Windows.Forms.Button btnPreservation;
- #endregion
- /// <summary>
- /// 调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsForm1;
- PaintDotNet.ColorsForm colorsForm2;
- PaintDotNet.ColorsForm colorsForm3;
- PaintDotNet.ColorsForm colorsForm4;
- PaintDotNet.ColorsForm colorsForm5;
- PaintDotNet.ColorsForm colorsForm6;
- public ColorSetting()
- {
- InitializeComponent();
- InitializeLanguageText();
- InitOtherTools();
- }
- private void InitOtherTools()
- {
- //
- //调色板
- //
- this.colorsForm1 = new ColorsForm();
- this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm2 = new ColorsForm();
- this.colorsForm2.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm2.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm3 = new ColorsForm();
- this.colorsForm3.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm3.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm4 = new ColorsForm();
- this.colorsForm4.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm4.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm5 = new ColorsForm();
- this.colorsForm5.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm5.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm6 = new ColorsForm();
- this.colorsForm6.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm6.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- if (SpheroidizationTypeDialog.spheroidizationTypeDialog.colour != null)
- {
- this.panelColour1.BackColor = SpheroidizationTypeDialog.spheroidizationTypeDialog.colour["panelColour1"]; ;
- this.panelColour2.BackColor = SpheroidizationTypeDialog.spheroidizationTypeDialog.colour["panelColour2"];
- this.panelColour3.BackColor = SpheroidizationTypeDialog.spheroidizationTypeDialog.colour["panelColour3"];
- this.panelColour4.BackColor = SpheroidizationTypeDialog.spheroidizationTypeDialog.colour["panelColour4"];
- this.panelColour5.BackColor = SpheroidizationTypeDialog.spheroidizationTypeDialog.colour["panelColour5"];
- this.panelColour6.BackColor = SpheroidizationTypeDialog.spheroidizationTypeDialog.colour["panelColour6"];
- }
- else
- {
- this.panelColour1.BackColor = Color.Orange;
- this.panelColour2.BackColor = Color.Blue;
- this.panelColour3.BackColor = Color.Green;
- this.panelColour4.BackColor = Color.Pink;
- this.panelColour5.BackColor = Color.Violet;
- this.panelColour6.BackColor = Color.Yellow;
- }
- }
-
- /// <summary>
- /// 调色板回调函数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ce"></param>
- private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
- {
- }
- private void panelColour1_Click(object sender, EventArgs e)
- {
- this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panelColour1.BackColor);
- this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.colorsForm1Changed));
- this.colorsForm1.ShowDialog();
- }
- private void colorsForm1Changed(object sender, EventArgs e)
- {
- this.panelColour1.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
- this.colorsForm1.Close();
- }
- private void panelColour2_Click(object sender, EventArgs e)
- {
- this.colorsForm2.UserPrimaryColor = ColorBgra.FromColor(this.panelColour2.BackColor);
- this.colorsForm2.setSaveBtn_Click(new System.EventHandler(this.colorsForm2Changed));
- this.colorsForm2.ShowDialog();
- }
- private void colorsForm2Changed(object sender, EventArgs e)
- {
- this.panelColour2.BackColor = this.colorsForm2.UserPrimaryColor.ToColor();
- this.colorsForm2.Close();
- }
- private void panelColour3_Click(object sender, EventArgs e)
- {
- this.colorsForm3.UserPrimaryColor = ColorBgra.FromColor(this.panelColour3.BackColor);
- this.colorsForm3.setSaveBtn_Click(new System.EventHandler(this.colorsForm3Changed));
- this.colorsForm3.ShowDialog();
- }
- private void colorsForm3Changed(object sender, EventArgs e)
- {
- this.panelColour3.BackColor = this.colorsForm3.UserPrimaryColor.ToColor();
- this.colorsForm3.Close();
- }
- private void panelColour4_Click(object sender, EventArgs e)
- {
- this.colorsForm4.UserPrimaryColor = ColorBgra.FromColor(this.panelColour4.BackColor);
- this.colorsForm4.setSaveBtn_Click(new System.EventHandler(this.colorsForm4Changed));
- this.colorsForm4.ShowDialog();
- }
- private void colorsForm4Changed(object sender, EventArgs e)
- {
- this.panelColour4.BackColor = this.colorsForm4.UserPrimaryColor.ToColor();
- this.colorsForm4.Close();
- }
- private void panelColour5_Click(object sender, EventArgs e)
- {
- this.colorsForm5.UserPrimaryColor = ColorBgra.FromColor(this.panelColour5.BackColor);
- this.colorsForm5.setSaveBtn_Click(new System.EventHandler(this.colorsForm5Changed));
- this.colorsForm5.ShowDialog();
- }
- private void colorsForm5Changed(object sender, EventArgs e)
- {
- this.panelColour5.BackColor = this.colorsForm5.UserPrimaryColor.ToColor();
- this.colorsForm5.Close();
- }
- private void panelColour6_Click(object sender, EventArgs e)
- {
- this.colorsForm6.UserPrimaryColor = ColorBgra.FromColor(this.panelColour6.BackColor);
- this.colorsForm6.setSaveBtn_Click(new System.EventHandler(this.colorsForm6Changed));
- this.colorsForm6.ShowDialog();
- }
- private void colorsForm6Changed(object sender, EventArgs e)
- {
- this.panelColour6.BackColor = this.colorsForm6.UserPrimaryColor.ToColor();
- this.colorsForm6.Close();
- }
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void btnPreservation_Click(object sender, EventArgs e)
- {
- SpheroidizationTypeDialog.spheroidizationTypeDialog.colour.Clear();
- foreach (Control panel in groupBox2.Controls)
- {
- if (panel is Panel)
- {
- SpheroidizationTypeDialog.spheroidizationTypeDialog.colour.Add(panel.Name, panel.BackColor);
- }
- }
- if (SpheroidizationTypeDialog.spheroidizationTypeDialog.checkBox4.Checked)
- {
- SpheroidizationTypeDialog.spheroidizationTypeDialog.DisplayColor();
- SpheroidizationTypeDialog.spheroidizationTypeDialog.documentWorkspace.Refresh();
- }
- this.Close();
- }
- }
- }
|