Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
VladiStep committed Dec 31, 2023
1 parent 979db25 commit 7c9e5a1
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 106 deletions.
200 changes: 97 additions & 103 deletions UndertaleModTool/Windows/TextInput.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions UndertaleModTool/Windows/TextInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public TextInput(string message, string title, string defaultValue, bool allowMu
label1.Text = message;
richTextBox1.Multiline = AllowMultiline;
richTextBox1.DetectUrls = false;
richTextBox1.LanguageOption = RichTextBoxLanguageOptions.UIFonts; //prevents the bug with Japanese characters
richTextBox1.LanguageOption = RichTextBoxLanguageOptions.UIFonts; // Prevents the bug with Japanese characters
richTextBox1.ReadOnly = readOnly;

label1.AutoSize = false;
Expand All @@ -100,7 +100,7 @@ public TextInput(string message, string title, string defaultValue, bool allowMu

private void TextInput_Load(object sender, EventArgs e)
{
richTextBox1.Clear(); //remove "Input text here"
richTextBox1.Clear(); // Remove "Input text here"

if (DefaultValue.Length > 0)
{
Expand All @@ -111,14 +111,24 @@ private void TextInput_Load(object sender, EventArgs e)

if (richTextBox1.ReadOnly)
{
richTextBox1.BackColor = TextBoxBGColor; //restore color to default one.
richTextBox1.BackColor = TextBoxBGColor; // Restore color to default one.
richTextBox1.ContextMenuStrip = textCopyMenu;
}
}

private void richTextBox1_TextChanged(object sender, EventArgs e)
{
}
private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
// Prevent image pasting
if (e.Control && e.KeyCode == Keys.V)
{
if (Clipboard.ContainsText())
richTextBox1.Paste(DataFormats.GetFormat(DataFormats.Text));
e.Handled = true;
}
}

private void button1_Click(object sender, EventArgs e)
{
Expand Down

0 comments on commit 7c9e5a1

Please sign in to comment.