Debugger: Adjust character limit in goto popup based on memory size

This commit is contained in:
Sour 2018-03-15 17:14:41 -04:00
parent b79983ec2f
commit aee63d072c
3 changed files with 5 additions and 3 deletions

View file

@ -172,7 +172,7 @@ namespace Mesen.GUI.Debugger.Controls
int currentAddr = (int)(this.ctrlHexBox.CurrentLine - 1) * this.ctrlHexBox.BytesPerLine;
address.Address = (UInt32)currentAddr;
frmGoToLine frm = new frmGoToLine(address);
frmGoToLine frm = new frmGoToLine(address, (_byteProvider.Length - 1).ToString("X").Length);
frm.StartPosition = FormStartPosition.Manual;
Point topLeft = this.PointToScreen(new Point(0, 0));
frm.Location = new Point(topLeft.X + (this.Width - frm.Width) / 2, topLeft.Y + (this.Height - frm.Height) / 2);

View file

@ -506,7 +506,7 @@ namespace Mesen.GUI.Debugger
address.Address = (UInt32)currentAddr;
frmGoToLine frm = new frmGoToLine(address);
frmGoToLine frm = new frmGoToLine(address, 4);
frm.StartPosition = FormStartPosition.Manual;
Point topLeft = this.PointToScreen(new Point(0, 0));
frm.Location = new Point(topLeft.X + (this.Width - frm.Width) / 2, topLeft.Y + (this.Height - frm.Height) / 2);

View file

@ -13,12 +13,14 @@ namespace Mesen.GUI.Debugger
{
public partial class frmGoToLine : BaseConfigForm
{
public frmGoToLine(GoToAddress address)
public frmGoToLine(GoToAddress address, int charLimit)
{
InitializeComponent();
Entity = address;
AddBinding("Address", txtAddress);
txtAddress.MaxLength = charLimit;
}
protected override void OnShown(EventArgs e)