using PaintDotNet.Annotation; using PaintDotNet.Annotation.Label; 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.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace PaintDotNet.ImageLabel { internal class LabelWorkTypeStyleDialog : PdnBaseForm { private Button button2; private Button button1; private GroupBox groupBox2; private GroupBox groupBox3; private GroupBox groupBox4; private Label label2; private Label label1; private Panel panel1; private RadioButton radioButton2; private RadioButton radioButton1; private Label label3; private NumericUpDown numericUpDown1; private Label label5; private Label label4; private RadioButton radioButton4; private RadioButton radioButton3; private Panel panel2; private Label label6; private NumericUpDown numericUpDown2; private Label label10; private Label label9; private Label label7; private NumericUpDown numericUpDown3; private Panel panel3; private RadioButton radioButton6; private RadioButton radioButton8; private Label label12; private Label label11; private Panel panel4; private ComboBox comboBox1; private Label label13; private NumericUpDown numericUpDown4; private GroupBox groupBox1; private AppWorkspace appWorkspace; private DrawObject drawObject; private ParentStyleModel parentStyleModel; private WorkTypeStyleModel workTypeModel; /// /// 字体列表 /// ArrayList fontsItems = new ArrayList(); /// /// 调色板辅助线 /// PaintDotNet.ColorsForm colorsFormfzx; /// /// 调色板连接线 /// PaintDotNet.ColorsForm colorsFormljx; /// /// 调色板测量线 /// PaintDotNet.ColorsForm colorsFormclx; private Panel panel5; private RadioButton radioButton7; private RadioButton radioButton5; private Label label8; /// /// 调色板字体 /// PaintDotNet.ColorsForm colorsFormfont; public LabelWorkTypeStyleDialog(AppWorkspace appWorkspace, DrawObject drawObject) { this.appWorkspace = appWorkspace; this.drawObject = drawObject; this.parentStyleModel = DrawRulerHelper.DeepCopyByReflect(this.drawObject.GetStyle()); InitializeComponent(); InitializeLanguageText(); InitializeColorForm(); InitializeWorkTypeModel(); } private void InitializeLanguageText() { this.groupBox1.Text = PdnResources.GetString("Menu.operation.text"); this.button2.Text = PdnResources.GetString("Menu.File.Close.Text"); this.button1.Text = PdnResources.GetString("Menu.application.text"); this.groupBox2.Text = PdnResources.GetString("Menu.Auxiliarylinesettings.text"); this.label3.Text = PdnResources.GetString("Menu.Linewidth.text") + ":"; this.radioButton2.Text = PdnResources.GetString("Menu.no.text"); this.radioButton1.Text = PdnResources.GetString("Menu.Yes.text"); this.label2.Text = PdnResources.GetString("Menu.display.text") + ":"; this.label1.Text = PdnResources.GetString("Menu.color.text") + ":"; this.groupBox3.Text = PdnResources.GetString("Menu.Set.typesettings.the communicationscablesetting.text"); this.label6.Text = PdnResources.GetString("Menu.Linewidth.text") + ":"; this.radioButton4.Text = PdnResources.GetString("Menu.no.text"); this.radioButton3.Text = PdnResources.GetString("Menu.Yes.text"); this.label5.Text = PdnResources.GetString("Menu.display.text") + ":"; this.label4.Text = PdnResources.GetString("Menu.color.text") + ":"; this.groupBox4.Text = PdnResources.GetString("Menu.Measuringlinesetting.text"); this.label13.Text = PdnResources.GetString("Menu.Fontsize.text") + ":"; this.label12.Text = PdnResources.GetString("Menu.Font.text") + ":"; this.label11.Text = PdnResources.GetString("Menu.fontcolor.text") + ":"; this.radioButton8.Text = PdnResources.GetString("Menu.no.text"); this.radioButton6.Text = PdnResources.GetString("Menu.Yes.text"); this.label10.Text = PdnResources.GetString("Menu.Linewidth.text") + ":"; this.label9.Text = PdnResources.GetString("Menu.Set.typesettings.Displaythelengthofmeasuringline.text") + ":"; this.label7.Text = PdnResources.GetString("Menu.color.text") + ":"; this.radioButton7.Text = PdnResources.GetString("Menu.no.text"); this.radioButton5.Text = PdnResources.GetString("Menu.Yes.text"); this.label8.Text = PdnResources.GetString("Menu.Set.typesettings.Displaymeasuringlinedistance.text") + ":"; this.Text = PdnResources.GetString("Menu.Setting.WorkTypeSetting.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.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); this.label3 = new System.Windows.Forms.Label(); this.radioButton2 = new System.Windows.Forms.RadioButton(); this.radioButton1 = new System.Windows.Forms.RadioButton(); this.panel1 = new System.Windows.Forms.Panel(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.numericUpDown2 = new System.Windows.Forms.NumericUpDown(); this.label6 = new System.Windows.Forms.Label(); this.radioButton4 = new System.Windows.Forms.RadioButton(); this.radioButton3 = new System.Windows.Forms.RadioButton(); this.panel2 = new System.Windows.Forms.Panel(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.numericUpDown4 = new System.Windows.Forms.NumericUpDown(); this.label13 = new System.Windows.Forms.Label(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.panel4 = new System.Windows.Forms.Panel(); this.label12 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.radioButton8 = new System.Windows.Forms.RadioButton(); this.radioButton6 = new System.Windows.Forms.RadioButton(); this.numericUpDown3 = new System.Windows.Forms.NumericUpDown(); this.panel3 = new System.Windows.Forms.Panel(); this.label10 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.panel5 = new System.Windows.Forms.Panel(); this.radioButton7 = new System.Windows.Forms.RadioButton(); this.radioButton5 = new System.Windows.Forms.RadioButton(); this.label8 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.groupBox3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); this.groupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit(); this.panel5.SuspendLayout(); this.SuspendLayout(); // // groupBox1 // 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(509, 58); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "操作"; // // button2 // this.button2.Location = new System.Drawing.Point(401, 20); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(75, 23); this.button2.TabIndex = 1; this.button2.Text = "关闭"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // button1 // this.button1.Location = new System.Drawing.Point(283, 20); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 0; this.button1.Text = "应用"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // groupBox2 // this.groupBox2.Controls.Add(this.numericUpDown1); this.groupBox2.Controls.Add(this.label3); this.groupBox2.Controls.Add(this.radioButton2); this.groupBox2.Controls.Add(this.radioButton1); this.groupBox2.Controls.Add(this.panel1); this.groupBox2.Controls.Add(this.label2); this.groupBox2.Controls.Add(this.label1); this.groupBox2.Location = new System.Drawing.Point(13, 78); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(509, 79); this.groupBox2.TabIndex = 1; this.groupBox2.TabStop = false; this.groupBox2.Text = "辅助线设置"; // // numericUpDown1 // this.numericUpDown1.Location = new System.Drawing.Point(328, 21); this.numericUpDown1.Name = "numericUpDown1"; this.numericUpDown1.Size = new System.Drawing.Size(161, 21); this.numericUpDown1.TabIndex = 6; this.numericUpDown1.Value = new decimal(new int[] { 1, 0, 0, 0}); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(280, 24); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(41, 12); this.label3.TabIndex = 5; this.label3.Text = "线宽:"; // // radioButton2 // this.radioButton2.AutoSize = true; this.radioButton2.Location = new System.Drawing.Point(141, 51); this.radioButton2.Name = "radioButton2"; this.radioButton2.Size = new System.Drawing.Size(35, 16); this.radioButton2.TabIndex = 4; this.radioButton2.TabStop = true; this.radioButton2.Text = "否"; this.radioButton2.UseVisualStyleBackColor = true; // // radioButton1 // this.radioButton1.AutoSize = true; this.radioButton1.Location = new System.Drawing.Point(65, 51); this.radioButton1.Name = "radioButton1"; this.radioButton1.Size = new System.Drawing.Size(35, 16); this.radioButton1.TabIndex = 3; this.radioButton1.TabStop = true; this.radioButton1.Text = "是"; this.radioButton1.UseVisualStyleBackColor = true; // // panel1 // this.panel1.BackColor = System.Drawing.SystemColors.ButtonHighlight; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel1.Location = new System.Drawing.Point(64, 20); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(161, 21); this.panel1.TabIndex = 2; this.panel1.Click += new System.EventHandler(this.panel1_Click); // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(17, 51); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(41, 12); this.label2.TabIndex = 1; this.label2.Text = "显示:"; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(17, 23); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(41, 12); this.label1.TabIndex = 0; this.label1.Text = "颜色:"; // // groupBox3 // this.groupBox3.Controls.Add(this.numericUpDown2); this.groupBox3.Controls.Add(this.label6); this.groupBox3.Controls.Add(this.radioButton4); this.groupBox3.Controls.Add(this.radioButton3); this.groupBox3.Controls.Add(this.panel2); this.groupBox3.Controls.Add(this.label5); this.groupBox3.Controls.Add(this.label4); this.groupBox3.Location = new System.Drawing.Point(13, 164); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(509, 79); this.groupBox3.TabIndex = 2; this.groupBox3.TabStop = false; this.groupBox3.Text = "连接线设置"; // // numericUpDown2 // this.numericUpDown2.Location = new System.Drawing.Point(328, 23); this.numericUpDown2.Name = "numericUpDown2"; this.numericUpDown2.Size = new System.Drawing.Size(161, 21); this.numericUpDown2.TabIndex = 6; this.numericUpDown2.Value = new decimal(new int[] { 1, 0, 0, 0}); // // label6 // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(283, 25); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(41, 12); this.label6.TabIndex = 5; this.label6.Text = "线宽:"; // // radioButton4 // this.radioButton4.AutoSize = true; this.radioButton4.Location = new System.Drawing.Point(141, 50); this.radioButton4.Name = "radioButton4"; this.radioButton4.Size = new System.Drawing.Size(35, 16); this.radioButton4.TabIndex = 4; this.radioButton4.TabStop = true; this.radioButton4.Text = "否"; this.radioButton4.UseVisualStyleBackColor = true; // // radioButton3 // this.radioButton3.AutoSize = true; this.radioButton3.Location = new System.Drawing.Point(64, 50); this.radioButton3.Name = "radioButton3"; this.radioButton3.Size = new System.Drawing.Size(35, 16); this.radioButton3.TabIndex = 3; this.radioButton3.TabStop = true; this.radioButton3.Text = "是"; this.radioButton3.UseVisualStyleBackColor = true; // // panel2 // this.panel2.BackColor = System.Drawing.SystemColors.ButtonHighlight; this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel2.Location = new System.Drawing.Point(64, 20); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(161, 21); this.panel2.TabIndex = 2; this.panel2.Click += new System.EventHandler(this.panel2_Click); // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(19, 53); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(41, 12); this.label5.TabIndex = 1; this.label5.Text = "显示:"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(19, 25); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(41, 12); this.label4.TabIndex = 0; this.label4.Text = "颜色:"; // // groupBox4 // this.groupBox4.Controls.Add(this.numericUpDown4); this.groupBox4.Controls.Add(this.label13); this.groupBox4.Controls.Add(this.comboBox1); this.groupBox4.Controls.Add(this.panel4); this.groupBox4.Controls.Add(this.label12); this.groupBox4.Controls.Add(this.label11); this.groupBox4.Controls.Add(this.radioButton8); this.groupBox4.Controls.Add(this.radioButton6); this.groupBox4.Controls.Add(this.numericUpDown3); this.groupBox4.Controls.Add(this.panel3); this.groupBox4.Controls.Add(this.label10); this.groupBox4.Controls.Add(this.label9); this.groupBox4.Controls.Add(this.label7); this.groupBox4.Controls.Add(this.panel5); this.groupBox4.Location = new System.Drawing.Point(13, 250); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(509, 100); this.groupBox4.TabIndex = 3; this.groupBox4.TabStop = false; this.groupBox4.Text = "测量线设置"; // // numericUpDown4 // this.numericUpDown4.Location = new System.Drawing.Point(431, 74); this.numericUpDown4.Maximum = new decimal(new int[] { 49000, 0, 0, 0}); this.numericUpDown4.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.numericUpDown4.Name = "numericUpDown4"; this.numericUpDown4.Size = new System.Drawing.Size(58, 21); this.numericUpDown4.TabIndex = 15; this.numericUpDown4.Value = new decimal(new int[] { 12, 0, 0, 0}); // // label13 // this.label13.AutoSize = true; this.label13.Location = new System.Drawing.Point(396, 78); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(41, 12); this.label13.TabIndex = 14; this.label13.Text = "字号:"; // // comboBox1 // this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox1.FormattingEnabled = true; this.comboBox1.Location = new System.Drawing.Point(328, 74); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(57, 20); this.comboBox1.TabIndex = 13; // // panel4 // this.panel4.BackColor = System.Drawing.SystemColors.ButtonHighlight; this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel4.Location = new System.Drawing.Point(328, 46); this.panel4.Name = "panel4"; this.panel4.Size = new System.Drawing.Size(161, 23); this.panel4.TabIndex = 12; this.panel4.Click += new System.EventHandler(this.panel4_Click); // // label12 // this.label12.AutoSize = true; this.label12.Location = new System.Drawing.Point(283, 77); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(41, 12); this.label12.TabIndex = 11; this.label12.Text = "字体:"; // // label11 // this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(258, 51); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(65, 12); this.label11.TabIndex = 10; this.label11.Text = "字体颜色:"; // // radioButton8 // this.radioButton8.AutoSize = true; this.radioButton8.Location = new System.Drawing.Point(171, 75); this.radioButton8.Name = "radioButton8"; this.radioButton8.Size = new System.Drawing.Size(35, 16); this.radioButton8.TabIndex = 9; this.radioButton8.TabStop = true; this.radioButton8.Text = "否"; this.radioButton8.UseVisualStyleBackColor = true; // // radioButton6 // this.radioButton6.AutoSize = true; this.radioButton6.Checked = true; this.radioButton6.Location = new System.Drawing.Point(118, 75); this.radioButton6.Name = "radioButton6"; this.radioButton6.Size = new System.Drawing.Size(35, 16); this.radioButton6.TabIndex = 7; this.radioButton6.TabStop = true; this.radioButton6.Text = "是"; this.radioButton6.UseVisualStyleBackColor = true; // // numericUpDown3 // this.numericUpDown3.Location = new System.Drawing.Point(328, 19); this.numericUpDown3.Name = "numericUpDown3"; this.numericUpDown3.Size = new System.Drawing.Size(161, 21); this.numericUpDown3.TabIndex = 5; this.numericUpDown3.Value = new decimal(new int[] { 1, 0, 0, 0}); // // panel3 // this.panel3.BackColor = System.Drawing.SystemColors.ButtonHighlight; this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel3.Location = new System.Drawing.Point(64, 17); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(161, 21); this.panel3.TabIndex = 4; this.panel3.Click += new System.EventHandler(this.panel3_Click); // // label10 // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(282, 23); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(41, 12); this.label10.TabIndex = 3; this.label10.Text = "线宽:"; // // label9 // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(19, 76); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(101, 12); this.label9.TabIndex = 2; this.label9.Text = "显示测量线长度:"; // // label7 // this.label7.AutoSize = true; this.label7.Location = new System.Drawing.Point(19, 21); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(41, 12); this.label7.TabIndex = 0; this.label7.Text = "颜色:"; // // panel5 // this.panel5.Controls.Add(this.radioButton7); this.panel5.Controls.Add(this.radioButton5); this.panel5.Controls.Add(this.label8); this.panel5.Location = new System.Drawing.Point(14, 41); this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(211, 28); this.panel5.TabIndex = 16; // // radioButton7 // this.radioButton7.AutoSize = true; this.radioButton7.Location = new System.Drawing.Point(157, 8); this.radioButton7.Name = "radioButton7"; this.radioButton7.Size = new System.Drawing.Size(35, 16); this.radioButton7.TabIndex = 2; this.radioButton7.TabStop = true; this.radioButton7.Text = "否"; this.radioButton7.UseVisualStyleBackColor = true; // // radioButton5 // this.radioButton5.AutoSize = true; this.radioButton5.Checked = true; this.radioButton5.Location = new System.Drawing.Point(104, 8); this.radioButton5.Name = "radioButton5"; this.radioButton5.Size = new System.Drawing.Size(35, 16); this.radioButton5.TabIndex = 1; this.radioButton5.TabStop = true; this.radioButton5.Text = "是"; this.radioButton5.UseVisualStyleBackColor = true; // // label8 // this.label8.AutoSize = true; this.label8.Location = new System.Drawing.Point(5, 10); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(101, 12); this.label8.TabIndex = 0; this.label8.Text = "显示测量线距离:"; // // LabelWorkTypeStyleDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.ClientSize = new System.Drawing.Size(533, 367); this.Controls.Add(this.groupBox4); this.Controls.Add(this.groupBox3); 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 = "LabelWorkTypeStyleDialog"; this.Text = "工型设置"; this.Controls.SetChildIndex(this.groupBox1, 0); this.Controls.SetChildIndex(this.groupBox2, 0); this.Controls.SetChildIndex(this.groupBox3, 0); this.Controls.SetChildIndex(this.groupBox4, 0); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit(); this.panel5.ResumeLayout(false); this.panel5.PerformLayout(); this.ResumeLayout(false); } /// /// 初始化颜色组件 /// private void InitializeColorForm() { this.colorsFormfzx = new ColorsForm(); this.colorsFormfzx.StartPosition = FormStartPosition.CenterScreen; this.colorsFormfzx.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged); this.colorsFormljx = new ColorsForm(); this.colorsFormljx.StartPosition = FormStartPosition.CenterScreen; this.colorsFormljx.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged); this.colorsFormclx = new ColorsForm(); this.colorsFormclx.StartPosition = FormStartPosition.CenterScreen; this.colorsFormclx.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged); this.colorsFormfont = new ColorsForm(); this.colorsFormfont.StartPosition = FormStartPosition.CenterScreen; this.colorsFormfont.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged); } /// /// 初始化当前控件属性 /// private void InitializeWorkTypeModel() { this.fontsItems.Clear(); //绑定字体数据 System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection(); foreach (FontFamily fontFamily in fonts.Families) { fontsItems.Add(fontFamily.Name); } this.comboBox1.DataSource = fontsItems; workTypeModel = (WorkTypeStyleModel)this.parentStyleModel; //辅助线 this.panel1.BackColor = Color.FromArgb(workTypeModel.guideColour); this.numericUpDown1.Value = workTypeModel.guideLineWidth; if (workTypeModel.guideShowFlag == 0) { this.radioButton2.Checked = true; } else { this.radioButton1.Checked = true; } //连接线 this.panel2.BackColor = Color.FromArgb(workTypeModel.connectColour); this.numericUpDown2.Value = workTypeModel.connectLineWidth; if (workTypeModel.connectShowFlag == 0) { this.radioButton4.Checked = true; } else { this.radioButton3.Checked = true; } //测量线 this.panel3.BackColor = Color.FromArgb(workTypeModel.measureColour); this.numericUpDown3.Value = workTypeModel.measureLineWidth; if (workTypeModel.measureRangeShowFlag == 0) { this.radioButton7.Checked = true; } else { this.radioButton5.Checked = true; } if (workTypeModel.measureLengthShowFlag == 0) { this.radioButton8.Checked = true; } else { this.radioButton6.Checked = true; } //文字 this.panel4.BackColor = Color.FromArgb(workTypeModel.fontColour); this.comboBox1.Text = workTypeModel.font; this.numericUpDown4.Value = workTypeModel.fontSize; } /// /// 关闭 /// /// /// private void button2_Click(object sender, EventArgs e) { this.Close(); } /// /// 调色板回调函数 /// /// /// private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce) { } /// /// 辅助线Panel被点击 /// /// /// private void panel1_Click(object sender, EventArgs e) { this.colorsFormfzx.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor); this.colorsFormfzx.setSaveBtn_Click(new System.EventHandler(this.fzxColorChanged)); this.colorsFormfzx.ShowDialog(); } /// /// 辅助线Panel的调色板颜色改变 /// /// /// private void fzxColorChanged(object sender, EventArgs e) { this.panel1.BackColor = this.colorsFormfzx.UserPrimaryColor.ToColor(); this.colorsFormfzx.Close(); } /// /// 连接线Panel被点击 /// /// /// private void panel2_Click(object sender, EventArgs e) { this.colorsFormljx.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor); this.colorsFormljx.setSaveBtn_Click(new System.EventHandler(this.ljxColorChanged)); this.colorsFormljx.ShowDialog(); } /// /// 连接线Panel的调色板颜色改变 /// /// /// private void ljxColorChanged(object sender, EventArgs e) { this.panel2.BackColor = this.colorsFormljx.UserPrimaryColor.ToColor(); this.colorsFormljx.Close(); } /// /// 测量线Panel被点击 /// /// /// private void panel3_Click(object sender, EventArgs e) { this.colorsFormclx.UserPrimaryColor = ColorBgra.FromColor(this.panel3.BackColor); this.colorsFormclx.setSaveBtn_Click(new System.EventHandler(this.clxColorChanged)); this.colorsFormclx.ShowDialog(); } /// /// 测量线Panel的调色板颜色改变 /// /// /// private void clxColorChanged(object sender, EventArgs e) { this.panel3.BackColor = this.colorsFormclx.UserPrimaryColor.ToColor(); this.colorsFormclx.Close(); } /// /// 字体颜色Panel被点击 /// /// /// private void panel4_Click(object sender, EventArgs e) { this.colorsFormfont.UserPrimaryColor = ColorBgra.FromColor(this.panel4.BackColor); this.colorsFormfont.setSaveBtn_Click(new System.EventHandler(this.fontColorChanged)); this.colorsFormfont.ShowDialog(); } /// /// 字体颜色Panel的调色板颜色改变 /// /// /// private void fontColorChanged(object sender, EventArgs e) { this.panel4.BackColor = this.colorsFormfont.UserPrimaryColor.ToColor(); this.colorsFormfont.Close(); } /// /// 应用 /// /// /// private void button1_Click(object sender, EventArgs e) { UpDownBase fzxLineWidthup = (UpDownBase)this.numericUpDown1; if (string.IsNullOrEmpty(fzxLineWidthup.Text)) { this.numericUpDown1.Value = 1; } UpDownBase ljxLineWidthup = (UpDownBase)this.numericUpDown2; if (string.IsNullOrEmpty(ljxLineWidthup.Text)) { this.numericUpDown2.Value = 1; } UpDownBase clxLineWidthup = (UpDownBase)this.numericUpDown3; if (string.IsNullOrEmpty(clxLineWidthup.Text)) { this.numericUpDown3.Value = 1; } UpDownBase fontSizeWidthup = (UpDownBase)this.numericUpDown4; if (string.IsNullOrEmpty(fontSizeWidthup.Text)) { this.numericUpDown4.Value = 1; } workTypeModel = new WorkTypeStyleModel(); //辅助线 workTypeModel.guideColour = Convert.ToInt32(this.panel1.BackColor.ToArgb()); workTypeModel.guideLineWidth = Convert.ToInt32(this.numericUpDown1.Value); if (this.radioButton2.Checked) { workTypeModel.guideShowFlag = 0; } else { workTypeModel.guideShowFlag = 1; } //连接线 workTypeModel.connectColour = Convert.ToInt32(this.panel2.BackColor.ToArgb()); workTypeModel.connectLineWidth = Convert.ToInt32(this.numericUpDown2.Value); if (this.radioButton4.Checked) { workTypeModel.connectShowFlag = 0; } else { workTypeModel.connectShowFlag = 1; } //测量线 workTypeModel.measureColour = Convert.ToInt32(this.panel3.BackColor.ToArgb()); workTypeModel.measureLineWidth = Convert.ToInt32(this.numericUpDown3.Value); if (this.radioButton7.Checked) { workTypeModel.measureRangeShowFlag = 0; } else { workTypeModel.measureRangeShowFlag = 1; } if (this.radioButton8.Checked) { workTypeModel.measureLengthShowFlag = 0; } else { workTypeModel.measureLengthShowFlag = 1; } //文字 workTypeModel.fontColour = Convert.ToInt32(this.panel4.BackColor.ToArgb()); workTypeModel.font = this.comboBox1.Text; workTypeModel.fontSize = Convert.ToInt32(this.numericUpDown4.Value); DrawWorkType drawWorkType = (DrawWorkType)this.drawObject; drawWorkType.labelWorkTypeStyleMode = workTypeModel; this.appWorkspace.ActiveDocumentWorkspace.Refresh(); this.Close(); } } }