123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856 |
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.Base.SettingModel;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace PaintDotNet.DedicatedAnalysis.GrainSize.GBT6394_2017
- {
- public partial class ArbitrationLawPointStyleDialog : Form
- {//参数保存
- #region 控件
- private GroupBox groupBox1;
- private Button button2;
- private GroupBox groupBox2;
- private Label label6;
- private Label label5;
- private Label label4;
- private Label label3;
- private Label label2;
- private Label label1;
- private Panel panel1;
- private RadioButton radioButton1;
- private RadioButton radioButton2;
- private Panel panel2;
- private RadioButton radioButton3;
- private RadioButton radioButton4;
- private Panel panel3;
- private GroupBox groupBox3;
- private Panel panel4;
- private Panel panel5;
- private RadioButton radioButton5;
- private RadioButton radioButton6;
- private Panel panel6;
- private RadioButton radioButton7;
- private RadioButton radioButton8;
- private Label label7;
- private Label label8;
- private Label label9;
- private Label label10;
- private Label label11;
- private Label label12;
- private Button button1;
- #endregion
- /// <summary>
- /// 调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsForm1;
- /// <summary>
- /// 调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsForm2;
- private TrackBar trackBar9;
- private TrackBar trackBar2;
- private TrackBar trackBar1;
- private TrackBar trackBar5;
- private TrackBar trackBar4;
- private TrackBar trackBar3;
- private TextBox textBox9;
- private TextBox textBox2;
- private TextBox textBox1;
- private TextBox textBox5;
- private TextBox textBox3;
- private TextBox textBox4;
- /// <summary>
- /// 调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsForm3;
- public ArbitrationLawPointStyleDialog()
- {
- InitializeComponent();
- InitializeLanguageText();
- GetFromXml();
- //调色板
- 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);
- }
- #region 初始化
- private void InitializeLanguageText()
- {
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- this.button2.Text = PdnResources.GetString("CommonAction.Save");
- this.button1.Text = PdnResources.GetString("Menu.File.Close.Text");
- this.groupBox2.Text = PdnResources.GetString("Menu.0.5sectionstyle.text");
- this.radioButton3.Text = PdnResources.GetString("Menu.Square.text");
- this.radioButton4.Text = PdnResources.GetString("Menu.circular.Text");
- this.radioButton2.Text = PdnResources.GetString("Menu.solid.text");
- this.radioButton1.Text = PdnResources.GetString("Menu.Hollow.text");
- this.label6.Text = PdnResources.GetString("Menu.shape.text") + ":";
- this.label5.Text = PdnResources.GetString("Menu.style.text") + ":";
- this.label4.Text = PdnResources.GetString("Menu.Intercepterror.text") + ":";
- this.label3.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
- this.label2.Text = PdnResources.GetString("Menu.size.text") + ":";
- this.label1.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.groupBox3.Text = PdnResources.GetString("Menu.1sectionstyle.text");
- this.radioButton5.Text = PdnResources.GetString("Menu.Square.text");
- this.radioButton6.Text = PdnResources.GetString("Menu.circular.Text");
- this.radioButton7.Text = PdnResources.GetString("Menu.solid.text");
- this.radioButton8.Text = PdnResources.GetString("Menu.Hollow.text");
- this.label7.Text = PdnResources.GetString("Menu.shape.text") + ":";
- this.label8.Text = PdnResources.GetString("Menu.style.text") + ":";
- this.label9.Text = PdnResources.GetString("Menu.Intercepterror.text") + ":";
- this.label10.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
- this.label11.Text = PdnResources.GetString("Menu.size.text") + ":";
- this.label12.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.Text = PdnResources.GetString("Menu.sectionsstylesettings.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.textBox9 = new System.Windows.Forms.TextBox();
- this.trackBar9 = new System.Windows.Forms.TrackBar();
- this.panel3 = new System.Windows.Forms.Panel();
- this.panel2 = new System.Windows.Forms.Panel();
- this.radioButton3 = new System.Windows.Forms.RadioButton();
- this.radioButton4 = new System.Windows.Forms.RadioButton();
- this.panel1 = new System.Windows.Forms.Panel();
- this.radioButton2 = new System.Windows.Forms.RadioButton();
- this.radioButton1 = new System.Windows.Forms.RadioButton();
- this.label6 = new System.Windows.Forms.Label();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.label5 = new System.Windows.Forms.Label();
- this.trackBar2 = new System.Windows.Forms.TrackBar();
- this.label4 = new System.Windows.Forms.Label();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.trackBar1 = new System.Windows.Forms.TrackBar();
- this.label3 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.panel4 = new System.Windows.Forms.Panel();
- this.panel5 = new System.Windows.Forms.Panel();
- this.radioButton5 = new System.Windows.Forms.RadioButton();
- this.radioButton6 = new System.Windows.Forms.RadioButton();
- this.panel6 = new System.Windows.Forms.Panel();
- this.radioButton7 = new System.Windows.Forms.RadioButton();
- this.radioButton8 = new System.Windows.Forms.RadioButton();
- this.textBox5 = new System.Windows.Forms.TextBox();
- this.trackBar5 = new System.Windows.Forms.TrackBar();
- this.textBox3 = new System.Windows.Forms.TextBox();
- this.textBox4 = new System.Windows.Forms.TextBox();
- this.trackBar4 = new System.Windows.Forms.TrackBar();
- this.trackBar3 = new System.Windows.Forms.TrackBar();
- this.label7 = new System.Windows.Forms.Label();
- this.label8 = new System.Windows.Forms.Label();
- this.label9 = new System.Windows.Forms.Label();
- this.label10 = new System.Windows.Forms.Label();
- this.label11 = new System.Windows.Forms.Label();
- this.label12 = new System.Windows.Forms.Label();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar9)).BeginInit();
- this.panel2.SuspendLayout();
- this.panel1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
- this.groupBox3.SuspendLayout();
- this.panel5.SuspendLayout();
- this.panel6.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar5)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar4)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar3)).BeginInit();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.button2);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Location = new System.Drawing.Point(12, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(500, 54);
- this.groupBox1.TabIndex = 2;
- this.groupBox1.TabStop = false;
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(414, 16);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(70, 28);
- 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(325, 16);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(70, 28);
- this.button1.TabIndex = 0;
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.textBox9);
- this.groupBox2.Controls.Add(this.trackBar9);
- this.groupBox2.Controls.Add(this.panel3);
- this.groupBox2.Controls.Add(this.panel2);
- this.groupBox2.Controls.Add(this.panel1);
- this.groupBox2.Controls.Add(this.label6);
- this.groupBox2.Controls.Add(this.textBox2);
- this.groupBox2.Controls.Add(this.label5);
- this.groupBox2.Controls.Add(this.trackBar2);
- this.groupBox2.Controls.Add(this.label4);
- this.groupBox2.Controls.Add(this.textBox1);
- this.groupBox2.Controls.Add(this.trackBar1);
- 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(12, 72);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(500, 120);
- this.groupBox2.TabIndex = 3;
- this.groupBox2.TabStop = false;
- //
- // textBox9
- //
- this.textBox9.Location = new System.Drawing.Point(129, 67);
- this.textBox9.Name = "textBox9";
- this.textBox9.Size = new System.Drawing.Size(31, 21);
- this.textBox9.TabIndex = 37;
- this.textBox9.TextChanged += new System.EventHandler(this.textBox9_TextChanged);
- //
- // trackBar9
- //
- this.trackBar9.LargeChange = 1;
- this.trackBar9.Location = new System.Drawing.Point(55, 68);
- this.trackBar9.Maximum = 500;
- this.trackBar9.Name = "trackBar9";
- this.trackBar9.Size = new System.Drawing.Size(78, 45);
- this.trackBar9.TabIndex = 37;
- this.trackBar9.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar9.Value = 1;
- this.trackBar9.ValueChanged += new System.EventHandler(this.trackBar9_ValueChanged);
- //
- // panel3
- //
- this.panel3.Location = new System.Drawing.Point(62, 24);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(102, 22);
- this.panel3.TabIndex = 25;
- this.panel3.Click += new System.EventHandler(this.panel3_Click);
- //
- // panel2
- //
- this.panel2.Controls.Add(this.radioButton3);
- this.panel2.Controls.Add(this.radioButton4);
- this.panel2.Location = new System.Drawing.Point(368, 64);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(115, 30);
- this.panel2.TabIndex = 24;
- //
- // radioButton3
- //
- this.radioButton3.AutoSize = true;
- this.radioButton3.Location = new System.Drawing.Point(62, 6);
- this.radioButton3.Name = "radioButton3";
- this.radioButton3.Size = new System.Drawing.Size(47, 16);
- this.radioButton3.TabIndex = 1;
- this.radioButton3.TabStop = true;
- this.radioButton3.UseVisualStyleBackColor = true;
- //
- // radioButton4
- //
- this.radioButton4.AutoSize = true;
- this.radioButton4.Location = new System.Drawing.Point(9, 6);
- this.radioButton4.Name = "radioButton4";
- this.radioButton4.Size = new System.Drawing.Size(47, 16);
- this.radioButton4.TabIndex = 0;
- this.radioButton4.TabStop = true;
- this.radioButton4.UseVisualStyleBackColor = true;
- //
- // panel1
- //
- this.panel1.Controls.Add(this.radioButton2);
- this.panel1.Controls.Add(this.radioButton1);
- this.panel1.Location = new System.Drawing.Point(368, 20);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(115, 30);
- this.panel1.TabIndex = 23;
- //
- // radioButton2
- //
- this.radioButton2.AutoSize = true;
- this.radioButton2.Location = new System.Drawing.Point(62, 6);
- this.radioButton2.Name = "radioButton2";
- this.radioButton2.Size = new System.Drawing.Size(47, 16);
- this.radioButton2.TabIndex = 1;
- this.radioButton2.TabStop = true;
- this.radioButton2.UseVisualStyleBackColor = true;
- //
- // radioButton1
- //
- this.radioButton1.AutoSize = true;
- this.radioButton1.Location = new System.Drawing.Point(9, 6);
- this.radioButton1.Name = "radioButton1";
- this.radioButton1.Size = new System.Drawing.Size(47, 16);
- this.radioButton1.TabIndex = 0;
- this.radioButton1.TabStop = true;
- this.radioButton1.UseVisualStyleBackColor = true;
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(332, 71);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(41, 12);
- this.label6.TabIndex = 22;
- //
- // textBox2
- //
- this.textBox2.Location = new System.Drawing.Point(299, 68);
- this.textBox2.Name = "textBox2";
- this.textBox2.Size = new System.Drawing.Size(31, 21);
- this.textBox2.TabIndex = 30;
- this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(332, 28);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(41, 12);
- this.label5.TabIndex = 21;
- //
- // trackBar2
- //
- this.trackBar2.LargeChange = 1;
- this.trackBar2.Location = new System.Drawing.Point(225, 68);
- this.trackBar2.Maximum = 500;
- this.trackBar2.Name = "trackBar2";
- this.trackBar2.Size = new System.Drawing.Size(78, 45);
- this.trackBar2.TabIndex = 30;
- this.trackBar2.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar2.Value = 1;
- this.trackBar2.ValueChanged += new System.EventHandler(this.trackBar2_ValueChanged);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(170, 71);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(65, 12);
- this.label4.TabIndex = 20;
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(299, 24);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(31, 21);
- this.textBox1.TabIndex = 29;
- this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
- //
- // trackBar1
- //
- this.trackBar1.LargeChange = 1;
- this.trackBar1.Location = new System.Drawing.Point(225, 24);
- this.trackBar1.Maximum = 500;
- this.trackBar1.Name = "trackBar1";
- this.trackBar1.Size = new System.Drawing.Size(78, 45);
- this.trackBar1.TabIndex = 29;
- this.trackBar1.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar1.Value = 1;
- this.trackBar1.ValueChanged += new System.EventHandler(this.trackBar1_ValueChanged);
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(194, 28);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(41, 12);
- this.label3.TabIndex = 19;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(23, 71);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(41, 12);
- this.label2.TabIndex = 18;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(23, 28);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(41, 12);
- this.label1.TabIndex = 17;
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.panel4);
- this.groupBox3.Controls.Add(this.panel5);
- this.groupBox3.Controls.Add(this.panel6);
- this.groupBox3.Controls.Add(this.textBox5);
- this.groupBox3.Controls.Add(this.trackBar5);
- this.groupBox3.Controls.Add(this.textBox3);
- this.groupBox3.Controls.Add(this.textBox4);
- this.groupBox3.Controls.Add(this.trackBar4);
- this.groupBox3.Controls.Add(this.trackBar3);
- this.groupBox3.Controls.Add(this.label7);
- this.groupBox3.Controls.Add(this.label8);
- this.groupBox3.Controls.Add(this.label9);
- this.groupBox3.Controls.Add(this.label10);
- this.groupBox3.Controls.Add(this.label11);
- this.groupBox3.Controls.Add(this.label12);
- this.groupBox3.Location = new System.Drawing.Point(12, 198);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(500, 116);
- this.groupBox3.TabIndex = 28;
- this.groupBox3.TabStop = false;
- //
- // panel4
- //
- this.panel4.Location = new System.Drawing.Point(62, 24);
- this.panel4.Name = "panel4";
- this.panel4.Size = new System.Drawing.Size(102, 22);
- this.panel4.TabIndex = 25;
- this.panel4.Click += new System.EventHandler(this.panel4_Click);
- //
- // panel5
- //
- this.panel5.Controls.Add(this.radioButton5);
- this.panel5.Controls.Add(this.radioButton6);
- this.panel5.Location = new System.Drawing.Point(368, 65);
- this.panel5.Name = "panel5";
- this.panel5.Size = new System.Drawing.Size(115, 30);
- this.panel5.TabIndex = 24;
- //
- // radioButton5
- //
- this.radioButton5.AutoSize = true;
- this.radioButton5.Location = new System.Drawing.Point(62, 6);
- this.radioButton5.Name = "radioButton5";
- this.radioButton5.Size = new System.Drawing.Size(47, 16);
- this.radioButton5.TabIndex = 1;
- this.radioButton5.TabStop = true;
- this.radioButton5.UseVisualStyleBackColor = true;
- //
- // radioButton6
- //
- this.radioButton6.AutoSize = true;
- this.radioButton6.Location = new System.Drawing.Point(9, 6);
- this.radioButton6.Name = "radioButton6";
- this.radioButton6.Size = new System.Drawing.Size(47, 16);
- this.radioButton6.TabIndex = 0;
- this.radioButton6.TabStop = true;
- this.radioButton6.UseVisualStyleBackColor = true;
- //
- // panel6
- //
- this.panel6.Controls.Add(this.radioButton7);
- this.panel6.Controls.Add(this.radioButton8);
- this.panel6.Location = new System.Drawing.Point(368, 20);
- this.panel6.Name = "panel6";
- this.panel6.Size = new System.Drawing.Size(115, 30);
- this.panel6.TabIndex = 23;
- //
- // radioButton7
- //
- this.radioButton7.AutoSize = true;
- this.radioButton7.Location = new System.Drawing.Point(62, 6);
- this.radioButton7.Name = "radioButton7";
- this.radioButton7.Size = new System.Drawing.Size(47, 16);
- this.radioButton7.TabIndex = 1;
- this.radioButton7.TabStop = true;
- this.radioButton7.UseVisualStyleBackColor = true;
- //
- // radioButton8
- //
- this.radioButton8.AutoSize = true;
- this.radioButton8.Location = new System.Drawing.Point(9, 6);
- this.radioButton8.Name = "radioButton8";
- this.radioButton8.Size = new System.Drawing.Size(47, 16);
- this.radioButton8.TabIndex = 0;
- this.radioButton8.TabStop = true;
- this.radioButton8.UseVisualStyleBackColor = true;
- //
- // textBox5
- //
- this.textBox5.Location = new System.Drawing.Point(129, 68);
- this.textBox5.Name = "textBox5";
- this.textBox5.Size = new System.Drawing.Size(31, 21);
- this.textBox5.TabIndex = 33;
- this.textBox5.TextChanged += new System.EventHandler(this.textBox5_TextChanged);
- //
- // trackBar5
- //
- this.trackBar5.LargeChange = 1;
- this.trackBar5.Location = new System.Drawing.Point(55, 68);
- this.trackBar5.Maximum = 500;
- this.trackBar5.Name = "trackBar5";
- this.trackBar5.Size = new System.Drawing.Size(78, 45);
- this.trackBar5.TabIndex = 33;
- this.trackBar5.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar5.Value = 1;
- this.trackBar5.ValueChanged += new System.EventHandler(this.trackBar5_ValueChanged);
- //
- // textBox3
- //
- this.textBox3.Location = new System.Drawing.Point(299, 68);
- this.textBox3.Name = "textBox3";
- this.textBox3.Size = new System.Drawing.Size(31, 21);
- this.textBox3.TabIndex = 31;
- this.textBox3.TextChanged += new System.EventHandler(this.textBox3_TextChanged);
- //
- // textBox4
- //
- this.textBox4.Location = new System.Drawing.Point(299, 23);
- this.textBox4.Name = "textBox4";
- this.textBox4.Size = new System.Drawing.Size(31, 21);
- this.textBox4.TabIndex = 32;
- this.textBox4.TextChanged += new System.EventHandler(this.textBox4_TextChanged);
- //
- // trackBar4
- //
- this.trackBar4.LargeChange = 1;
- this.trackBar4.Location = new System.Drawing.Point(225, 23);
- this.trackBar4.Maximum = 500;
- this.trackBar4.Name = "trackBar4";
- this.trackBar4.Size = new System.Drawing.Size(78, 45);
- this.trackBar4.TabIndex = 32;
- this.trackBar4.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar4.Value = 1;
- this.trackBar4.ValueChanged += new System.EventHandler(this.trackBar4_ValueChanged);
- //
- // trackBar3
- //
- this.trackBar3.LargeChange = 1;
- this.trackBar3.Location = new System.Drawing.Point(225, 68);
- this.trackBar3.Maximum = 500;
- this.trackBar3.Name = "trackBar3";
- this.trackBar3.Size = new System.Drawing.Size(78, 45);
- this.trackBar3.TabIndex = 31;
- this.trackBar3.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar3.Value = 1;
- this.trackBar3.ValueChanged += new System.EventHandler(this.trackBar3_ValueChanged);
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(332, 72);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(41, 12);
- this.label7.TabIndex = 22;
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(332, 28);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(41, 12);
- this.label8.TabIndex = 21;
- //
- // label9
- //
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(170, 72);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(65, 12);
- this.label9.TabIndex = 20;
- //
- // label10
- //
- this.label10.AutoSize = true;
- this.label10.Location = new System.Drawing.Point(194, 28);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(41, 12);
- this.label10.TabIndex = 19;
- //
- // label11
- //
- this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(23, 72);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(41, 12);
- this.label11.TabIndex = 18;
- //
- // label12
- //
- this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(23, 28);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(41, 12);
- this.label12.TabIndex = 17;
- //
- // ArbitrationLawPointStyleDialog
- //
- this.ClientSize = new System.Drawing.Size(522, 323);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.MaximumSize = new System.Drawing.Size(538, 362);
- this.MinimumSize = new System.Drawing.Size(538, 362);
- this.Name = "ArbitrationLawPointStyleDialog";
- this.groupBox1.ResumeLayout(false);
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar9)).EndInit();
- this.panel2.ResumeLayout(false);
- this.panel2.PerformLayout();
- this.panel1.ResumeLayout(false);
- this.panel1.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- this.panel5.ResumeLayout(false);
- this.panel5.PerformLayout();
- this.panel6.ResumeLayout(false);
- this.panel6.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar5)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar4)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar3)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- /// <summary>
- /// Xml获取初始数据
- /// </summary>
- private void GetFromXml()
- {
- ArbitrationLawCutOffPointModel grainCutOffPointStyleModel = XmlSerializeHelper.DESerializer<ArbitrationLawCutOffPointModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\ArbitrationLawCutOffPointModel.xml", FileMode.Open));
- if (grainCutOffPointStyleModel.CutOffPointStyle1 != null
- && grainCutOffPointStyleModel.CutOffPointStyle2 != null)
- {
- // 0.5截点
- this.panel3.BackColor = Color.FromArgb(grainCutOffPointStyleModel.CutOffPointStyle1.pointColor);
- this.trackBar1.Value = grainCutOffPointStyleModel.CutOffPointStyle1.pointWidth;
- this.textBox1.Text = grainCutOffPointStyleModel.CutOffPointStyle1.pointWidth.ToString();
- if (grainCutOffPointStyleModel.CutOffPointStyle1.pointStyle == 0)
- this.radioButton1.Checked = true;
- else
- this.radioButton2.Checked = true;
- this.trackBar9.Value = grainCutOffPointStyleModel.CutOffPointStyle1.pointDiameter;
- this.textBox9.Text = grainCutOffPointStyleModel.CutOffPointStyle1.pointDiameter.ToString();
- this.trackBar2.Value = grainCutOffPointStyleModel.CutOffPointStyle1.pointError;
- this.textBox2.Text = grainCutOffPointStyleModel.CutOffPointStyle1.pointError.ToString();
- if (grainCutOffPointStyleModel.CutOffPointStyle1.pointshape == 0)
- this.radioButton4.Checked = true;
- else
- this.radioButton3.Checked = true;
- // 1截点
- this.panel4.BackColor = Color.FromArgb(grainCutOffPointStyleModel.CutOffPointStyle2.pointColor);
- this.trackBar4.Value = grainCutOffPointStyleModel.CutOffPointStyle2.pointWidth;
- this.textBox4.Text = grainCutOffPointStyleModel.CutOffPointStyle2.pointWidth.ToString();
- if (grainCutOffPointStyleModel.CutOffPointStyle2.pointStyle == 0)
- this.radioButton8.Checked = true;
- else
- this.radioButton7.Checked = true;
- this.trackBar5.Value = grainCutOffPointStyleModel.CutOffPointStyle2.pointDiameter;
- this.textBox5.Text = grainCutOffPointStyleModel.CutOffPointStyle2.pointDiameter.ToString();
- this.trackBar3.Value = grainCutOffPointStyleModel.CutOffPointStyle2.pointError;
- this.textBox3.Text = grainCutOffPointStyleModel.CutOffPointStyle2.pointError.ToString();
- if (grainCutOffPointStyleModel.CutOffPointStyle2.pointshape == 0)
- this.radioButton6.Checked = true;
- else
- this.radioButton5.Checked = true;
- }
- }
- private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
- {
- }
- private void panel3_Click(object sender, EventArgs e)
- {
- this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panel3.BackColor);
- this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.panel3Changed));
- this.colorsForm1.ShowDialog();
- }
- private void panel3Changed(object sender, EventArgs e)
- {
- this.panel3.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
- this.colorsForm1.Close();
- }
- private void panel4_Click(object sender, EventArgs e)
- {
- this.colorsForm2.UserPrimaryColor = ColorBgra.FromColor(this.panel4.BackColor);
- this.colorsForm2.setSaveBtn_Click(new System.EventHandler(this.panel4Changed));
- this.colorsForm2.ShowDialog();
- }
- private void panel4Changed(object sender, EventArgs e)
- {
- this.panel4.BackColor = this.colorsForm2.UserPrimaryColor.ToColor();
- this.colorsForm2.Close();
- }
- /// <summary>
- /// 关闭按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 保存按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button2_Click(object sender, EventArgs e)
- {
- ArbitrationLawCutOffPointModel grainCutOffPointStyleModel = new ArbitrationLawCutOffPointModel();
- grainCutOffPointStyleModel.CutOffPointStyle1 = new ArbitrationLawCutOffPointModel.CutOffPointStyle();
- grainCutOffPointStyleModel.CutOffPointStyle2 = new ArbitrationLawCutOffPointModel.CutOffPointStyle();
- // 0.5截点
- grainCutOffPointStyleModel.CutOffPointStyle1.pointColor = Convert.ToInt32(this.panel3.BackColor.ToArgb());
- grainCutOffPointStyleModel.CutOffPointStyle1.pointWidth = Convert.ToInt32(this.trackBar1.Value);
- if (this.radioButton1.Checked)
- grainCutOffPointStyleModel.CutOffPointStyle1.pointStyle = 0;
- else if (this.radioButton2.Checked)
- grainCutOffPointStyleModel.CutOffPointStyle1.pointStyle = 1;
- grainCutOffPointStyleModel.CutOffPointStyle1.pointDiameter = Convert.ToInt32(this.trackBar9.Value);
- grainCutOffPointStyleModel.CutOffPointStyle1.pointError = Convert.ToInt32(this.trackBar2.Value);
- if (this.radioButton4.Checked)
- grainCutOffPointStyleModel.CutOffPointStyle1.pointshape = 0;
- else if (this.radioButton3.Checked)
- grainCutOffPointStyleModel.CutOffPointStyle1.pointshape = 1;
- // 1截点
- grainCutOffPointStyleModel.CutOffPointStyle2.pointColor = Convert.ToInt32(this.panel4.BackColor.ToArgb());
- grainCutOffPointStyleModel.CutOffPointStyle2.pointWidth = Convert.ToInt32(this.trackBar4.Value);
- if (this.radioButton8.Checked)
- grainCutOffPointStyleModel.CutOffPointStyle2.pointStyle = 0;
- else if (this.radioButton7.Checked)
- grainCutOffPointStyleModel.CutOffPointStyle2.pointStyle = 1;
- grainCutOffPointStyleModel.CutOffPointStyle2.pointDiameter = Convert.ToInt32(this.trackBar5.Value);
- grainCutOffPointStyleModel.CutOffPointStyle2.pointError = Convert.ToInt32(this.trackBar3.Value);
- if (this.radioButton6.Checked)
- grainCutOffPointStyleModel.CutOffPointStyle2.pointshape = 0;
- else if (this.radioButton5.Checked)
- grainCutOffPointStyleModel.CutOffPointStyle2.pointshape = 1;
- //以下保存xml文件信息
- string stageModelXml = XmlSerializeHelper.XmlSerialize<ArbitrationLawCutOffPointModel>(grainCutOffPointStyleModel);
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\ArbitrationLawCutOffPointModel.xml";
- if( FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Successfullysaved.text")+"!");
- }
- GrainSizeArbitrationLawDialog grainSizeArbitrationLawDialog = (GrainSizeArbitrationLawDialog)this.Owner;
- grainSizeArbitrationLawDialog.UpdateCupOffPointStyle();
- }
- private void trackBar1_ValueChanged(object sender, EventArgs e)
- {
- this.textBox1.Text = this.trackBar1.Value.ToString();
- }
- private void trackBar9_ValueChanged(object sender, EventArgs e)
- {
- this.textBox9.Text = this.trackBar9.Value.ToString();
- }
- private void trackBar2_ValueChanged(object sender, EventArgs e)
- {
- this.textBox2.Text = this.trackBar2.Value.ToString();
- }
- private void trackBar4_ValueChanged(object sender, EventArgs e)
- {
- this.textBox4.Text = this.trackBar4.Value.ToString();
- }
- private void trackBar5_ValueChanged(object sender, EventArgs e)
- {
- this.textBox5.Text = this.trackBar5.Value.ToString();
- }
- private void trackBar3_ValueChanged(object sender, EventArgs e)
- {
- this.textBox3.Text = this.trackBar3.Value.ToString();
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.textBox1.Text) || Convert.ToInt32(this.textBox1.Text) < 0)
- this.textBox1.Text = "0";
- if (Convert.ToInt32(this.textBox1.Text) > 500)
- this.textBox1.Text = "500";
- this.trackBar1.Value = Convert.ToInt32(this.textBox1.Text);
- }
- private void textBox9_TextChanged(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.textBox9.Text) || Convert.ToInt32(this.textBox9.Text) < 0)
- this.textBox9.Text = "0";
- if (Convert.ToInt32(this.textBox9.Text) > 500)
- this.textBox9.Text = "500";
- this.trackBar9.Value = Convert.ToInt32(this.textBox9.Text);
- }
- private void textBox2_TextChanged(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.textBox2.Text) || Convert.ToInt32(this.textBox2.Text) < 0)
- this.textBox2.Text = "0";
- if (Convert.ToInt32(this.textBox2.Text) > 500)
- this.textBox2.Text = "500";
- this.trackBar2.Value = Convert.ToInt32(this.textBox2.Text);
- }
- private void textBox4_TextChanged(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.textBox4.Text) || Convert.ToInt32(this.textBox4.Text) < 0)
- this.textBox4.Text = "0";
- if (Convert.ToInt32(this.textBox4.Text) > 500)
- this.textBox4.Text = "500";
- this.trackBar4.Value = Convert.ToInt32(this.textBox4.Text);
- }
- private void textBox5_TextChanged(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.textBox5.Text) || Convert.ToInt32(this.textBox5.Text) < 0)
- this.textBox5.Text = "0";
- if (Convert.ToInt32(this.textBox5.Text) > 500)
- this.textBox5.Text = "500";
- this.trackBar5.Value = Convert.ToInt32(this.textBox5.Text);
- }
- private void textBox3_TextChanged(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.textBox3.Text) || Convert.ToInt32(this.textBox3.Text) < 0)
- this.textBox3.Text = "0";
- if (Convert.ToInt32(this.textBox3.Text) > 500)
- this.textBox3.Text = "500";
- this.trackBar3.Value = Convert.ToInt32(this.textBox3.Text);
- }
- }
- }
|