Hex Editor - Find box - remember Hex vs Text radio selection
This commit is contained in:
parent
3a852707c4
commit
4db328f7ad
|
@ -1489,7 +1489,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
UpdateValues();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _lastSearchWasText = false;
|
||||
private void SearchTypeChanged(bool isText)
|
||||
{
|
||||
_lastSearchWasText = isText;
|
||||
}
|
||||
|
||||
private void FindMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -1499,7 +1505,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
_hexFind = new HexFind
|
||||
{
|
||||
InitialLocation = PointToScreen(AddressesLabel.Location),
|
||||
InitialValue = _findStr
|
||||
InitialValue = _findStr,
|
||||
SearchTypeChangedCallback = SearchTypeChanged,
|
||||
InitialText = _lastSearchWasText
|
||||
};
|
||||
|
||||
_hexFind.Show();
|
||||
|
|
|
@ -13,7 +13,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
ChangeCasing();
|
||||
}
|
||||
|
||||
// Hacky values to remember the Hex vs Text radio selection across searches
|
||||
public Action<bool> SearchTypeChangedCallback { get; set; }
|
||||
public bool InitialText { get; set; }
|
||||
|
||||
public Point InitialLocation { get; set; }
|
||||
|
||||
|
||||
public string InitialValue
|
||||
{
|
||||
|
@ -28,8 +33,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
Location = InitialLocation;
|
||||
}
|
||||
|
||||
if (InitialText)
|
||||
{
|
||||
TextRadio.Select();
|
||||
}
|
||||
|
||||
FindBox.Focus();
|
||||
FindBox.Select();
|
||||
|
||||
}
|
||||
|
||||
private string GetFindBoxChars()
|
||||
|
@ -100,11 +111,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void HexRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ChangeCasing();
|
||||
SearchTypeChangedCallback?.Invoke(false);
|
||||
}
|
||||
|
||||
private void TextRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ChangeCasing();
|
||||
SearchTypeChangedCallback?.Invoke(true);
|
||||
}
|
||||
|
||||
private void FindBox_KeyDown(object sender, KeyEventArgs e)
|
||||
|
|
Loading…
Reference in New Issue