GSDumpGUI: Now textbox path change requires enter key.

This commit is contained in:
KrossX 2019-08-02 00:36:15 -03:00 committed by lightningterror
parent 7b6c2be067
commit c8a285dee6
2 changed files with 21 additions and 3 deletions

View File

@ -97,6 +97,7 @@
this.txtGSDXDirectory.TabStop = false; this.txtGSDXDirectory.TabStop = false;
this.txtGSDXDirectory.Enter += new System.EventHandler(this.txtGSDXDirectory_Enter); this.txtGSDXDirectory.Enter += new System.EventHandler(this.txtGSDXDirectory_Enter);
this.txtGSDXDirectory.Leave += new System.EventHandler(this.txtGSDXDirectory_Leave); this.txtGSDXDirectory.Leave += new System.EventHandler(this.txtGSDXDirectory_Leave);
this.txtGSDXDirectory.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtGSDXDirectory_KeyDown);
// //
// lblDirectory // lblDirectory
// //
@ -147,6 +148,7 @@
this.txtDumpsDirectory.TabStop = false; this.txtDumpsDirectory.TabStop = false;
this.txtDumpsDirectory.Enter += new System.EventHandler(this.txtDumpsDirectory_Enter); this.txtDumpsDirectory.Enter += new System.EventHandler(this.txtDumpsDirectory_Enter);
this.txtDumpsDirectory.Leave += new System.EventHandler(this.txtDumpsDirectory_Leave); this.txtDumpsDirectory.Leave += new System.EventHandler(this.txtDumpsDirectory_Leave);
this.txtDumpsDirectory.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDumpsDirectory_KeyDown);
// //
// lstGSDX // lstGSDX
// //

View File

@ -494,7 +494,7 @@ namespace GSDumpGUI
private void GSDumpGUI_KeyDown(object sender, KeyEventArgs e) private void GSDumpGUI_KeyDown(object sender, KeyEventArgs e)
{ {
if (e.KeyCode == Keys.Return) if (e.KeyCode == Keys.Return && !txtGSDXDirectory.Focused && !txtDumpsDirectory.Focused)
cmdRun_Click(sender, e); cmdRun_Click(sender, e);
if (e.KeyCode == Keys.F1) if (e.KeyCode == Keys.F1)
@ -524,7 +524,22 @@ namespace GSDumpGUI
private void txtGSDXDirectory_Leave(object sender, EventArgs e) private void txtGSDXDirectory_Leave(object sender, EventArgs e)
{ {
string newpath = txtGSDXDirectory.Text; string newpath = txtGSDXDirectory.Text;
if (!_gsdxPathOld.ToLower().Equals(newpath.ToLower()))
txtGSDXDirectory.Text = _gsdxPathOld;
}
private void txtDumpsDirectory_Leave(object sender, EventArgs e)
{
string newpath = txtDumpsDirectory.Text;
if(!_dumpPathOld.ToLower().Equals(newpath.ToLower()))
txtDumpsDirectory.Text = _dumpPathOld;
}
private void txtGSDXDirectory_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode != Keys.Return) return;
string newpath = txtGSDXDirectory.Text;
if (!String.IsNullOrEmpty(newpath) && if (!String.IsNullOrEmpty(newpath) &&
!_gsdxPathOld.ToLower().Equals(newpath.ToLower()) && !_gsdxPathOld.ToLower().Equals(newpath.ToLower()) &&
Directory.Exists(newpath)) Directory.Exists(newpath))
@ -536,10 +551,11 @@ namespace GSDumpGUI
} }
} }
private void txtDumpsDirectory_Leave(object sender, EventArgs e) private void txtDumpsDirectory_KeyDown(object sender, KeyEventArgs e)
{ {
string newpath = txtDumpsDirectory.Text; if (e.KeyCode != Keys.Return) return;
string newpath = txtDumpsDirectory.Text;
if (!String.IsNullOrEmpty(newpath) && if (!String.IsNullOrEmpty(newpath) &&
!_dumpPathOld.ToLower().Equals(newpath.ToLower()) && !_dumpPathOld.ToLower().Equals(newpath.ToLower()) &&
Directory.Exists(newpath)) Directory.Exists(newpath))