Skip to content

Commit

Permalink
some keys shorcuts added
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandrofly committed May 8, 2014
1 parent 6dce807 commit 99c6b4b
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/Forms/GoToLine.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System;
using Nikse.SubtitleEdit.Logic;
using System;
using System.Drawing;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;

namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class GoToLine : Form
{
private int _max;
private int _min;
int _lineNumber;
private int _lineNumber;

public GoToLine()
{
Expand Down Expand Up @@ -44,7 +44,7 @@ public void Initialize(int min, int max)
{
_min = min;
_max = max;
labelGoToLine.Text = string.Format(Text + " ({0} - {1})", min, max);
labelGoToLine.Text = string.Format(Text + " ({0} - {1})", min, max);
}

private void FormGoToLine_KeyDown(object sender, KeyEventArgs e)
Expand Down Expand Up @@ -81,9 +81,25 @@ private void TextBox1KeyDown(object sender, KeyEventArgs e)
e.KeyCode == Keys.Left ||
e.KeyCode == Keys.Right ||
e.KeyCode == Keys.Back ||
e.KeyCode == Keys.Home ||
e.KeyCode == Keys.End ||
(e.KeyValue >= 96 && e.KeyValue <= 105))
{
}
else if (e.KeyData == (Keys.Shift | Keys.Home) || e.KeyData == (Keys.Shift | Keys.End))
{

}
else if (e.KeyData == (Keys.Control | Keys.V) && Clipboard.GetText(TextDataFormat.UnicodeText).Length > 0)
{
string p = Clipboard.GetText(TextDataFormat.UnicodeText);
int num;
if (!int.TryParse(p, out num))
{
e.Handled = true;
e.SuppressKeyPress = true;
}
}
else
{
e.Handled = true;
Expand All @@ -110,4 +126,4 @@ private void ButtonCancelClick(object sender, EventArgs e)
DialogResult = DialogResult.Cancel;
}
}
}
}

0 comments on commit 99c6b4b

Please sign in to comment.