void Debugger_OnInstructionChanged(object sender, Instruction instruction) { GridOpCode.CurrentCell = GridOpCode.Rows[instruction == null ? 0 : (int)instruction.Location.Index].Cells[3]; Jumps.RefreshDynJumps(Debugger); GridOpCode.Refresh(); GridAltStack.Refresh(); GridStack.Refresh(); Registers.Refresh(); }
void GridOpCode_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { DataGridView.HitTestInfo hti = GridOpCode.HitTest(e.X, e.Y); GridOpCode.ClearSelection(); if (hti.RowIndex < 0) { return; } GridOpCode.Rows[hti.RowIndex].Selected = true; } }
void UpdateDebugState() { int instruction = Debugger == null ? 0 : (int)Debugger.CurrentInstructionIndex; GridOpCode.Invalidate(); Registers.Refresh(); //GridOpCode.ClearSelection(); //GridOpCode.Rows[(int)instructionIndex].Selected = true; GridOpCode.CurrentCell = GridOpCode.Rows[instruction].Cells[3]; Jumps.RefreshDynJumps(Debugger); //Application.DoEvents(); }
/// <summary> /// Create breakpoint /// </summary> void GridOpCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Space) { e.Handled = true; e.SuppressKeyPress = true; foreach (DataGridViewRow r in GridOpCode.SelectedRows) { if (r.IsNewRow || r.DataBoundItem == null) { continue; } if (r.DataBoundItem is Instruction i) { i.BreakPoint = !i.BreakPoint; GridOpCode.InvalidateRow(r.Index); } } } }