Hex Editor - fix vertical scrollbar logic
This commit is contained in:
parent
c5a7e43331
commit
2bf6f959cf
|
@ -251,6 +251,7 @@ namespace BizHawk.MultiClient
|
||||||
CloseGame();
|
CloseGame();
|
||||||
Global.Emulator = new NullEmulator();
|
Global.Emulator = new NullEmulator();
|
||||||
RamSearch1.Restart();
|
RamSearch1.Restart();
|
||||||
|
HexEditor1.Restart();
|
||||||
Text = "BizHawk";
|
Text = "BizHawk";
|
||||||
HandlePlatformMenus("");
|
HandlePlatformMenus("");
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,6 +199,7 @@
|
||||||
this.Name = "HexEditor";
|
this.Name = "HexEditor";
|
||||||
this.Text = "HexEditor";
|
this.Text = "HexEditor";
|
||||||
this.Load += new System.EventHandler(this.HexEditor_Load);
|
this.Load += new System.EventHandler(this.HexEditor_Load);
|
||||||
|
this.Resize += new System.EventHandler(this.HexEditor_Resize);
|
||||||
this.menuStrip1.ResumeLayout(false);
|
this.menuStrip1.ResumeLayout(false);
|
||||||
this.menuStrip1.PerformLayout();
|
this.menuStrip1.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
|
@ -12,7 +12,6 @@ namespace BizHawk.MultiClient
|
||||||
public partial class HexEditor : Form
|
public partial class HexEditor : Form
|
||||||
{
|
{
|
||||||
//TODO:
|
//TODO:
|
||||||
//Length of values doesn't match
|
|
||||||
//Find text box - autohighlights matches, and shows total matches
|
//Find text box - autohighlights matches, and shows total matches
|
||||||
//Implement Goto address
|
//Implement Goto address
|
||||||
//Users can customize background, & text colors
|
//Users can customize background, & text colors
|
||||||
|
@ -82,7 +81,7 @@ namespace BizHawk.MultiClient
|
||||||
e.Graphics.DrawString(HEADER, font, regBrush, new Point(rowX, rowY));
|
e.Graphics.DrawString(HEADER, font, regBrush, new Point(rowX, rowY));
|
||||||
e.Graphics.DrawLine(new Pen(regBrush), MemoryViewer.Left + 38, MemoryViewer.Top, MemoryViewer.Left + 38, MemoryViewer.Bottom - 40);
|
e.Graphics.DrawLine(new Pen(regBrush), MemoryViewer.Left + 38, MemoryViewer.Top, MemoryViewer.Left + 38, MemoryViewer.Bottom - 40);
|
||||||
e.Graphics.DrawLine(new Pen(regBrush), MemoryViewer.Left, 34, MemoryViewer.Right - 16, 34);
|
e.Graphics.DrawLine(new Pen(regBrush), MemoryViewer.Left, 34, MemoryViewer.Right - 16, 34);
|
||||||
|
int zzz = Domain.Size / 16;
|
||||||
for (int i = 0; i < Domain.Size / 16; i++)
|
for (int i = 0; i < Domain.Size / 16; i++)
|
||||||
{
|
{
|
||||||
row = i+vScrollBar1.Value;
|
row = i+vScrollBar1.Value;
|
||||||
|
@ -106,6 +105,7 @@ namespace BizHawk.MultiClient
|
||||||
public void Restart()
|
public void Restart()
|
||||||
{
|
{
|
||||||
SetMemoryDomainMenu(); //Calls update routines
|
SetMemoryDomainMenu(); //Calls update routines
|
||||||
|
SetUpScrollBar();
|
||||||
MemoryViewer.Refresh();
|
MemoryViewer.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,8 +165,7 @@ namespace BizHawk.MultiClient
|
||||||
else
|
else
|
||||||
memoryDomainsToolStripMenuItem.Enabled = false;
|
memoryDomainsToolStripMenuItem.Enabled = false;
|
||||||
|
|
||||||
//Set up scrollbar
|
SetUpScrollBar();
|
||||||
vScrollBar1.Maximum = Domain.Size / 16;
|
|
||||||
vScrollBar1.Value = 0;
|
vScrollBar1.Value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,5 +173,28 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetUpScrollBar()
|
||||||
|
{
|
||||||
|
int rowsVisible = MemoryViewer.Height / 16;
|
||||||
|
int totalRows = Domain.Size / 16;
|
||||||
|
int max = (totalRows - rowsVisible) + 17;
|
||||||
|
|
||||||
|
if (max > 0)
|
||||||
|
{
|
||||||
|
vScrollBar1.Visible = true;
|
||||||
|
if (vScrollBar1.Value > max)
|
||||||
|
vScrollBar1.Value = max;
|
||||||
|
vScrollBar1.Maximum = max;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
vScrollBar1.Visible = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HexEditor_Resize(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SetUpScrollBar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue