| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- 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.VermiculateCastIron.GBT26656_2011
- {
- /// <summary>
- /// 颜色设置
- /// </summary>
- internal class VermiculateCastIronSetColorDialog : PdnBaseForm
- {
- private GroupBox groupBox1;
- private GroupBox groupBox2;
- private Label label3;
- private Label label2;
- private Button button2;
- private Button button1;
- private Panel panel1;
- private Panel panel3;
- private Panel panel2;
- private Label label1;
- PaintDotNet.ColorsForm colorsForm1;
- PaintDotNet.ColorsForm colorsForm2;
- PaintDotNet.ColorsForm colorsForm3;
- private VermiculateCastIronGBT26656Classification mainForm;
- public VermiculateCastIronSetColorDialog(VermiculateCastIronGBT26656Classification mainForm)
- {
- this.mainForm = mainForm;
- InitializeComponent();
- InitializeLanguageText();
- InitializeOthers();
- }
- private void InitializeLanguageText()
- {
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- this.button2.Text = PdnResources.GetString("ConfirmLanguageDialog.CancelTB.ActionText");
- this.button1.Text = PdnResources.GetString("Menu.confirm.Text");
- this.groupBox2.Text = PdnResources.GetString("Menu.Colorsetting.text");
- this.label3.Text = PdnResources.GetString("Menu.Typeofvermicular.Text") + ":";
- this.label2.Text = PdnResources.GetString("Menu.massoffloccule.Text") + ":";
- this.label1.Text = PdnResources.GetString("Menu.hballISO945type.Text") + ":";
- this.Text = PdnResources.GetString("Menu.Colorsetting.text");
- }
- private void InitializeComponent()
- {
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.button2 = new System.Windows.Forms.Button();
- this.button1 = new System.Windows.Forms.Button();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.panel3 = new System.Windows.Forms.Panel();
- this.panel2 = new System.Windows.Forms.Panel();
- this.panel1 = new System.Windows.Forms.Panel();
- this.label3 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox1.Controls.Add(this.button2);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Location = new System.Drawing.Point(13, 13);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(360, 49);
- this.groupBox1.TabIndex = 0;
- this.groupBox1.TabStop = false;
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(286, 17);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(58, 22);
- this.button2.TabIndex = 1;
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(206, 17);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(58, 22);
- this.button1.TabIndex = 0;
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // groupBox2
- //
- this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox2.Controls.Add(this.panel3);
- this.groupBox2.Controls.Add(this.panel2);
- this.groupBox2.Controls.Add(this.panel1);
- this.groupBox2.Controls.Add(this.label3);
- this.groupBox2.Controls.Add(this.label2);
- this.groupBox2.Controls.Add(this.label1);
- this.groupBox2.Location = new System.Drawing.Point(13, 69);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(360, 103);
- this.groupBox2.TabIndex = 1;
- this.groupBox2.TabStop = false;
- //
- // panel3
- //
- this.panel3.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panel3.Location = new System.Drawing.Point(255, 76);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(88, 18);
- this.panel3.TabIndex = 5;
- this.panel3.Click += new System.EventHandler(this.panel3_Click);
- //
- // panel2
- //
- this.panel2.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panel2.Location = new System.Drawing.Point(255, 46);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(88, 18);
- this.panel2.TabIndex = 4;
- this.panel2.Click += new System.EventHandler(this.panel2_Click);
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.SystemColors.ButtonHighlight;
- this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panel1.Location = new System.Drawing.Point(255, 16);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(88, 18);
- this.panel1.TabIndex = 3;
- this.panel1.Click += new System.EventHandler(this.panel1_Click);
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(52, 79);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(161, 12);
- this.label3.TabIndex = 2;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(19, 49);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(233, 12);
- this.label2.TabIndex = 1;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(60, 19);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(149, 12);
- this.label1.TabIndex = 0;
- //
- // VermiculateCastIronSetColorDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.ClientSize = new System.Drawing.Size(385, 184);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "VermiculateCastIronSetColorDialog";
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox2, 0);
- this.groupBox1.ResumeLayout(false);
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.ResumeLayout(false);
- }
- private void InitializeOthers()
- {
- 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.panel1.BackColor = this.mainForm.BallColor;
- this.panel2.BackColor = this.mainForm.GroupColor;
- this.panel3.BackColor = this.mainForm.VermicularColor;
- }
- private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
- {
- }
- /// <summary>
- /// 取消按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button2_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 确认按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- this.mainForm.SetVermiculateCastIronColor(this.panel1.BackColor, this.panel2.BackColor, this.panel3.BackColor);
- this.Close();
- }
- /// <summary>
- /// 球状颜色
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void panel1_Click(object sender, EventArgs e)
- {
- this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor);
- this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.colorsForm1Changed));
- this.colorsForm1.ShowDialog();
- }
- private void colorsForm1Changed(object sender, EventArgs e)
- {
- this.panel1.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
- this.colorsForm1.Close();
- }
- /// <summary>
- /// 团状、团絮状颜色
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void panel2_Click(object sender, EventArgs e)
- {
- this.colorsForm2.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
- this.colorsForm2.setSaveBtn_Click(new System.EventHandler(this.colorsForm2Changed));
- this.colorsForm2.ShowDialog();
- }
- private void colorsForm2Changed(object sender, EventArgs e)
- {
- this.panel2.BackColor = this.colorsForm2.UserPrimaryColor.ToColor();
- this.colorsForm2.Close();
- }
- /// <summary>
- /// 蠕虫状颜色
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void panel3_Click(object sender, EventArgs e)
- {
- this.colorsForm3.UserPrimaryColor = ColorBgra.FromColor(this.panel3.BackColor);
- this.colorsForm3.setSaveBtn_Click(new System.EventHandler(this.colorsForm3Changed));
- this.colorsForm3.ShowDialog();
- }
- private void colorsForm3Changed(object sender, EventArgs e)
- {
- this.panel3.BackColor = this.colorsForm3.UserPrimaryColor.ToColor();
- this.colorsForm3.Close();
- }
- }
- }
|