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