From 36dcf53cc0d5a4702a09128ff9812f78e9f4763b Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 9 Nov 2016 10:19:49 -0600 Subject: [PATCH] on specialized number boxes, select all text when reseting an empty box to a default value. This fixes #685 --- BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs | 4 ++++ BizHawk.Client.EmuHawk/tools/Watch/WatchValueBox.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs b/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs index 6074e8e33a..b4b3569a59 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs @@ -129,6 +129,8 @@ namespace BizHawk.Client.EmuHawk if (string.IsNullOrWhiteSpace(Text)) { ResetText(); + SelectAll(); + return; } base.OnTextChanged(e); @@ -252,6 +254,8 @@ namespace BizHawk.Client.EmuHawk if (string.IsNullOrWhiteSpace(Text) || !Text.IsHex()) { ResetText(); + SelectAll(); + return; } base.OnTextChanged(e); diff --git a/BizHawk.Client.EmuHawk/tools/Watch/WatchValueBox.cs b/BizHawk.Client.EmuHawk/tools/Watch/WatchValueBox.cs index 9a8757a4b0..39a8279c1f 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/WatchValueBox.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/WatchValueBox.cs @@ -589,6 +589,8 @@ namespace BizHawk.Client.EmuHawk if (string.IsNullOrWhiteSpace(Text)) { ResetText(); + SelectAll(); + return; } switch (_type)