don't let the NumericTextBoxes cause selection to change more than once

This commit is contained in:
Michael Becker 2020-05-15 08:40:18 -04:00
parent c1458948a4
commit cd446a5238
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -511,17 +511,20 @@ namespace UniversalEditor.Editors.Binary
[EventHandler(nameof(txtStart), "Changed")]
private void txtStart_Changed(object sender, EventArgs e)
{
hexedit.SelectionStart = new HexEditorPosition((int)txtStart.Value, 0);
if (hexedit.SelectionStart.ByteIndex != (int)txtStart.Value)
hexedit.SelectionStart = new HexEditorPosition((int)txtStart.Value, 0);
}
[EventHandler(nameof(txtEnd), "Changed")]
private void txtEnd_Changed(object sender, EventArgs e)
{
hexedit.SelectionLength = new HexEditorPosition((int)txtEnd.Value - hexedit.SelectionStart, 0);
if (hexedit.SelectionLength.ByteIndex != (int)txtEnd.Value - hexedit.SelectionStart)
hexedit.SelectionLength = new HexEditorPosition((int)txtEnd.Value - hexedit.SelectionStart, 0);
}
[EventHandler(nameof(txtLength), "Changed")]
private void txtLength_Changed(object sender, EventArgs e)
{
hexedit.SelectionLength = new HexEditorPosition((int)txtLength.Value, 0);
if (hexedit.SelectionLength.ByteIndex != (int)txtLength.Value)
hexedit.SelectionLength = new HexEditorPosition((int)txtLength.Value, 0);
}
[EventHandler(nameof(hexedit), "Changing")]