From 71fd3df676fbf0f56f1b113b2a32f26234c834bf Mon Sep 17 00:00:00 2001 From: spherallic Date: Mon, 24 Apr 2023 23:46:18 +0200 Subject: [PATCH] Resource options form: fixed a problem where the text box containing the path to the file could be focused. (backport from UDB) --- .../Windows/ResourceOptionsForm.Designer.cs | 30 +++++++++++-------- Source/Core/Windows/ResourceOptionsForm.cs | 17 +++++++++++ 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/Source/Core/Windows/ResourceOptionsForm.Designer.cs b/Source/Core/Windows/ResourceOptionsForm.Designer.cs index 8b7da7a..363430a 100644 --- a/Source/Core/Windows/ResourceOptionsForm.Designer.cs +++ b/Source/Core/Windows/ResourceOptionsForm.Designer.cs @@ -159,10 +159,12 @@ namespace CodeImp.DoomBuilder.Windows this.wadlocation.ReadOnly = true; this.wadlocation.Size = new System.Drawing.Size(292, 20); this.wadlocation.TabIndex = 0; - // - // directorytab - // - this.directorytab.Controls.Add(this.directorylink); + this.wadlocation.TabStop = false; + this.wadlocation.Enter += new System.EventHandler(this.wadlocation_Enter); + // + // directorytab + // + this.directorytab.Controls.Add(this.directorylink); this.directorytab.Controls.Add(this.dir_flats); this.directorytab.Controls.Add(this.dir_textures); this.directorytab.Controls.Add(this.browsedir); @@ -230,10 +232,12 @@ namespace CodeImp.DoomBuilder.Windows this.dirlocation.ReadOnly = true; this.dirlocation.Size = new System.Drawing.Size(292, 20); this.dirlocation.TabIndex = 0; - // - // pk3filetab - // - this.pk3filetab.Controls.Add(this.pk3link); + this.dirlocation.TabStop = false; + this.dirlocation.Enter += new System.EventHandler(this.dirlocation_Enter); + // + // pk3filetab + // + this.pk3filetab.Controls.Add(this.pk3link); this.pk3filetab.Controls.Add(this.browsepk3); this.pk3filetab.Controls.Add(this.pk3location); this.pk3filetab.Controls.Add(label3); @@ -276,10 +280,12 @@ namespace CodeImp.DoomBuilder.Windows this.pk3location.ReadOnly = true; this.pk3location.Size = new System.Drawing.Size(292, 20); this.pk3location.TabIndex = 0; - // - // cancel - // - this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.pk3location.TabStop = false; + this.pk3location.Enter += new System.EventHandler(this.pk3location_Enter); + // + // cancel + // + this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.cancel.Location = new System.Drawing.Point(262, 260); this.cancel.Name = "cancel"; diff --git a/Source/Core/Windows/ResourceOptionsForm.cs b/Source/Core/Windows/ResourceOptionsForm.cs index b064a95..41a34ca 100644 --- a/Source/Core/Windows/ResourceOptionsForm.cs +++ b/Source/Core/Windows/ResourceOptionsForm.cs @@ -230,5 +230,22 @@ namespace CodeImp.DoomBuilder.Windows General.ShowHelp("w_resourceoptions.html"); hlpevent.Handled = true; } + private void wadlocation_Enter(object sender, EventArgs e) + { + // Stop textbox control from getting focus + browsewad.Focus(); + } + + private void dirlocation_Enter(object sender, EventArgs e) + { + // Stop textbox control from getting focus + browsedir.Focus(); + } + + private void pk3location_Enter(object sender, EventArgs e) + { + // Stop textbox control from getting focus + browsepk3.Focus(); + } } } \ No newline at end of file