123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace PaintDotNet.FieldView
- {
- /// <summary>
- /// 重命名视场窗口
- /// </summary>
- public partial class EditViewDialog : PdnBaseForm
- {
- private PdnBaseForm pdnBaseForm;
- public TextBox textBox1;
- private Button button1;
- private Button button2;
- private Label label2;
- public RichTextBox richTextBox1;
- private Label label1;
- public EditViewDialog(PdnBaseForm pdnBaseForm)
- {
- this.pdnBaseForm = pdnBaseForm;
- InitializeComponent();
- InitializeLanguageText();
- }
- /// <summary>
- /// 设置值,用于修改
- /// </summary>
- public void SetTextBoxValue(string name)
- {
- this.textBox1.Text = name;
- }
- private void InitializeLanguageText()
- {
- this.label1.Text = PdnResources.GetString("Menu.name.text") + ":";
- this.button1.Text = PdnResources.GetString("Menu.File.Save.Text");
- this.button2.Text = PdnResources.GetString("Menu.File.Close.Text");
- this.label2.Text = PdnResources.GetString("Menu.describe.Text") + ":";
- this.Text = PdnResources.GetString("Menu.Pleaseenteranameofthephase.text");
- }
- private void InitializeComponent()
- {
- this.label1 = new System.Windows.Forms.Label();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.label2 = new System.Windows.Forms.Label();
- this.richTextBox1 = new System.Windows.Forms.RichTextBox();
- this.SuspendLayout();
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(13, 17);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(41, 12);
- this.label1.TabIndex = 0;
- this.label1.Text = "名称:";
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(60, 13);
- this.textBox1.MaxLength = 10;
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(212, 21);
- this.textBox1.TabIndex = 1;
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(115, 140);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 2;
- this.button1.Text = "保存";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // button2
- //
- this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.button2.Location = new System.Drawing.Point(197, 140);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(75, 23);
- this.button2.TabIndex = 3;
- this.button2.Text = "关闭";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(13, 48);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(41, 12);
- this.label2.TabIndex = 4;
- this.label2.Text = "描述:";
- //
- // richTextBox1
- //
- this.richTextBox1.Location = new System.Drawing.Point(60, 48);
- this.richTextBox1.Name = "richTextBox1";
- this.richTextBox1.Size = new System.Drawing.Size(212, 76);
- this.richTextBox1.TabIndex = 5;
- this.richTextBox1.Text = "";
- //
- // EditViewDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.AutoSize = true;
- this.ClientSize = new System.Drawing.Size(284, 175);
- this.Controls.Add(this.richTextBox1);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.button2);
- this.Controls.Add(this.button1);
- this.Controls.Add(this.textBox1);
- this.Controls.Add(this.label1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "EditViewDialog";
- this.Text = "重命名";
- this.Controls.SetChildIndex(this.label1, 0);
- this.Controls.SetChildIndex(this.textBox1, 0);
- this.Controls.SetChildIndex(this.button1, 0);
- this.Controls.SetChildIndex(this.button2, 0);
- this.Controls.SetChildIndex(this.label2, 0);
- this.Controls.SetChildIndex(this.richTextBox1, 0);
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(this.textBox1.Text))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseenteranameofthephase.text"));
- return;
- }
- this.pdnBaseForm.GetCreateName(this.textBox1.Text, this.richTextBox1.Text);
- }
- private void button2_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
|