Debugger: Hex Editor - Give hex editor focus when opening window

This commit is contained in:
Sour 2019-05-01 22:39:54 -04:00
parent 87fddaa751
commit 3aab451076
3 changed files with 25 additions and 13 deletions

View file

@ -43,7 +43,12 @@ namespace Mesen.GUI.Debugger.Controls
this.cboNumberColumns.SelectedIndex = ConfigManager.Config.Debug.HexEditor.ColumnCount; this.cboNumberColumns.SelectedIndex = ConfigManager.Config.Debug.HexEditor.ColumnCount;
} }
} }
public new void Focus()
{
this.ctrlHexBox.Focus();
}
public byte[] GetData() public byte[] GetData()
{ {
return this._byteProvider != null ? this._byteProvider.Bytes.ToArray() : new byte[0]; return this._byteProvider != null ? this._byteProvider.Bytes.ToArray() : new byte[0];

View file

@ -313,7 +313,7 @@
// mnuFadeSlow // mnuFadeSlow
// //
this.mnuFadeSlow.Name = "mnuFadeSlow"; this.mnuFadeSlow.Name = "mnuFadeSlow";
this.mnuFadeSlow.Size = new System.Drawing.Size(152, 22); this.mnuFadeSlow.Size = new System.Drawing.Size(136, 22);
this.mnuFadeSlow.Text = "Slow"; this.mnuFadeSlow.Text = "Slow";
this.mnuFadeSlow.Click += new System.EventHandler(this.mnuFadeSpeed_Click); this.mnuFadeSlow.Click += new System.EventHandler(this.mnuFadeSpeed_Click);
// //
@ -322,33 +322,33 @@
this.mnuFadeNormal.Checked = true; this.mnuFadeNormal.Checked = true;
this.mnuFadeNormal.CheckState = System.Windows.Forms.CheckState.Checked; this.mnuFadeNormal.CheckState = System.Windows.Forms.CheckState.Checked;
this.mnuFadeNormal.Name = "mnuFadeNormal"; this.mnuFadeNormal.Name = "mnuFadeNormal";
this.mnuFadeNormal.Size = new System.Drawing.Size(152, 22); this.mnuFadeNormal.Size = new System.Drawing.Size(136, 22);
this.mnuFadeNormal.Text = "Normal"; this.mnuFadeNormal.Text = "Normal";
this.mnuFadeNormal.Click += new System.EventHandler(this.mnuFadeSpeed_Click); this.mnuFadeNormal.Click += new System.EventHandler(this.mnuFadeSpeed_Click);
// //
// mnuFadeFast // mnuFadeFast
// //
this.mnuFadeFast.Name = "mnuFadeFast"; this.mnuFadeFast.Name = "mnuFadeFast";
this.mnuFadeFast.Size = new System.Drawing.Size(152, 22); this.mnuFadeFast.Size = new System.Drawing.Size(136, 22);
this.mnuFadeFast.Text = "Fast"; this.mnuFadeFast.Text = "Fast";
this.mnuFadeFast.Click += new System.EventHandler(this.mnuFadeSpeed_Click); this.mnuFadeFast.Click += new System.EventHandler(this.mnuFadeSpeed_Click);
// //
// mnuFadeNever // mnuFadeNever
// //
this.mnuFadeNever.Name = "mnuFadeNever"; this.mnuFadeNever.Name = "mnuFadeNever";
this.mnuFadeNever.Size = new System.Drawing.Size(152, 22); this.mnuFadeNever.Size = new System.Drawing.Size(136, 22);
this.mnuFadeNever.Text = "Do not fade"; this.mnuFadeNever.Text = "Do not fade";
this.mnuFadeNever.Click += new System.EventHandler(this.mnuFadeSpeed_Click); this.mnuFadeNever.Click += new System.EventHandler(this.mnuFadeSpeed_Click);
// //
// toolStripMenuItem7 // toolStripMenuItem7
// //
this.toolStripMenuItem7.Name = "toolStripMenuItem7"; this.toolStripMenuItem7.Name = "toolStripMenuItem7";
this.toolStripMenuItem7.Size = new System.Drawing.Size(149, 6); this.toolStripMenuItem7.Size = new System.Drawing.Size(133, 6);
// //
// mnuCustomFadeSpeed // mnuCustomFadeSpeed
// //
this.mnuCustomFadeSpeed.Name = "mnuCustomFadeSpeed"; this.mnuCustomFadeSpeed.Name = "mnuCustomFadeSpeed";
this.mnuCustomFadeSpeed.Size = new System.Drawing.Size(152, 22); this.mnuCustomFadeSpeed.Size = new System.Drawing.Size(136, 22);
this.mnuCustomFadeSpeed.Text = "Custom..."; this.mnuCustomFadeSpeed.Text = "Custom...";
this.mnuCustomFadeSpeed.Click += new System.EventHandler(this.mnuCustomFadeSpeed_Click); this.mnuCustomFadeSpeed.Click += new System.EventHandler(this.mnuCustomFadeSpeed_Click);
// //
@ -648,27 +648,28 @@
// mnuGoToAll // mnuGoToAll
// //
this.mnuGoToAll.Name = "mnuGoToAll"; this.mnuGoToAll.Name = "mnuGoToAll";
this.mnuGoToAll.Size = new System.Drawing.Size(145, 22); this.mnuGoToAll.Size = new System.Drawing.Size(152, 22);
this.mnuGoToAll.Text = "Go to All"; this.mnuGoToAll.Text = "Go to All";
this.mnuGoToAll.Visible = false;
this.mnuGoToAll.Click += new System.EventHandler(this.mnuGoToAll_Click); this.mnuGoToAll.Click += new System.EventHandler(this.mnuGoToAll_Click);
// //
// mnuGoTo // mnuGoTo
// //
this.mnuGoTo.Name = "mnuGoTo"; this.mnuGoTo.Name = "mnuGoTo";
this.mnuGoTo.Size = new System.Drawing.Size(145, 22); this.mnuGoTo.Size = new System.Drawing.Size(152, 22);
this.mnuGoTo.Text = "Go To..."; this.mnuGoTo.Text = "Go To...";
this.mnuGoTo.Click += new System.EventHandler(this.mnuGoTo_Click); this.mnuGoTo.Click += new System.EventHandler(this.mnuGoTo_Click);
// //
// toolStripMenuItem14 // toolStripMenuItem14
// //
this.toolStripMenuItem14.Name = "toolStripMenuItem14"; this.toolStripMenuItem14.Name = "toolStripMenuItem14";
this.toolStripMenuItem14.Size = new System.Drawing.Size(142, 6); this.toolStripMenuItem14.Size = new System.Drawing.Size(149, 6);
// //
// mnuFind // mnuFind
// //
this.mnuFind.Image = global::Mesen.GUI.Properties.Resources.Find; this.mnuFind.Image = global::Mesen.GUI.Properties.Resources.Find;
this.mnuFind.Name = "mnuFind"; this.mnuFind.Name = "mnuFind";
this.mnuFind.Size = new System.Drawing.Size(145, 22); this.mnuFind.Size = new System.Drawing.Size(152, 22);
this.mnuFind.Text = "Find..."; this.mnuFind.Text = "Find...";
this.mnuFind.Click += new System.EventHandler(this.mnuFind_Click); this.mnuFind.Click += new System.EventHandler(this.mnuFind_Click);
// //
@ -676,7 +677,7 @@
// //
this.mnuFindNext.Image = global::Mesen.GUI.Properties.Resources.NextArrow; this.mnuFindNext.Image = global::Mesen.GUI.Properties.Resources.NextArrow;
this.mnuFindNext.Name = "mnuFindNext"; this.mnuFindNext.Name = "mnuFindNext";
this.mnuFindNext.Size = new System.Drawing.Size(145, 22); this.mnuFindNext.Size = new System.Drawing.Size(152, 22);
this.mnuFindNext.Text = "Find Next"; this.mnuFindNext.Text = "Find Next";
this.mnuFindNext.Click += new System.EventHandler(this.mnuFindNext_Click); this.mnuFindNext.Click += new System.EventHandler(this.mnuFindNext_Click);
// //
@ -684,7 +685,7 @@
// //
this.mnuFindPrev.Image = global::Mesen.GUI.Properties.Resources.PreviousArrow; this.mnuFindPrev.Image = global::Mesen.GUI.Properties.Resources.PreviousArrow;
this.mnuFindPrev.Name = "mnuFindPrev"; this.mnuFindPrev.Name = "mnuFindPrev";
this.mnuFindPrev.Size = new System.Drawing.Size(145, 22); this.mnuFindPrev.Size = new System.Drawing.Size(152, 22);
this.mnuFindPrev.Text = "Find Previous"; this.mnuFindPrev.Text = "Find Previous";
this.mnuFindPrev.Click += new System.EventHandler(this.mnuFindPrev_Click); this.mnuFindPrev.Click += new System.EventHandler(this.mnuFindPrev_Click);
// //

View file

@ -93,6 +93,12 @@ namespace Mesen.GUI.Debugger
this.InitShortcuts(); this.InitShortcuts();
} }
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
ctrlHexViewer.Focus();
}
protected override void OnFormClosing(FormClosingEventArgs e) protected override void OnFormClosing(FormClosingEventArgs e)
{ {
base.OnFormClosing(e); base.OnFormClosing(e);