Add dragdrop tab switching qol improvement

#1457
This commit is contained in:
Kurt 2017-09-15 09:13:08 -07:00
parent 5665481cab
commit fa14c794c0
2 changed files with 37 additions and 24 deletions

View file

@ -160,15 +160,16 @@
this.tabBoxMulti.Size = new System.Drawing.Size(310, 225);
this.tabBoxMulti.TabIndex = 101;
this.tabBoxMulti.Click += new System.EventHandler(this.ClickBoxSort);
this.tabBoxMulti.DragOver += new System.Windows.Forms.DragEventHandler(this.MultiDragOver);
this.tabBoxMulti.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.ClickBoxDouble);
//
// Tab_Box
//
this.Tab_Box.Controls.Add(this.Box);
this.Tab_Box.Location = new System.Drawing.Point(4, 25);
this.Tab_Box.Location = new System.Drawing.Point(4, 22);
this.Tab_Box.Name = "Tab_Box";
this.Tab_Box.Padding = new System.Windows.Forms.Padding(3);
this.Tab_Box.Size = new System.Drawing.Size(302, 196);
this.Tab_Box.Size = new System.Drawing.Size(302, 199);
this.Tab_Box.TabIndex = 0;
this.Tab_Box.Text = "Box";
this.Tab_Box.UseVisualStyleBackColor = true;
@ -191,10 +192,10 @@
this.Tab_PartyBattle.Controls.Add(this.L_BattleBox);
this.Tab_PartyBattle.Controls.Add(this.L_Party);
this.Tab_PartyBattle.Controls.Add(this.PAN_Party);
this.Tab_PartyBattle.Location = new System.Drawing.Point(4, 25);
this.Tab_PartyBattle.Location = new System.Drawing.Point(4, 22);
this.Tab_PartyBattle.Name = "Tab_PartyBattle";
this.Tab_PartyBattle.Padding = new System.Windows.Forms.Padding(3);
this.Tab_PartyBattle.Size = new System.Drawing.Size(302, 196);
this.Tab_PartyBattle.Size = new System.Drawing.Size(302, 199);
this.Tab_PartyBattle.TabIndex = 1;
this.Tab_PartyBattle.Text = "Party-Battle Box";
this.Tab_PartyBattle.UseVisualStyleBackColor = true;
@ -294,7 +295,7 @@
this.L_BattleBox.AutoSize = true;
this.L_BattleBox.Location = new System.Drawing.Point(179, 13);
this.L_BattleBox.Name = "L_BattleBox";
this.L_BattleBox.Size = new System.Drawing.Size(75, 17);
this.L_BattleBox.Size = new System.Drawing.Size(58, 13);
this.L_BattleBox.TabIndex = 1;
this.L_BattleBox.Text = "Battle Box:";
this.L_BattleBox.Click += new System.EventHandler(this.ClickShowdownExportBattleBox);
@ -304,7 +305,7 @@
this.L_Party.AutoSize = true;
this.L_Party.Location = new System.Drawing.Point(29, 13);
this.L_Party.Name = "L_Party";
this.L_Party.Size = new System.Drawing.Size(45, 17);
this.L_Party.Size = new System.Drawing.Size(34, 13);
this.L_Party.TabIndex = 0;
this.L_Party.Text = "Party:";
this.L_Party.Click += new System.EventHandler(this.ClickShowdownExportParty);
@ -385,9 +386,9 @@
this.Tab_Other.Controls.Add(this.GB_Fused);
this.Tab_Other.Controls.Add(this.L_ReadOnlyOther);
this.Tab_Other.Controls.Add(this.GB_SUBE);
this.Tab_Other.Location = new System.Drawing.Point(4, 25);
this.Tab_Other.Location = new System.Drawing.Point(4, 22);
this.Tab_Other.Name = "Tab_Other";
this.Tab_Other.Size = new System.Drawing.Size(302, 196);
this.Tab_Other.Size = new System.Drawing.Size(302, 199);
this.Tab_Other.TabIndex = 2;
this.Tab_Other.Text = "Other";
this.Tab_Other.UseVisualStyleBackColor = true;
@ -417,7 +418,7 @@
this.L_XP2.AutoSize = true;
this.L_XP2.Location = new System.Drawing.Point(74, 88);
this.L_XP2.Name = "L_XP2";
this.L_XP2.Size = new System.Drawing.Size(38, 17);
this.L_XP2.Size = new System.Drawing.Size(30, 13);
this.L_XP2.TabIndex = 17;
this.L_XP2.Text = "+XP:";
//
@ -426,7 +427,7 @@
this.L_XP1.AutoSize = true;
this.L_XP1.Location = new System.Drawing.Point(74, 35);
this.L_XP1.Name = "L_XP1";
this.L_XP1.Size = new System.Drawing.Size(38, 17);
this.L_XP1.Size = new System.Drawing.Size(30, 13);
this.L_XP1.TabIndex = 16;
this.L_XP1.Text = "+XP:";
//
@ -435,7 +436,7 @@
this.TB_Daycare2XP.Location = new System.Drawing.Point(108, 85);
this.TB_Daycare2XP.Name = "TB_Daycare2XP";
this.TB_Daycare2XP.ReadOnly = true;
this.TB_Daycare2XP.Size = new System.Drawing.Size(73, 22);
this.TB_Daycare2XP.Size = new System.Drawing.Size(73, 20);
this.TB_Daycare2XP.TabIndex = 15;
//
// TB_Daycare1XP
@ -443,7 +444,7 @@
this.TB_Daycare1XP.Location = new System.Drawing.Point(108, 32);
this.TB_Daycare1XP.Name = "TB_Daycare1XP";
this.TB_Daycare1XP.ReadOnly = true;
this.TB_Daycare1XP.Size = new System.Drawing.Size(73, 22);
this.TB_Daycare1XP.Size = new System.Drawing.Size(73, 20);
this.TB_Daycare1XP.TabIndex = 14;
//
// L_DC2
@ -451,7 +452,7 @@
this.L_DC2.AutoSize = true;
this.L_DC2.Location = new System.Drawing.Point(74, 71);
this.L_DC2.Name = "L_DC2";
this.L_DC2.Size = new System.Drawing.Size(24, 17);
this.L_DC2.Size = new System.Drawing.Size(19, 13);
this.L_DC2.TabIndex = 13;
this.L_DC2.Text = "2: ";
//
@ -460,7 +461,7 @@
this.L_DC1.AutoSize = true;
this.L_DC1.Location = new System.Drawing.Point(74, 18);
this.L_DC1.Name = "L_DC1";
this.L_DC1.Size = new System.Drawing.Size(24, 17);
this.L_DC1.Size = new System.Drawing.Size(19, 13);
this.L_DC1.TabIndex = 12;
this.L_DC1.Text = "1: ";
//
@ -469,7 +470,7 @@
this.L_DaycareSeed.AutoSize = true;
this.L_DaycareSeed.Location = new System.Drawing.Point(23, 143);
this.L_DaycareSeed.Name = "L_DaycareSeed";
this.L_DaycareSeed.Size = new System.Drawing.Size(45, 17);
this.L_DaycareSeed.Size = new System.Drawing.Size(35, 13);
this.L_DaycareSeed.TabIndex = 9;
this.L_DaycareSeed.Text = "Seed:";
//
@ -479,7 +480,7 @@
this.TB_RNGSeed.Location = new System.Drawing.Point(61, 140);
this.TB_RNGSeed.MaxLength = 16;
this.TB_RNGSeed.Name = "TB_RNGSeed";
this.TB_RNGSeed.Size = new System.Drawing.Size(120, 23);
this.TB_RNGSeed.Size = new System.Drawing.Size(120, 20);
this.TB_RNGSeed.TabIndex = 8;
this.TB_RNGSeed.Text = "0123456789ABCDEF";
this.TB_RNGSeed.Validated += new System.EventHandler(this.UpdateStringSeed);
@ -510,7 +511,7 @@
this.DayCare_HasEgg.Enabled = false;
this.DayCare_HasEgg.Location = new System.Drawing.Point(61, 123);
this.DayCare_HasEgg.Name = "DayCare_HasEgg";
this.DayCare_HasEgg.Size = new System.Drawing.Size(116, 21);
this.DayCare_HasEgg.Size = new System.Drawing.Size(91, 17);
this.DayCare_HasEgg.TabIndex = 7;
this.DayCare_HasEgg.Text = "Egg Available";
this.DayCare_HasEgg.UseVisualStyleBackColor = true;
@ -620,9 +621,9 @@
this.Tab_SAV.Controls.Add(this.TB_GameSync);
this.Tab_SAV.Controls.Add(this.B_SaveBoxBin);
this.Tab_SAV.Controls.Add(this.B_VerifyCHK);
this.Tab_SAV.Location = new System.Drawing.Point(4, 25);
this.Tab_SAV.Location = new System.Drawing.Point(4, 22);
this.Tab_SAV.Name = "Tab_SAV";
this.Tab_SAV.Size = new System.Drawing.Size(302, 196);
this.Tab_SAV.Size = new System.Drawing.Size(302, 199);
this.Tab_SAV.TabIndex = 3;
this.Tab_SAV.Text = "SAV";
this.Tab_SAV.UseVisualStyleBackColor = true;
@ -633,7 +634,7 @@
this.CB_SaveSlot.FormattingEnabled = true;
this.CB_SaveSlot.Location = new System.Drawing.Point(150, 148);
this.CB_SaveSlot.Name = "CB_SaveSlot";
this.CB_SaveSlot.Size = new System.Drawing.Size(121, 24);
this.CB_SaveSlot.Size = new System.Drawing.Size(121, 21);
this.CB_SaveSlot.TabIndex = 20;
this.CB_SaveSlot.Validated += new System.EventHandler(this.UpdateSaveSlot);
//
@ -642,7 +643,7 @@
this.L_SaveSlot.AutoSize = true;
this.L_SaveSlot.Location = new System.Drawing.Point(92, 151);
this.L_SaveSlot.Name = "L_SaveSlot";
this.L_SaveSlot.Size = new System.Drawing.Size(72, 17);
this.L_SaveSlot.Size = new System.Drawing.Size(56, 13);
this.L_SaveSlot.TabIndex = 19;
this.L_SaveSlot.Text = "Save Slot:";
//
@ -662,7 +663,7 @@
this.TB_Secure2.Location = new System.Drawing.Point(151, 113);
this.TB_Secure2.MaxLength = 16;
this.TB_Secure2.Name = "TB_Secure2";
this.TB_Secure2.Size = new System.Drawing.Size(120, 23);
this.TB_Secure2.Size = new System.Drawing.Size(120, 20);
this.TB_Secure2.TabIndex = 17;
this.TB_Secure2.Text = "0000000000000000";
this.TB_Secure2.Validated += new System.EventHandler(this.UpdateStringSeed);
@ -683,7 +684,7 @@
this.TB_Secure1.Location = new System.Drawing.Point(151, 91);
this.TB_Secure1.MaxLength = 16;
this.TB_Secure1.Name = "TB_Secure1";
this.TB_Secure1.Size = new System.Drawing.Size(120, 23);
this.TB_Secure1.Size = new System.Drawing.Size(120, 20);
this.TB_Secure1.TabIndex = 15;
this.TB_Secure1.Text = "0000000000000000";
this.TB_Secure1.Validated += new System.EventHandler(this.UpdateStringSeed);
@ -714,7 +715,7 @@
this.TB_GameSync.Location = new System.Drawing.Point(151, 69);
this.TB_GameSync.MaxLength = 16;
this.TB_GameSync.Name = "TB_GameSync";
this.TB_GameSync.Size = new System.Drawing.Size(120, 23);
this.TB_GameSync.Size = new System.Drawing.Size(120, 20);
this.TB_GameSync.TabIndex = 10;
this.TB_GameSync.Text = "0000000000000000";
this.TB_GameSync.Validated += new System.EventHandler(this.UpdateStringSeed);

View file

@ -1091,6 +1091,18 @@ namespace PKHeX.WinForms.Controls
M.DragInfo.Destination.Box = M.DragInfo.Destination.IsParty ? -1 : Box.CurrentBox;
M.HandleDropPKM(sender, e, overwrite, clone);
}
private void MultiDragOver(object sender, DragEventArgs e)
{
// iterate over all tabs to see if a tab switch should occur when drag/dropping
Point pt = tabBoxMulti.PointToClient(new Point(e.X, e.Y));
for (int i = 0; i < tabBoxMulti.TabCount; i++)
{
if (tabBoxMulti.SelectedIndex == i || !tabBoxMulti.GetTabRect(i).Contains(pt))
continue;
tabBoxMulti.SelectedIndex = i;
return;
}
}
private void ClickShowdownExportParty(object sender, EventArgs e)
{
try