Debugger - tooltips on disabled things, explaining the situation

This commit is contained in:
adelikat 2014-12-20 14:45:06 +00:00
parent 888fc35eb0
commit 83ba7796f9
4 changed files with 57 additions and 0 deletions

View File

@ -89,6 +89,7 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
else
{
this.Enabled = false;
ParentDebugger.DisableBreakpointBox();
}
}

View File

@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GenericDebugger));
this.menuStrip1 = new MenuStripEx();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -55,6 +56,7 @@
this.StepOutBtn = new System.Windows.Forms.Button();
this.StepIntoBtn = new System.Windows.Forms.Button();
this.StepOverBtn = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.menuStrip1.SuspendLayout();
this.RegistersGroupBox.SuspendLayout();
this.BreakpointsGroupBox.SuspendLayout();
@ -227,6 +229,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.BreakPointControl1.Core = null;
this.BreakPointControl1.Location = new System.Drawing.Point(8, 19);
this.BreakPointControl1.MCS = null;
this.BreakPointControl1.Name = "BreakPointControl1";
this.BreakPointControl1.ParentDebugger = null;
this.BreakPointControl1.Size = new System.Drawing.Size(225, 256);
@ -339,6 +342,7 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Debugger";
this.Load += new System.EventHandler(this.GenericDebugger_Load);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.GenericDebugger_MouseMove);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.RegistersGroupBox.ResumeLayout(false);
@ -378,5 +382,6 @@
private System.Windows.Forms.ToolStripMenuItem StepIntoMenuItem;
private System.Windows.Forms.ToolStripMenuItem StepOverMenuItem;
private System.Windows.Forms.ToolStripMenuItem StepOutMenuItem;
private System.Windows.Forms.ToolTip toolTip1;
}
}

View File

@ -77,6 +77,13 @@ namespace BizHawk.Client.EmuHawk
public void DisableRegisterBox()
{
RegistersGroupBox.Enabled = false;
toolTip1.SetToolTip(RegistersGroupBox, "This core does not currently support reading registers");
}
public void DisableBreakpointBox()
{
BreakpointsGroupBox.Enabled = false;
toolTip1.SetToolTip(BreakpointsGroupBox, "This core does not currently support breakpoints");
}
private void OnCpuDropDownIndexChanged(object sender, EventArgs e)
@ -130,6 +137,8 @@ namespace BizHawk.Client.EmuHawk
Location = new Point(35, 23),
Text = "Unknown"
});
toolTip1.SetToolTip(DisassemblerBox, "This core does not currently support disassembling");
}
RegisterPanel.Core = Debuggable;
@ -144,6 +153,21 @@ namespace BizHawk.Client.EmuHawk
StepIntoMenuItem.Enabled = StepIntoBtn.Enabled = CanStepInto;
StepOutMenuItem.Enabled = StepOutBtn.Enabled = CanStepOut;
StepOverMenuItem.Enabled = StepOverBtn.Enabled = CanStepOver;
if (!StepIntoMenuItem.Enabled)
{
toolTip1.SetToolTip(StepIntoBtn, "This core does not currently implement this feature");
}
if (!StepOutMenuItem.Enabled)
{
toolTip1.SetToolTip(StepOutBtn, "This core does not currently implement this feature");
}
if (!StepOverMenuItem.Enabled)
{
toolTip1.SetToolTip(StepOverBtn, "This core does not currently implement this feature");
}
}
private void DisengageDebugger()
@ -339,5 +363,29 @@ namespace BizHawk.Client.EmuHawk
return base.ProcessCmdKey(ref msg, keyData);
}
}
private Control _currentToolTipControl = null;
private void GenericDebugger_MouseMove(object sender, MouseEventArgs e)
{
var control = GetChildAtPoint(e.Location);
if (control != null)
{
if (!control.Enabled && _currentToolTipControl == null)
{
string toolTipString = toolTip1.GetToolTip(control);
toolTip1.Show(toolTipString, control, control.Width / 2, control.Height / 2);
_currentToolTipControl = control;
}
}
else
{
if (_currentToolTipControl != null)
{
toolTip1.Hide(_currentToolTipControl);
}
_currentToolTipControl = null;
}
}
}
}

View File

@ -120,6 +120,9 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>