diff --git a/nppRandomStringGenerator/Forms/ConfigAndGenerate.Designer.cs b/nppRandomStringGenerator/Forms/ConfigAndGenerate.Designer.cs index 96d0145..e1c3902 100644 --- a/nppRandomStringGenerator/Forms/ConfigAndGenerate.Designer.cs +++ b/nppRandomStringGenerator/Forms/ConfigAndGenerate.Designer.cs @@ -507,6 +507,7 @@ private void InitializeComponent() this.TextBoxReplace.Text = "{{REPLACE}}"; this.TextBoxReplace.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.TextBoxReplace.TextChanged += new System.EventHandler(this.TextBoxReplace_TextChanged); + this.TextBoxReplace.Validating += new System.ComponentModel.CancelEventHandler(this.TextBoxReplace_Validating); // // RadioButtonReplace // diff --git a/nppRandomStringGenerator/Forms/ConfigAndGenerate.cs b/nppRandomStringGenerator/Forms/ConfigAndGenerate.cs index 42459ef..855b73d 100644 --- a/nppRandomStringGenerator/Forms/ConfigAndGenerate.cs +++ b/nppRandomStringGenerator/Forms/ConfigAndGenerate.cs @@ -134,6 +134,13 @@ private void SaveSettings() private async void ButtonGenerate_Click(Object sender, EventArgs e) { + if (RadioButtonReplace.Checked && TextBoxReplace.TextLength == 0) + { + MessageBox.Show("Please enter a placeholder to replace."); + TextBoxReplace.Focus(); + return; + } + this.Cursor = Cursors.WaitCursor; this.AvailableChars = ""; @@ -169,6 +176,7 @@ private async void ButtonGenerate_Click(Object sender, EventArgs e) if (RadioButtonNew.Checked) this.Notepad.FileNew(); if (RadioButtonCurrent.Checked) this.Editor.DocumentEnd(); if (RadioButtonInline.Checked) this.Editor.DocumentStart(); + if (RadioButtonReplace.Checked) this.Editor.DocumentStart(); Generator = new StringGenerator { @@ -360,7 +368,7 @@ private void ButtonCancel_Click(object sender, EventArgs e) private void ComboBoxGUIDFormat_SelectedIndexChanged(object sender, EventArgs e) { - label20.Visible = false; + this.button1.PerformClick(); } private void button1_Click(object sender, EventArgs e) @@ -411,6 +419,11 @@ private int GetReplacementCount() } private void TextBoxReplace_TextChanged(object sender, EventArgs e) + { + + } + + private void TextBoxReplace_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (RadioButtonReplace.Checked && TextBoxReplace.Text.Length > 0) { diff --git a/nppRandomStringGenerator/Properties/AssemblyInfo.cs b/nppRandomStringGenerator/Properties/AssemblyInfo.cs index 4239495..7547f10 100644 --- a/nppRandomStringGenerator/Properties/AssemblyInfo.cs +++ b/nppRandomStringGenerator/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.9.9")] -[assembly: AssemblyFileVersion("1.9.9")] +[assembly: AssemblyVersion("1.9.10")] +[assembly: AssemblyFileVersion("1.9.10")]