123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- using System;
- using System.Collections;
- using System.Drawing;
- using System.Windows.Forms;
- namespace PaintDotNet.DedicatedAnalysis.menuGrayiron
- {
- public partial class ChangeParameter : PdnBaseForm
- {
- /// <summary>
- /// 调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsForm1;
- /// <summary>
- /// 下拉框默认值
- /// </summary>
- private static String num= "14" ;
- /// <summary>
- /// 颜色默认值
- /// </summary>
- private static Color color =Color.Black ;
- private NumericUpDown numericUpDown1;
- private ToolTip toolTip1;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- public ChangeParameter()
- {
- InitializeComponent();
- InitializeLanguageText();
- }
- #region Windows Form Designer generated code
- 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.Colorsetting.text");
- this.label2.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.label1.Text = PdnResources.GetString("Menu.Fontsize.text") + ":";
- this.Text = PdnResources.GetString("Menu.Displayparamssettings.text");
- }
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- 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.panel1 = new System.Windows.Forms.Panel();
- this.label2 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox1.Controls.Add(this.button2);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Location = new System.Drawing.Point(12, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(486, 60);
- this.groupBox1.TabIndex = 1;
- this.groupBox1.TabStop = false;
- //
- // button2
- //
- this.button2.AutoEllipsis = true;
- this.button2.Location = new System.Drawing.Point(390, 15);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(90, 30);
- this.button2.TabIndex = 1;
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // button1
- //
- this.button1.AutoEllipsis = true;
- this.button1.Location = new System.Drawing.Point(294, 15);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(90, 30);
- this.button1.TabIndex = 0;
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // groupBox2
- //
- this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox2.Controls.Add(this.numericUpDown1);
- 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(12, 78);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(486, 137);
- this.groupBox2.TabIndex = 2;
- this.groupBox2.TabStop = false;
- //
- // numericUpDown1
- //
- this.numericUpDown1.Location = new System.Drawing.Point(55, 46);
- this.numericUpDown1.Maximum = new decimal(new int[] {
- 49000,
- 0,
- 0,
- 0});
- this.numericUpDown1.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown1.Name = "numericUpDown1";
- this.numericUpDown1.Size = new System.Drawing.Size(120, 21);
- this.numericUpDown1.TabIndex = 4;
- this.numericUpDown1.Value = new decimal(new int[] {
- 12,
- 0,
- 0,
- 0});
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.Color.Black;
- this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panel1.ForeColor = System.Drawing.Color.Black;
- this.panel1.Location = new System.Drawing.Point(252, 46);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(121, 20);
- this.panel1.TabIndex = 3;
- this.panel1.Click += new System.EventHandler(this.panel1_Click);
- //
- // label2
- //
- this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label2.Location = new System.Drawing.Point(198, 49);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(45, 14);
- this.label2.TabIndex = 1;
- //
- // label1
- //
- this.label1.AutoEllipsis = true;
- this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label1.Location = new System.Drawing.Point(7, 49);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(45, 14);
- this.label1.TabIndex = 0;
- //
- // ChangeParameter
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.AutoSize = true;
- this.BackColor = System.Drawing.SystemColors.Control;
- this.ClientSize = new System.Drawing.Size(502, 227);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "ChangeParameter";
- this.Load += new System.EventHandler(this.ChangeParameter_Load);
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox2, 0);
- this.groupBox1.ResumeLayout(false);
- this.groupBox2.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.Button button2;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.GroupBox groupBox2;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Panel panel1;
- private void panel1_Click(object sender, System.EventArgs e)
- {
- this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor);
- this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.colorsForm1Changed));
- this.colorsForm1.ShowDialog();
- }
- private void colorsForm1Changed(object sender, EventArgs e)
- {
- this.panel1.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
- this.colorsForm1.Close();
- }
- private void ChangeParameter_Load(object sender, EventArgs e)
- {
- InitOtherTools();
- changeSize();
- }
- //<summary>
- //初始化其他控件
- //</summary>
- private void InitOtherTools()
- {
- //
- //调色板
- //
- this.colorsForm1 = new ColorsForm();
- this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- }
- private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- GrayironDialog.fontColor = panel1.BackColor;
- GrayironDialog.fontSize= numericUpDown1.Text;
- this.Close();
- }
- private void changeSize()
- {
- if (GrayironDialog.fontSize !=null && GrayironDialog.fontColor!=null)
- {
- this.numericUpDown1.Text= GrayironDialog.fontSize;
- this.panel1.BackColor= GrayironDialog.fontColor;
- }
- }
- }
- }
|