Add TableLayoutPanel scroll hack

Thanks @poutros !
This commit is contained in:
Kaphotics 2016-07-30 20:57:45 -07:00
parent 497bfb9397
commit ceff3845b7
5 changed files with 10 additions and 5 deletions

View file

@ -86,7 +86,7 @@ namespace PKHeX
// Box to Tabs D&D
dragout.AllowDrop = true;
FLP_SAVtools.Scroll += Util.FlowLayoutPanelScroll;
FLP_SAVtools.Scroll += Util.PanelScroll;
// Load WC6 folder to legality
refreshWC6DB();

View file

@ -16,6 +16,8 @@ namespace PKHeX
// Updating a Control display with autosized elements on every row addition is cpu intensive. Disable layout updates while populating.
TLP_Ribbons.SuspendLayout();
FLP_Ribbons.Scroll += Util.PanelScroll;
TLP_Ribbons.Scroll += Util.PanelScroll;
populateRibbons();
Util.TranslateInterface(this, Main.curlanguage);
TLP_Ribbons.ResumeLayout();

View file

@ -16,6 +16,8 @@ namespace PKHeX
// Updating a Control display with autosized elements on every row addition is cpu intensive. Disable layout updates while populating.
TLP_SuperTrain.SuspendLayout();
TLP_DistSuperTrain.SuspendLayout();
TLP_SuperTrain.Scroll += Util.PanelScroll;
TLP_DistSuperTrain.Scroll += Util.PanelScroll;
populateRegimens("SuperTrain", TLP_SuperTrain, reglist);
populateRegimens("DistSuperTrain", TLP_DistSuperTrain, distlist);
Util.TranslateInterface(this, Main.curlanguage);

View file

@ -24,9 +24,10 @@ namespace PKHeX
CB_Stats.Items.Add(i.ToString());
TLP_Flags.SuspendLayout();
TLP_Flags.Controls.Clear();
TLP_Const.SuspendLayout();
TLP_Flags.Scroll += Util.PanelScroll;
TLP_Const.Scroll += Util.PanelScroll;
TLP_Flags.Controls.Clear();
TLP_Const.Controls.Clear();
addFlagList(getStringList("flags"));
addConstList(getStringList("const"));

View file

@ -139,9 +139,9 @@ namespace PKHeX
return (int)(cb?.SelectedValue ?? 0);
}
public static void FlowLayoutPanelScroll(object sender, ScrollEventArgs e)
public static void PanelScroll(object sender, ScrollEventArgs e)
{
var p = sender as FlowLayoutPanel;
var p = sender as Panel;
switch (e.ScrollOrientation)
{
case ScrollOrientation.HorizontalScroll: