From 86b1e2ed6dcfd423cefe89d1f22b8fbde79e8e2d Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 21 Aug 2014 21:09:21 +0000 Subject: [PATCH] InputRoll - scrollbar stuff --- .../tools/TAStudio/InputRoll.cs | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs index b1407f634d..0a0168db00 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs @@ -29,14 +29,18 @@ namespace BizHawk.Client.EmuHawk { Location = new Point(Width - 16, 0), Visible = false, - Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom + Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom, + SmallChange = 1, + LargeChange = 5 }; HBar = new HScrollBar { Location = new Point(0, Height - 16), Visible = false, - Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right + Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right, + SmallChange = 1, + LargeChange = 5 }; CellPadding = 3; @@ -723,15 +727,26 @@ namespace BizHawk.Client.EmuHawk { if (NeedsVScrollbar) { - VBar.Visible = true; + + int max; + if (HorizontalOrientation) { - VBar.Maximum = ((Columns.Count * CellHeight) - Height) / CellHeight; + max = (((Columns.Count * CellHeight) - Height) / CellHeight) + 1; } else { - VBar.Maximum = ((ItemCount * CellHeight) - Height) / CellHeight; + max = (((ItemCount * CellHeight) - Height) / CellHeight) + 1; } + + if (VBar.Value > max) + { + VBar.Value = max; + } + + VBar.Maximum = max + VBar.LargeChange; // TODO: why can't it be 1? + VBar.Size = new Size(VBar.Width, Height); + VBar.Visible = true; } else {