Database view scroll override

Allow scrolling within panel (instead of while mouse is over the
VScrollBar.
Since the updateScroll method isn't called by adjusting the value
directly (ie, not a scroll event) we just update the boxes manually.
This commit is contained in:
Kaphotics 2016-03-18 19:33:09 -07:00
parent 8c4ef40a82
commit 894ff48734

View file

@ -629,5 +629,14 @@ namespace PKHeX
{
Close();
}
protected override void OnMouseWheel(MouseEventArgs e)
{
if (!PAN_Box.RectangleToScreen(PAN_Box.ClientRectangle).Contains(MousePosition))
return;
int oldval = SCR_Box.Value;
int newval = oldval + (e.Delta < 0 ? 1 : -1);
if (newval >= SCR_Box.Minimum && SCR_Box.Maximum >= newval)
FillPKXBoxes(SCR_Box.Value = newval);
}
}
}