1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132 |
- using Metis.DedicatedAnalysis.Porosity.Model;
- using PaintDotNet;
- using PaintDotNet.Annotation;
- using PaintDotNet.Annotation.Enum;
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.Base.DedicatedAnalysis.Porosity;
- using PaintDotNet.DedicatedAnalysis.Porosity;
- using PaintDotNet.DedicatedAnalysis.Porosity.PV6093;
- using System;
- 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 Metis.DedicatedAnalysis.Porosity
- {
- internal class PorosityViewSetting : PdnBaseForm
- {
- private GroupBox groupBox_operating;
- private Button button2;
- private Button button1;
- private GroupBox groupBox_img;
- protected ListBox lstView_img;
- private GroupBox groupBox1;
- private Label label_showBinaryColor;
- private Panel panel_showBinaryColor;
- private GroupBox groupBox6;
- private NumericUpDown numericUpDown4;
- private NumericUpDown numericUpDown3;
- private Label label5;
- private Label label6;
- private GroupBox groupBox4;
- private NumericUpDown numericUpDown6;
- private NumericUpDown numericUpDown5;
- private RadioButton radioButton2;
- private RadioButton radioButton1;
- private Label label4;
- private Label label3;
- private GroupBox groupBox3;
- private Panel panel5;
- private Panel panel6;
- private Panel panel4;
- private Panel panel3;
- private Panel panel2;
- private Panel panel1;
- private Panel panel9;
- private Panel panel8;
- private Panel panel7;
- private Panel panel11;
- private Panel panel10;
- private Panel panel12;
- private Button btn_saveresult;
- private viewSetting ViewSetting;
- private int chooseIndex;
- private List<DrawObject> drawObjectList;
- private List<string> nameList;
- private ColorsForm lineColorsFormGrid;
- private ColorsForm viewColorsFormGrid;
- private int cilckNum;
- private PorosityStandardDialog pform;
- private double pxPerUnit;
- /// <summary>
- /// 旧中心点X坐标值
- /// </summary>
- private int numericUpDown3Old;
- /// <summary>
- /// 旧中心点Y坐标值
- /// </summary>
- private int numericUpDown4Old;
- private Label label1;
- /// <summary>
- /// 是否是保存 1 否 2 是
- /// </summary>
- private int notSave = 1;
- public PorosityViewSetting(List<DrawObject> drawObjectList, List<string> nameList, int chooseIndex, viewSetting ViewSetting, PorosityStandardDialog porositysStandard, double pxPerUnit)
- {
- this.chooseIndex = chooseIndex;
- this.drawObjectList = drawObjectList;
- this.nameList = nameList;
- this.pxPerUnit = pxPerUnit;
- this.lineColorsFormGrid = new ColorsForm();
- this.lineColorsFormGrid.StartPosition = FormStartPosition.CenterScreen;
- this.viewColorsFormGrid = new ColorsForm();
- this.viewColorsFormGrid.StartPosition = FormStartPosition.CenterScreen;
- this.pform = porositysStandard;
- this.ViewSetting = ViewSetting;
- InitializeComponent();
- InitializeLanguageText();
- setData();
- foreach (var s in this.nameList)
- {
- this.lstView_img.Items.Add(s);
- }
- this.lstView_img.SelectedIndex = chooseIndex;
- //this.numericUpDown3.ValueChanged += new EventHandler(this.numericUpDown3_ValueChange);
- //this.numericUpDown4.ValueChanged += new EventHandler(this.numericUpDown4_ValueChange);
- //this.numericUpDown5.ValueChanged += new EventHandler(this.numericUpDown5_ValueChange);
- //this.numericUpDown6.ValueChanged += new EventHandler(this.numericUpDown6_ValueChange);
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PorosityViewSettingClosing);
- }
- private void InitializeLanguageText()
- {
- this.groupBox_operating.Text = PdnResources.GetString("Menu.operation.text");
- this.button2.Text = PdnResources.GetString("Menu.ViewSetting.DeleteFieldOfView.Text");
- this.button1.Text = PdnResources.GetString("Menu.Theemptyview.Text");
- this.btn_saveresult.Text = PdnResources.GetString("Menu.Savethechanges.Text");
- this.groupBox_img.Text = PdnResources.GetString("Menu.Fieldofviewlisthasbeenadded.Text");
- this.groupBox1.Text = PdnResources.GetString("Menu.Theviewattribute.Text");
- this.groupBox6.Text = PdnResources.GetString("Menu.position.text");
- this.label5.Text = PdnResources.GetString("Menu.viewsetting.Modifyview.Centerpoint.text") + "Y";
- this.label6.Text = PdnResources.GetString("Menu.viewsetting.Modifyview.Centerpoint.text") + "X";
- this.groupBox4.Text = PdnResources.GetString("Menu.Edit.ActualSize.Text");
- this.radioButton2.Text = PdnResources.GetString("Menu.area.text");
- this.radioButton1.Text = PdnResources.GetString("Menu.diameter.text");
- this.groupBox3.Text = PdnResources.GetString("Menu.DefaultcolorSettings.Text");
- this.label1.Text = PdnResources.GetString("Menu.color.text");
- this.Text = PdnResources.GetString("Menu.ViewSetting.Text");
- }
- private void InitializeComponent()
- {
- this.groupBox_operating = new System.Windows.Forms.GroupBox();
- this.button2 = new System.Windows.Forms.Button();
- this.button1 = new System.Windows.Forms.Button();
- this.btn_saveresult = new System.Windows.Forms.Button();
- this.groupBox_img = new System.Windows.Forms.GroupBox();
- this.lstView_img = new System.Windows.Forms.ListBox();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.groupBox6 = new System.Windows.Forms.GroupBox();
- this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
- this.label5 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.numericUpDown6 = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown5 = new System.Windows.Forms.NumericUpDown();
- this.radioButton2 = new System.Windows.Forms.RadioButton();
- this.radioButton1 = new System.Windows.Forms.RadioButton();
- this.label4 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.panel_showBinaryColor = new System.Windows.Forms.Panel();
- this.label_showBinaryColor = new System.Windows.Forms.Label();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.panel12 = new System.Windows.Forms.Panel();
- this.panel11 = new System.Windows.Forms.Panel();
- this.panel10 = new System.Windows.Forms.Panel();
- this.panel9 = new System.Windows.Forms.Panel();
- this.panel8 = new System.Windows.Forms.Panel();
- this.panel7 = new System.Windows.Forms.Panel();
- this.panel5 = new System.Windows.Forms.Panel();
- this.panel6 = new System.Windows.Forms.Panel();
- this.panel4 = new System.Windows.Forms.Panel();
- this.panel3 = new System.Windows.Forms.Panel();
- this.panel2 = new System.Windows.Forms.Panel();
- this.panel1 = new System.Windows.Forms.Panel();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox_operating.SuspendLayout();
- this.groupBox_img.SuspendLayout();
- this.groupBox1.SuspendLayout();
- this.groupBox6.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
- this.groupBox4.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit();
- this.groupBox3.SuspendLayout();
- this.SuspendLayout();
- //
- // groupBox_operating
- //
- this.groupBox_operating.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox_operating.Controls.Add(this.button2);
- this.groupBox_operating.Controls.Add(this.button1);
- this.groupBox_operating.Controls.Add(this.btn_saveresult);
- this.groupBox_operating.Location = new System.Drawing.Point(12, 12);
- this.groupBox_operating.Name = "groupBox_operating";
- this.groupBox_operating.Size = new System.Drawing.Size(579, 53);
- this.groupBox_operating.TabIndex = 13;
- this.groupBox_operating.TabStop = false;
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(383, 15);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(75, 23);
- this.button2.TabIndex = 4;
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(293, 15);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 3;
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // btn_saveresult
- //
- this.btn_saveresult.Location = new System.Drawing.Point(472, 15);
- this.btn_saveresult.Name = "btn_saveresult";
- this.btn_saveresult.Size = new System.Drawing.Size(75, 23);
- this.btn_saveresult.TabIndex = 2;
- this.btn_saveresult.UseVisualStyleBackColor = true;
- this.btn_saveresult.Click += new System.EventHandler(this.btn_saveresult_Click);
- //
- // groupBox_img
- //
- this.groupBox_img.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox_img.Controls.Add(this.lstView_img);
- this.groupBox_img.Location = new System.Drawing.Point(12, 72);
- this.groupBox_img.Margin = new System.Windows.Forms.Padding(4);
- this.groupBox_img.Name = "groupBox_img";
- this.groupBox_img.Padding = new System.Windows.Forms.Padding(4);
- this.groupBox_img.Size = new System.Drawing.Size(158, 259);
- this.groupBox_img.TabIndex = 14;
- this.groupBox_img.TabStop = false;
- //
- // lstView_img
- //
- this.lstView_img.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.lstView_img.ItemHeight = 12;
- this.lstView_img.Location = new System.Drawing.Point(8, 26);
- this.lstView_img.Margin = new System.Windows.Forms.Padding(4);
- this.lstView_img.Name = "lstView_img";
- this.lstView_img.Size = new System.Drawing.Size(140, 220);
- this.lstView_img.TabIndex = 0;
- this.lstView_img.SelectedIndexChanged += new System.EventHandler(this.lstView_img_SelectedIndexChanged);
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox1.Controls.Add(this.label1);
- this.groupBox1.Controls.Add(this.groupBox6);
- this.groupBox1.Controls.Add(this.groupBox4);
- this.groupBox1.Controls.Add(this.panel_showBinaryColor);
- this.groupBox1.Controls.Add(this.label_showBinaryColor);
- this.groupBox1.Location = new System.Drawing.Point(177, 72);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(414, 259);
- this.groupBox1.TabIndex = 36;
- this.groupBox1.TabStop = false;
- //
- // groupBox6
- //
- this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox6.Controls.Add(this.numericUpDown4);
- this.groupBox6.Controls.Add(this.numericUpDown3);
- this.groupBox6.Controls.Add(this.label5);
- this.groupBox6.Controls.Add(this.label6);
- this.groupBox6.Location = new System.Drawing.Point(15, 168);
- this.groupBox6.Name = "groupBox6";
- this.groupBox6.Size = new System.Drawing.Size(385, 47);
- this.groupBox6.TabIndex = 42;
- this.groupBox6.TabStop = false;
- //
- // numericUpDown4
- //
- this.numericUpDown4.Location = new System.Drawing.Point(269, 15);
- this.numericUpDown4.Maximum = new decimal(new int[] {
- 2147483646,
- 0,
- 0,
- 0});
- this.numericUpDown4.Name = "numericUpDown4";
- this.numericUpDown4.Size = new System.Drawing.Size(95, 21);
- this.numericUpDown4.TabIndex = 12;
- //
- // numericUpDown3
- //
- this.numericUpDown3.Location = new System.Drawing.Point(77, 15);
- this.numericUpDown3.Maximum = new decimal(new int[] {
- 2147483646,
- 0,
- 0,
- 0});
- this.numericUpDown3.Name = "numericUpDown3";
- this.numericUpDown3.Size = new System.Drawing.Size(98, 21);
- this.numericUpDown3.TabIndex = 11;
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(200, 19);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(47, 12);
- this.label5.TabIndex = 11;
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(11, 19);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(47, 12);
- this.label6.TabIndex = 9;
- //
- // groupBox4
- //
- this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox4.Controls.Add(this.numericUpDown6);
- this.groupBox4.Controls.Add(this.numericUpDown5);
- this.groupBox4.Controls.Add(this.radioButton2);
- this.groupBox4.Controls.Add(this.radioButton1);
- this.groupBox4.Controls.Add(this.label4);
- this.groupBox4.Controls.Add(this.label3);
- this.groupBox4.Location = new System.Drawing.Point(16, 85);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(383, 53);
- this.groupBox4.TabIndex = 41;
- this.groupBox4.TabStop = false;
- //
- // numericUpDown6
- //
- this.numericUpDown6.DecimalPlaces = 10;
- this.numericUpDown6.Location = new System.Drawing.Point(268, 16);
- this.numericUpDown6.Maximum = new decimal(new int[] {
- 214748364,
- 0,
- 0,
- 0});
- this.numericUpDown6.Minimum = new decimal(new int[] {
- 214748364,
- 0,
- 0,
- -2147483648});
- this.numericUpDown6.Name = "numericUpDown6";
- this.numericUpDown6.Size = new System.Drawing.Size(98, 21);
- this.numericUpDown6.TabIndex = 14;
- //
- // numericUpDown5
- //
- this.numericUpDown5.DecimalPlaces = 10;
- this.numericUpDown5.Location = new System.Drawing.Point(76, 16);
- this.numericUpDown5.Maximum = new decimal(new int[] {
- 214748364,
- 0,
- 0,
- 0});
- this.numericUpDown5.Minimum = new decimal(new int[] {
- 214748364,
- 0,
- 0,
- -2147483648});
- this.numericUpDown5.Name = "numericUpDown5";
- this.numericUpDown5.Size = new System.Drawing.Size(99, 21);
- this.numericUpDown5.TabIndex = 13;
- //
- // radioButton2
- //
- this.radioButton2.AutoSize = true;
- this.radioButton2.Location = new System.Drawing.Point(202, 16);
- this.radioButton2.Name = "radioButton2";
- this.radioButton2.Size = new System.Drawing.Size(47, 16);
- this.radioButton2.TabIndex = 12;
- this.radioButton2.TabStop = true;
- this.radioButton2.UseVisualStyleBackColor = true;
- //
- // radioButton1
- //
- this.radioButton1.AutoSize = true;
- this.radioButton1.Location = new System.Drawing.Point(11, 18);
- this.radioButton1.Name = "radioButton1";
- this.radioButton1.Size = new System.Drawing.Size(47, 16);
- this.radioButton1.TabIndex = 11;
- this.radioButton1.TabStop = true;
- this.radioButton1.UseVisualStyleBackColor = true;
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(236, 22);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(0, 12);
- this.label4.TabIndex = 7;
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(11, 22);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(0, 12);
- this.label3.TabIndex = 0;
- //
- // panel_showBinaryColor
- //
- this.panel_showBinaryColor.BackColor = System.Drawing.Color.Yellow;
- this.panel_showBinaryColor.Location = new System.Drawing.Point(62, 27);
- this.panel_showBinaryColor.Name = "panel_showBinaryColor";
- this.panel_showBinaryColor.Size = new System.Drawing.Size(76, 22);
- this.panel_showBinaryColor.TabIndex = 40;
- this.panel_showBinaryColor.Click += new System.EventHandler(this.panel_showBinaryColor_Click);
- //
- // label_showBinaryColor
- //
- this.label_showBinaryColor.AutoSize = true;
- this.label_showBinaryColor.Location = new System.Drawing.Point(14, 37);
- this.label_showBinaryColor.Name = "label_showBinaryColor";
- this.label_showBinaryColor.Size = new System.Drawing.Size(0, 12);
- this.label_showBinaryColor.TabIndex = 39;
- //
- // groupBox3
- //
- this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox3.Controls.Add(this.panel12);
- this.groupBox3.Controls.Add(this.panel11);
- this.groupBox3.Controls.Add(this.panel10);
- this.groupBox3.Controls.Add(this.panel9);
- this.groupBox3.Controls.Add(this.panel8);
- this.groupBox3.Controls.Add(this.panel7);
- this.groupBox3.Controls.Add(this.panel5);
- this.groupBox3.Controls.Add(this.panel6);
- this.groupBox3.Controls.Add(this.panel4);
- this.groupBox3.Controls.Add(this.panel3);
- this.groupBox3.Controls.Add(this.panel2);
- this.groupBox3.Controls.Add(this.panel1);
- this.groupBox3.Location = new System.Drawing.Point(11, 338);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(579, 106);
- this.groupBox3.TabIndex = 37;
- this.groupBox3.TabStop = false;
- //
- // panel12
- //
- this.panel12.BackColor = System.Drawing.Color.Yellow;
- this.panel12.Location = new System.Drawing.Point(489, 57);
- this.panel12.Name = "panel12";
- this.panel12.Size = new System.Drawing.Size(76, 22);
- this.panel12.TabIndex = 48;
- this.panel12.Click += new System.EventHandler(this.panel12_Click);
- //
- // panel11
- //
- this.panel11.BackColor = System.Drawing.Color.Yellow;
- this.panel11.Location = new System.Drawing.Point(395, 57);
- this.panel11.Name = "panel11";
- this.panel11.Size = new System.Drawing.Size(76, 22);
- this.panel11.TabIndex = 47;
- this.panel11.Click += new System.EventHandler(this.panel11_Click);
- //
- // panel10
- //
- this.panel10.BackColor = System.Drawing.Color.Yellow;
- this.panel10.Location = new System.Drawing.Point(304, 57);
- this.panel10.Name = "panel10";
- this.panel10.Size = new System.Drawing.Size(76, 22);
- this.panel10.TabIndex = 46;
- this.panel10.Click += new System.EventHandler(this.panel10_Click);
- //
- // panel9
- //
- this.panel9.BackColor = System.Drawing.Color.Yellow;
- this.panel9.Location = new System.Drawing.Point(212, 57);
- this.panel9.Name = "panel9";
- this.panel9.Size = new System.Drawing.Size(76, 22);
- this.panel9.TabIndex = 45;
- this.panel9.Click += new System.EventHandler(this.panel9_Click);
- //
- // panel8
- //
- this.panel8.BackColor = System.Drawing.Color.Yellow;
- this.panel8.Location = new System.Drawing.Point(114, 57);
- this.panel8.Name = "panel8";
- this.panel8.Size = new System.Drawing.Size(76, 22);
- this.panel8.TabIndex = 44;
- this.panel8.Click += new System.EventHandler(this.panel8_Click);
- //
- // panel7
- //
- this.panel7.BackColor = System.Drawing.Color.Yellow;
- this.panel7.Location = new System.Drawing.Point(16, 57);
- this.panel7.Name = "panel7";
- this.panel7.Size = new System.Drawing.Size(76, 22);
- this.panel7.TabIndex = 43;
- this.panel7.Click += new System.EventHandler(this.panel7_Click);
- //
- // panel5
- //
- this.panel5.BackColor = System.Drawing.Color.Yellow;
- this.panel5.Location = new System.Drawing.Point(395, 20);
- this.panel5.Name = "panel5";
- this.panel5.Size = new System.Drawing.Size(76, 22);
- this.panel5.TabIndex = 42;
- this.panel5.Click += new System.EventHandler(this.panel5_Click);
- //
- // panel6
- //
- this.panel6.BackColor = System.Drawing.Color.Yellow;
- this.panel6.Location = new System.Drawing.Point(489, 20);
- this.panel6.Name = "panel6";
- this.panel6.Size = new System.Drawing.Size(76, 22);
- this.panel6.TabIndex = 42;
- this.panel6.Click += new System.EventHandler(this.panel6_Click);
- //
- // panel4
- //
- this.panel4.BackColor = System.Drawing.Color.Yellow;
- this.panel4.Location = new System.Drawing.Point(304, 20);
- this.panel4.Name = "panel4";
- this.panel4.Size = new System.Drawing.Size(76, 22);
- this.panel4.TabIndex = 42;
- this.panel4.Click += new System.EventHandler(this.panel4_Click);
- //
- // panel3
- //
- this.panel3.BackColor = System.Drawing.Color.Yellow;
- this.panel3.Location = new System.Drawing.Point(212, 20);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(76, 22);
- this.panel3.TabIndex = 42;
- this.panel3.Click += new System.EventHandler(this.panel3_Click);
- //
- // panel2
- //
- this.panel2.BackColor = System.Drawing.Color.Yellow;
- this.panel2.Location = new System.Drawing.Point(114, 20);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(76, 22);
- this.panel2.TabIndex = 42;
- this.panel2.Click += new System.EventHandler(this.panel2_Click);
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.Color.Yellow;
- this.panel1.Location = new System.Drawing.Point(16, 20);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(76, 22);
- this.panel1.TabIndex = 41;
- this.panel1.Click += new System.EventHandler(this.panel1_Click);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(15, 36);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(29, 12);
- this.label1.TabIndex = 43;
- //
- // PorosityViewSetting
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.ClientSize = new System.Drawing.Size(602, 452);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox1);
- this.Controls.Add(this.groupBox_img);
- this.Controls.Add(this.groupBox_operating);
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "PorosityViewSetting";
- this.Controls.SetChildIndex(this.groupBox_operating, 0);
- this.Controls.SetChildIndex(this.groupBox_img, 0);
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox3, 0);
- this.groupBox_operating.ResumeLayout(false);
- this.groupBox_img.ResumeLayout(false);
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBox6.ResumeLayout(false);
- this.groupBox6.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit();
- this.groupBox3.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- #region [相关事件]
- private void setData()
- {
- panel1.BackColor = Color.FromArgb(ViewSetting.colorFirst);
- panel2.BackColor = Color.FromArgb(ViewSetting.colorSecond);
- panel3.BackColor = Color.FromArgb(ViewSetting.colorThird);
- panel4.BackColor = Color.FromArgb(ViewSetting.colorFourth);
- panel5.BackColor = Color.FromArgb(ViewSetting.colorFifth);
- panel6.BackColor = Color.FromArgb(ViewSetting.colorSixth);
- panel7.BackColor = Color.FromArgb(ViewSetting.colorSeventh);
- panel8.BackColor = Color.FromArgb(ViewSetting.colorEighth);
- panel9.BackColor = Color.FromArgb(ViewSetting.colorNinth);
- panel10.BackColor = Color.FromArgb(ViewSetting.colorTenth);
- panel11.BackColor = Color.FromArgb(ViewSetting.colorEleventh);
- panel12.BackColor = Color.FromArgb(ViewSetting.colorTwelfth);
- panel_showBinaryColor.BackColor = retrunColor(this.chooseIndex);
- }
- private Color retrunColor(int index)
- {
- switch ((index + 1) % 12)
- {
- case 1:
- return Color.FromArgb(ViewSetting.colorFirst);
- case 2:
- return Color.FromArgb(ViewSetting.colorSecond);
- case 3:
- return Color.FromArgb(ViewSetting.colorThird);
- case 4:
- return Color.FromArgb(ViewSetting.colorFourth);
- case 5:
- return Color.FromArgb(ViewSetting.colorFifth);
- case 6:
- return Color.FromArgb(ViewSetting.colorSixth);
- case 7:
- return Color.FromArgb(ViewSetting.colorSeventh);
- case 8:
- return Color.FromArgb(ViewSetting.colorEighth);
- case 9:
- return Color.FromArgb(ViewSetting.colorNinth);
- case 10:
- return Color.FromArgb(ViewSetting.colorTenth);
- case 11:
- return Color.FromArgb(ViewSetting.colorEleventh);
- case 12:
- return Color.FromArgb(ViewSetting.colorTwelfth);
- }
- return Color.FromArgb(ViewSetting.colorFirst);
- }
- private void lstView_img_SelectedIndexChanged(object sender, EventArgs e)
- {
- this.chooseIndex = this.lstView_img.SelectedIndex;
- this.pform.colorHighlight(chooseIndex);
- if (chooseIndex == -1)
- {
- panel_showBinaryColor.BackColor = Color.FromArgb(ViewSetting.colorFirst);
- return;
- }
- panel_showBinaryColor.BackColor = this.drawObjectList[this.chooseIndex].Color;
- var type = this.drawObjectList[this.chooseIndex].drawToolType;
- if (type == DrawToolType.ViewPolygon || type == DrawToolType.ViewTriangleEx || type == DrawToolType.ViewRectangleEx)
- {
- numericUpDown5.Enabled = false;
- numericUpDown6.Enabled = false;
- }
- else
- {
- numericUpDown5.Enabled = true;
- numericUpDown6.Enabled = true;
- }
- this.numericUpDown3.ValueChanged -= new EventHandler(this.numericUpDown3_ValueChange);
- this.numericUpDown4.ValueChanged -= new EventHandler(this.numericUpDown4_ValueChange);
- this.numericUpDown5.ValueChanged -= new EventHandler(this.numericUpDown5_ValueChange);
- this.numericUpDown6.ValueChanged -= new EventHandler(this.numericUpDown6_ValueChange);
- //this.numericUpDown5.Value = Convert.ToDecimal(this.drawObjectList[this.chooseIndex].Rectangle.Width * pxPerUnit);
- //this.numericUpDown6.Value = Convert.ToDecimal(this.drawObjectList[this.chooseIndex].Rectangle.Height * this.drawObjectList[this.chooseIndex].Rectangle.Height * pxPerUnit * pxPerUnit);
- switch (type)
- {
- case DrawToolType.ViewOval:
- this.radioButton1.Text = PdnResources.GetString("Menu.horizontalaxis.Text");
- this.radioButton2.Text = PdnResources.GetString("Menu.verticalaxis.Text");
- this.numericUpDown6.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Height * pxPerUnit));
- this.numericUpDown5.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Width * pxPerUnit));
- break;
- case DrawToolType.ViewCircle:
- this.radioButton1.Text = PdnResources.GetString("Menu.diameter.text");
- this.radioButton2.Text = PdnResources.GetString("Menu.area.text");
- this.numericUpDown5.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Width * pxPerUnit));
- this.numericUpDown6.Value = Convert.ToDecimal(Math.Ceiling(Math.PI * this.drawObjectList[this.chooseIndex].Rectangle.Height * this.drawObjectList[this.chooseIndex].Rectangle.Height * 0.25 * pxPerUnit * pxPerUnit));
- break;
- case DrawToolType.ViewRectangle:
- this.radioButton2.Text = PdnResources.GetString("Menu.width.text");
- this.radioButton1.Text = PdnResources.GetString("Menu.height.text");
- this.numericUpDown6.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Height * pxPerUnit));
- this.numericUpDown5.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Width * pxPerUnit));
- break;
- case DrawToolType.ViewRectangleEx:
- this.radioButton2.Text = PdnResources.GetString("Menu.width.text");
- this.radioButton1.Text = PdnResources.GetString("Menu.height.text");
- this.numericUpDown6.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Height * pxPerUnit));
- this.numericUpDown5.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Width * pxPerUnit));
- break;
- case DrawToolType.ViewTriangle:
- this.radioButton1.Text = PdnResources.GetString("Menu.Horizontalsidelength.Text");
- this.radioButton2.Text = PdnResources.GetString("Menu.Verticalsidelength.Text");
- this.numericUpDown6.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Height * pxPerUnit));
- this.numericUpDown5.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Width * pxPerUnit));
- break;
- case DrawToolType.ViewSquare:
- this.radioButton1.Text = PdnResources.GetString("Menu.Generalanalysis.Processmparison.Sidelength.text");
- this.radioButton2.Text = PdnResources.GetString("Menu.area.text");
- this.numericUpDown5.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Height * pxPerUnit));
- this.numericUpDown6.Value = Convert.ToDecimal(Math.Ceiling(this.drawObjectList[this.chooseIndex].Rectangle.Height * this.drawObjectList[this.chooseIndex].Rectangle.Height * pxPerUnit * pxPerUnit));
- break;
- case DrawToolType.ViewPolygon:
- case DrawToolType.ViewTriangleEx:
- this.numericUpDown5.Value = 0;
- this.numericUpDown6.Value = 0;
- break;
- }
- int centerX = (int)(this.drawObjectList[this.chooseIndex].Rectangle.X + Math.Abs(this.drawObjectList[this.chooseIndex].Rectangle.Width / 2));
- int centerY = (int)(this.drawObjectList[this.chooseIndex].Rectangle.Y + Math.Abs(this.drawObjectList[this.chooseIndex].Rectangle.Height / 2));
- this.numericUpDown3.Value = Math.Abs(centerX);
- this.numericUpDown4.Value = Math.Abs(centerY);
- this.numericUpDown3Old = Math.Abs(centerX);
- this.numericUpDown4Old = Math.Abs(centerY);
- this.numericUpDown3.ValueChanged += new EventHandler(this.numericUpDown3_ValueChange);
- this.numericUpDown4.ValueChanged += new EventHandler(this.numericUpDown4_ValueChange);
- this.numericUpDown5.ValueChanged += new EventHandler(this.numericUpDown5_ValueChange);
- this.numericUpDown6.ValueChanged += new EventHandler(this.numericUpDown6_ValueChange);
- }
- /// <summary>
- /// 修改中心点x坐标的事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown3_ValueChange(object sender, EventArgs e)
- {
- if (this.lstView_img.SelectedIndex == -1) {
- return;
- }
- if (this.numericUpDown3Old != (int)this.numericUpDown3.Value)
- {
- var id = this.drawObjectList[this.chooseIndex].ID;
- this.pform.numericUpDown3_ValueChange(id, this.chooseIndex, (int)this.numericUpDown3.Value, this.numericUpDown3Old);
- this.numericUpDown3Old = (int)this.numericUpDown3.Value;
- }
- }
- /// <summary>
- /// 修改中心点y坐标的事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown4_ValueChange(object sender, EventArgs e)
- {
- if (this.lstView_img.SelectedIndex == -1)
- {
- return;
- }
- if (this.numericUpDown4Old != (int)this.numericUpDown4.Value)
- {
- var id = this.drawObjectList[this.chooseIndex].ID;
- this.pform.numericupdown4_valuechange(id, this.chooseIndex, (int)this.numericUpDown4.Value, this.numericUpDown4Old);
- this.numericUpDown4Old = (int)this.numericUpDown4.Value;
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown5_ValueChange(object sender, EventArgs e)
- {
- if (this.lstView_img.SelectedIndex == -1)
- {
- return;
- }
- this.numericUpDown6.ValueChanged -= new EventHandler(this.numericUpDown6_ValueChange);
- this.numericUpDown3.ValueChanged -= new EventHandler(this.numericUpDown3_ValueChange);
- this.numericUpDown4.ValueChanged -= new EventHandler(this.numericUpDown4_ValueChange);
- var id = this.drawObjectList[this.chooseIndex].ID;
- this.drawObjectList[this.chooseIndex] = this.pform.numericUpDown5_ValueChange(id, this.chooseIndex, (int)this.numericUpDown5.Value);
- int centerX = (int)(this.drawObjectList[this.chooseIndex].Rectangle.X + Math.Abs(this.drawObjectList[this.chooseIndex].Rectangle.Width / 2));
- int centerY = (int)(this.drawObjectList[this.chooseIndex].Rectangle.Y + Math.Abs(this.drawObjectList[this.chooseIndex].Rectangle.Height / 2));
- this.numericUpDown3.Value = Math.Abs(centerX);
- this.numericUpDown4.Value = Math.Abs(centerY);
- this.numericUpDown3Old = Math.Abs(centerX);
- this.numericUpDown4Old = Math.Abs(centerY);
- var type = this.drawObjectList[this.chooseIndex].drawToolType;
- switch (type)
- {
- case DrawToolType.ViewCircle:
- this.numericUpDown6.Value = Convert.ToDecimal(Math.PI * this.drawObjectList[this.chooseIndex].Rectangle.Height * this.drawObjectList[this.chooseIndex].Rectangle.Height * 0.25 * pxPerUnit * pxPerUnit);
- break;
- case DrawToolType.ViewSquare:
- this.numericUpDown6.Value = Convert.ToDecimal(this.drawObjectList[this.chooseIndex].Rectangle.Height * this.drawObjectList[this.chooseIndex].Rectangle.Height * pxPerUnit * pxPerUnit);
- break;
- }
- this.numericUpDown6.ValueChanged += new EventHandler(this.numericUpDown6_ValueChange);
- this.numericUpDown3.ValueChanged += new EventHandler(this.numericUpDown3_ValueChange);
- this.numericUpDown4.ValueChanged += new EventHandler(this.numericUpDown4_ValueChange);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown6_ValueChange(object sender, EventArgs e)
- {
- if (this.lstView_img.SelectedIndex == -1)
- {
- return;
- }
- this.numericUpDown5.ValueChanged -= new EventHandler(this.numericUpDown5_ValueChange);
- this.numericUpDown3.ValueChanged -= new EventHandler(this.numericUpDown3_ValueChange);
- this.numericUpDown4.ValueChanged -= new EventHandler(this.numericUpDown4_ValueChange);
- var id = this.drawObjectList[this.chooseIndex].ID;
- this.drawObjectList[this.chooseIndex] = this.pform.numericUpDown6_ValueChange(id, this.chooseIndex, (int)this.numericUpDown6.Value);
- int centerX = (int)(this.drawObjectList[this.chooseIndex].Rectangle.X + Math.Abs(this.drawObjectList[this.chooseIndex].Rectangle.Width / 2));
- int centerY = (int)(this.drawObjectList[this.chooseIndex].Rectangle.Y + Math.Abs(this.drawObjectList[this.chooseIndex].Rectangle.Height / 2));
- this.numericUpDown3.Value = Math.Abs(centerX);
- this.numericUpDown4.Value = Math.Abs(centerY);
- this.numericUpDown3Old = Math.Abs(centerX);
- this.numericUpDown4Old = Math.Abs(centerY);
- var type = this.drawObjectList[this.chooseIndex].drawToolType;
- switch (type)
- {
- case DrawToolType.ViewCircle:
- this.numericUpDown5.Value = Convert.ToDecimal(this.drawObjectList[this.chooseIndex].Rectangle.Height * pxPerUnit);
- break;
- case DrawToolType.ViewSquare:
- this.numericUpDown5.Value = Convert.ToDecimal(this.drawObjectList[this.chooseIndex].Rectangle.Height * pxPerUnit);
- break;
- }
- this.numericUpDown5.ValueChanged += new EventHandler(this.numericUpDown5_ValueChange);
- this.numericUpDown3.ValueChanged += new EventHandler(this.numericUpDown3_ValueChange);
- this.numericUpDown4.ValueChanged += new EventHandler(this.numericUpDown4_ValueChange);
- }
- private void panel_showBinaryColor_Click(object sender, EventArgs e)
- {
- this.lineColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel_showBinaryColor.BackColor);
- this.lineColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.lineColorChanged));
- this.lineColorsFormGrid.ShowDialog();
- }
- private void lineColorChanged(object sender, EventArgs e)
- {
- if (this.chooseIndex == -1)
- {
- MessageBox.Show(PdnResources.GetString("Menu.eforechangingthecolor.Text"));
- return;
- }
- Color color = this.lineColorsFormGrid.UserPrimaryColor.ToColor();
- //更改背景色,触发事件
- this.panel_showBinaryColor.BackColor = color;
- this.pform.changeThisColor(this.chooseIndex, color.ToArgb());
- //关闭色板
- this.lineColorsFormGrid.Close();
- }
- #region [底部修改视场颜色事件集合]
- private void panel1_Click(object sender, EventArgs e)
- {
- this.cilckNum = 1;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel2_Click(object sender, EventArgs e)
- {
- this.cilckNum = 2;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel3_Click(object sender, EventArgs e)
- {
- this.cilckNum = 3;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel3.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel4_Click(object sender, EventArgs e)
- {
- this.cilckNum = 4;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel4.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel5_Click(object sender, EventArgs e)
- {
- this.cilckNum = 5;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel5.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel6_Click(object sender, EventArgs e)
- {
- this.cilckNum = 6;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel6.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel7_Click(object sender, EventArgs e)
- {
- this.cilckNum = 7;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel7.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel8_Click(object sender, EventArgs e)
- {
- this.cilckNum = 8;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel8.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel9_Click(object sender, EventArgs e)
- {
- this.cilckNum = 9;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel9.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel10_Click(object sender, EventArgs e)
- {
- this.cilckNum = 10;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel10.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel11_Click(object sender, EventArgs e)
- {
- this.cilckNum = 11;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel11.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void panel12_Click(object sender, EventArgs e)
- {
- this.cilckNum = 12;
- this.viewColorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel12.BackColor);
- this.viewColorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.viewColorChanged));
- this.viewColorsFormGrid.ShowDialog();
- }
- private void viewColorChanged(object sender, EventArgs e)
- {
- Color color = this.viewColorsFormGrid.UserPrimaryColor.ToColor();
- if (this.cilckNum == 1)
- {
- ViewSetting.colorFirst = color.ToArgb();
- panel1.BackColor = color;
- }
- else if (this.cilckNum == 2)
- {
- ViewSetting.colorSecond = color.ToArgb();
- panel2.BackColor = color;
- }
- else if (this.cilckNum == 3)
- {
- ViewSetting.colorThird = color.ToArgb();
- panel3.BackColor = color;
- }
- else if (this.cilckNum == 4)
- {
- ViewSetting.colorFourth = color.ToArgb();
- panel4.BackColor = color;
- }
- else if (this.cilckNum == 5)
- {
- ViewSetting.colorFifth = color.ToArgb();
- panel5.BackColor = color;
- }
- else if (this.cilckNum == 6)
- {
- ViewSetting.colorSixth = color.ToArgb();
- panel6.BackColor = color;
- }
- else if (this.cilckNum == 7)
- {
- ViewSetting.colorSeventh = color.ToArgb();
- panel7.BackColor = color;
- }
- else if (this.cilckNum == 8)
- {
- ViewSetting.colorEighth = color.ToArgb();
- panel8.BackColor = color;
- }
- else if (this.cilckNum == 9)
- {
- ViewSetting.colorNinth = color.ToArgb();
- panel9.BackColor = color;
- }
- else if (this.cilckNum == 10)
- {
- ViewSetting.colorTenth = color.ToArgb();
- panel10.BackColor = color;
- }
- else if (this.cilckNum == 11)
- {
- ViewSetting.colorEleventh = color.ToArgb();
- panel11.BackColor = color;
- }
- else if (this.cilckNum == 0)
- {
- ViewSetting.colorTwelfth = color.ToArgb();
- panel12.BackColor = color;
- }
- //if ((this.chooseIndex + 1) % 12 == (this.cilckNum % 12)) {
- // this.panel_showBinaryColor.BackColor = color;
- //}
- this.viewColorsFormGrid.Close();
- }
- #endregion
- private void button1_Click(object sender, EventArgs e)
- {
- this.lstView_img.Items.Clear();
- this.pform.clearView();
- MessageBox.Show(PdnResources.GetString("Menu.Clearedviewsuccessfully.Text"));
- this.Close();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- try
- {
- this.pform.clearOneView(this.drawObjectList[this.chooseIndex].ID, this.chooseIndex);
- this.lstView_img.Items.RemoveAt(this.chooseIndex);
- MessageBox.Show(PdnResources.GetString("Menu.Fieldofviewremovedsuccessfully.Text"));
- this.numericUpDown3.ValueChanged -= new EventHandler(this.numericUpDown3_ValueChange);
- this.numericUpDown4.ValueChanged -= new EventHandler(this.numericUpDown4_ValueChange);
- this.numericUpDown5.ValueChanged -= new EventHandler(this.numericUpDown5_ValueChange);
- this.numericUpDown6.ValueChanged -= new EventHandler(this.numericUpDown6_ValueChange);
- this.numericUpDown3.Value = 0;
- this.numericUpDown4.Value = 0;
- this.numericUpDown5.Value = 0;
- this.numericUpDown6.Value = 0;
- this.numericUpDown3.ValueChanged += new EventHandler(this.numericUpDown3_ValueChange);
- this.numericUpDown4.ValueChanged += new EventHandler(this.numericUpDown4_ValueChange);
- this.numericUpDown5.ValueChanged += new EventHandler(this.numericUpDown5_ValueChange);
- this.numericUpDown6.ValueChanged += new EventHandler(this.numericUpDown6_ValueChange);
- }
- catch (Exception ex)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Deletinvifailelate.Text"));
- }
- }
- private void btn_saveresult_Click(object sender, EventArgs e)
- {
- if (this.lstView_img.SelectedIndex == -1) {
- MessageBox.Show("请先选择视场!");
- this.numericUpDown3.Value = 0;
- this.numericUpDown4.Value = 0;
- this.numericUpDown5.Value = 0;
- this.numericUpDown6.Value = 0;
- return;
- }
- string ViewSettingStr = XmlSerializeHelper.XmlSerialize<viewSetting>(this.ViewSetting);
- FileOperationHelper.WriteStringToFile(ViewSettingStr, Application.StartupPath + "\\PorosityConfig\\ViewConfig.xml", FileMode.Create);
- MessageBox.Show(PdnResources.GetString("Menu.Savemodificationsuccessfully.Text"));
- this.pform.editView();
- this.notSave = 2;
- this.Close();
- }
- private void PorosityViewSettingClosing(object sender, EventArgs e)
- {
- //取消高亮
- this.pform.colorHighlight(-1);
- //判断是否是保存后关闭
- if (this.notSave == 1)
- {
- this.pform.returnOldColor();
- }
- }
- #endregion
- }
- }
|