From d41c8f97312916c5d75f0d90abfa639f358e3ebf Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Sun, 28 Aug 2016 20:13:52 -0700 Subject: [PATCH] Allow multiple boxview popups Moved to new doubleClick method, can pop up more than one by holding Shift --- PKHeX/MainWindow/Main.Designer.cs | 45 ++++++++++++++++--------------- PKHeX/MainWindow/Main.cs | 12 ++++++--- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/PKHeX/MainWindow/Main.Designer.cs b/PKHeX/MainWindow/Main.Designer.cs index 51e1d7dc1..ed26d445d 100644 --- a/PKHeX/MainWindow/Main.Designer.cs +++ b/PKHeX/MainWindow/Main.Designer.cs @@ -348,10 +348,10 @@ this.B_OpenOPowers = new System.Windows.Forms.Button(); this.B_OpenEventFlags = new System.Windows.Forms.Button(); this.B_OpenPokedex = new System.Windows.Forms.Button(); - this.B_OpenBerryField = new System.Windows.Forms.Button(); - this.B_OpenSecretBase = new System.Windows.Forms.Button(); - this.B_Pokeblocks = new System.Windows.Forms.Button(); this.B_LinkInfo = new System.Windows.Forms.Button(); + this.B_OpenBerryField = new System.Windows.Forms.Button(); + this.B_Pokeblocks = new System.Windows.Forms.Button(); + this.B_OpenSecretBase = new System.Windows.Forms.Button(); this.B_OpenPokepuffs = new System.Windows.Forms.Button(); this.B_OpenSuperTraining = new System.Windows.Forms.Button(); this.B_OpenHallofFame = new System.Windows.Forms.Button(); @@ -3007,6 +3007,7 @@ this.tabBoxMulti.Size = new System.Drawing.Size(310, 225); this.tabBoxMulti.TabIndex = 50; this.tabBoxMulti.Click += new System.EventHandler(this.clickBoxSort); + this.tabBoxMulti.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.clickBoxDouble); // // Tab_Box // @@ -4454,6 +4455,16 @@ this.B_OpenPokedex.UseVisualStyleBackColor = true; this.B_OpenPokedex.Click += new System.EventHandler(this.B_OpenPokedex_Click); // + // B_LinkInfo + // + this.B_LinkInfo.Location = new System.Drawing.Point(96, 61); + this.B_LinkInfo.Name = "B_LinkInfo"; + this.B_LinkInfo.Size = new System.Drawing.Size(87, 23); + this.B_LinkInfo.TabIndex = 23; + this.B_LinkInfo.Text = "Link Data"; + this.B_LinkInfo.UseVisualStyleBackColor = true; + this.B_LinkInfo.Click += new System.EventHandler(this.B_LinkInfo_Click); + // // B_OpenBerryField // this.B_OpenBerryField.Location = new System.Drawing.Point(189, 61); @@ -4464,17 +4475,6 @@ this.B_OpenBerryField.UseVisualStyleBackColor = true; this.B_OpenBerryField.Click += new System.EventHandler(this.B_OpenBerryField_Click); // - // B_OpenSecretBase - // - this.B_OpenSecretBase.Location = new System.Drawing.Point(96, 90); - this.B_OpenSecretBase.Name = "B_OpenSecretBase"; - this.B_OpenSecretBase.Size = new System.Drawing.Size(87, 23); - this.B_OpenSecretBase.TabIndex = 21; - this.B_OpenSecretBase.Text = "Secret Base"; - this.B_OpenSecretBase.UseVisualStyleBackColor = true; - this.B_OpenSecretBase.Visible = false; - this.B_OpenSecretBase.Click += new System.EventHandler(this.B_OpenSecretBase_Click); - // // B_Pokeblocks // this.B_Pokeblocks.Location = new System.Drawing.Point(3, 90); @@ -4486,15 +4486,16 @@ this.B_Pokeblocks.Visible = false; this.B_Pokeblocks.Click += new System.EventHandler(this.B_OpenPokeblocks_Click); // - // B_LinkInfo + // B_OpenSecretBase // - this.B_LinkInfo.Location = new System.Drawing.Point(96, 61); - this.B_LinkInfo.Name = "B_LinkInfo"; - this.B_LinkInfo.Size = new System.Drawing.Size(87, 23); - this.B_LinkInfo.TabIndex = 23; - this.B_LinkInfo.Text = "Link Data"; - this.B_LinkInfo.UseVisualStyleBackColor = true; - this.B_LinkInfo.Click += new System.EventHandler(this.B_LinkInfo_Click); + this.B_OpenSecretBase.Location = new System.Drawing.Point(96, 90); + this.B_OpenSecretBase.Name = "B_OpenSecretBase"; + this.B_OpenSecretBase.Size = new System.Drawing.Size(87, 23); + this.B_OpenSecretBase.TabIndex = 21; + this.B_OpenSecretBase.Text = "Secret Base"; + this.B_OpenSecretBase.UseVisualStyleBackColor = true; + this.B_OpenSecretBase.Visible = false; + this.B_OpenSecretBase.Click += new System.EventHandler(this.B_OpenSecretBase_Click); // // B_OpenPokepuffs // diff --git a/PKHeX/MainWindow/Main.cs b/PKHeX/MainWindow/Main.cs index f03025b10..82cd76d35 100644 --- a/PKHeX/MainWindow/Main.cs +++ b/PKHeX/MainWindow/Main.cs @@ -2662,14 +2662,20 @@ namespace PKHeX setPKXBoxes(); Util.Alert("Current Box sorted!"); } - else if (ModifierKeys == Keys.Shift) + } + private void clickBoxDouble(object sender, MouseEventArgs e) + { + if (tabBoxMulti.SelectedIndex != 0) + return; + if (!SAV.HasBox) + return; + if (ModifierKeys != Keys.Shift) { var z = Application.OpenForms.Cast
().FirstOrDefault(form => form.GetType() == typeof(SAV_BoxViewer)) as SAV_BoxViewer; if (z != null) { Util.CenterToForm(z, this); z.BringToFront(); return; } - - new SAV_BoxViewer(this).Show(); } + new SAV_BoxViewer(this).Show(); } public int swapBoxesViewer(int viewBox) {