mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 00:37:11 +00:00
Bring popup to front instead of alert
Any call to open a form that is already open (special characters, box report, database) would alert that it's already open. Just bring it to the front. Since it may be hidden, just move it back into view (align to main program's top-left location)
This commit is contained in:
parent
e66342fe6c
commit
1c531b0673
2 changed files with 12 additions and 8 deletions
|
@ -302,8 +302,9 @@ namespace PKHeX
|
|||
}
|
||||
private void mainMenuBoxReport(object sender, EventArgs e)
|
||||
{
|
||||
if (Application.OpenForms.Cast<Form>().Any(form => form.Name == typeof(frmReport).Name))
|
||||
{ Util.Alert("Window is already open."); return; }
|
||||
var z = Application.OpenForms.Cast<Form>().FirstOrDefault(form => form.Name == typeof(frmReport).Name) as frmReport;
|
||||
if (z != null)
|
||||
{ z.Location = Location; z.BringToFront(); return; }
|
||||
|
||||
frmReport ReportForm = new frmReport();
|
||||
ReportForm.Show();
|
||||
|
@ -311,8 +312,9 @@ namespace PKHeX
|
|||
}
|
||||
private void mainMenuDatabase(object sender, EventArgs e)
|
||||
{
|
||||
if (Application.OpenForms.Cast<Form>().Any(form => form.Name == typeof(SAV_Database).Name))
|
||||
{ Util.Alert("Window is already open."); return; }
|
||||
var z = Application.OpenForms.Cast<Form>().FirstOrDefault(form => form.Name == typeof(SAV_Database).Name) as SAV_Database;
|
||||
if (z != null)
|
||||
{ z.Location = Location; z.BringToFront(); return; }
|
||||
|
||||
if (Directory.Exists("db"))
|
||||
new SAV_Database(this).Show();
|
||||
|
@ -1986,8 +1988,9 @@ namespace PKHeX
|
|||
if (ModifierKeys != Keys.Control)
|
||||
return;
|
||||
|
||||
if (Application.OpenForms.Cast<Form>().Any(form => form.Name == typeof(f2_Text).Name))
|
||||
{ Util.Alert("Window is already open."); return; }
|
||||
var z = Application.OpenForms.Cast<Form>().FirstOrDefault(form => form.Name == typeof(f2_Text).Name) as f2_Text;
|
||||
if (z != null)
|
||||
{ z.Location = Location; z.BringToFront(); return; }
|
||||
new f2_Text(tb).Show();
|
||||
}
|
||||
private void updateNotOT(object sender, EventArgs e)
|
||||
|
|
|
@ -547,8 +547,9 @@ namespace PKHeX
|
|||
if (ModifierKeys != Keys.Control)
|
||||
return;
|
||||
|
||||
if (Application.OpenForms.Cast<Form>().Any(form => form.Name == typeof(f2_Text).Name))
|
||||
{ Util.Alert("Window is already open."); return; }
|
||||
var z = Application.OpenForms.Cast<Form>().FirstOrDefault(form => form.Name == typeof(f2_Text).Name) as f2_Text;
|
||||
if (z != null)
|
||||
{ z.Location = Location; z.BringToFront(); return; }
|
||||
new f2_Text(tb).Show();
|
||||
}
|
||||
private void showTSV(object sender, EventArgs e)
|
||||
|
|
Loading…
Reference in a new issue