Debugger - breakpoints - add stuff like activating/deactivating, key presses, double click
This commit is contained in:
parent
91353d776b
commit
cdcb806d8c
|
@ -56,6 +56,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public Breakpoint(IDebuggable core, IMemoryCallback callback)
|
||||
{
|
||||
_core = core;
|
||||
_active = true;
|
||||
Callback = callback.Callback;
|
||||
Address = callback.Address;
|
||||
Type = callback.Type;
|
||||
|
|
|
@ -84,6 +84,9 @@
|
|||
this.BreakpointView.UseCompatibleStateImageBehavior = false;
|
||||
this.BreakpointView.UseCustomBackground = true;
|
||||
this.BreakpointView.View = System.Windows.Forms.View.Details;
|
||||
this.BreakpointView.ItemActivate += new System.EventHandler(this.BreakpointView_ItemActivate);
|
||||
this.BreakpointView.SelectedIndexChanged += new System.EventHandler(this.BreakpointView_SelectedIndexChanged);
|
||||
this.BreakpointView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.BreakpointView_KeyDown);
|
||||
//
|
||||
// columnHeader1
|
||||
//
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
|
|||
{
|
||||
InitializeComponent();
|
||||
BreakpointView.QueryItemText += BreakPointView_QueryItemText;
|
||||
BreakpointView.QueryItemBkColor += BreakPointView_QueryItemBkColor;
|
||||
BreakpointView.VirtualMode = true;
|
||||
Breakpoints.Callback = BreakpointCallback;
|
||||
}
|
||||
|
@ -48,6 +49,11 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
|
|||
}
|
||||
}
|
||||
|
||||
private void BreakPointView_QueryItemBkColor(int index, int column, ref Color color)
|
||||
{
|
||||
color = Breakpoints[index].Active ? Color.LightCyan : SystemColors.Control;
|
||||
}
|
||||
|
||||
private void BreakpointCallback()
|
||||
{
|
||||
GlobalWin.MainForm.PauseEmulator();
|
||||
|
@ -73,6 +79,7 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
|
|||
|
||||
BreakpointView.ItemCount = Breakpoints.Count;
|
||||
BreakpointView.Refresh();
|
||||
UpdateBreakpointRemoveButton();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -129,5 +136,36 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
|
|||
{
|
||||
RemoveBreakpointButton.Enabled = BreakpointView.SelectedIndices.Count > 0;
|
||||
}
|
||||
|
||||
private void BreakpointView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateBreakpointRemoveButton();
|
||||
}
|
||||
|
||||
private void BreakpointView_ItemActivate(object sender, EventArgs e)
|
||||
{
|
||||
if (BreakpointView.SelectedIndices.Count > 0)
|
||||
{
|
||||
var items = SelectedItems.ToList();
|
||||
if (items.Any())
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
item.Active ^= true;
|
||||
}
|
||||
|
||||
BreakpointView.ItemCount = Breakpoints.Count;
|
||||
UpdateBreakpointRemoveButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BreakpointView_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (!e.Control && !e.Alt && !e.Shift && e.KeyCode == Keys.Delete) // Delete
|
||||
{
|
||||
RemoveBreakpointButton_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue