diff --git a/src/Forms/Settings.Designer.cs b/src/Forms/Settings.Designer.cs index 974fe00b8..f66c82ddc 100644 --- a/src/Forms/Settings.Designer.cs +++ b/src/Forms/Settings.Designer.cs @@ -3213,6 +3213,7 @@ this.listBoxOcrFixList.Size = new System.Drawing.Size(179, 225); this.listBoxOcrFixList.TabIndex = 40; this.listBoxOcrFixList.SelectedIndexChanged += new System.EventHandler(this.ListBoxOcrFixListSelectedIndexChanged); + this.listBoxOcrFixList.DoubleClick += new System.EventHandler(this.listBoxOcrFixList_DoubleClick); this.listBoxOcrFixList.Enter += new System.EventHandler(this.ListBoxSearchReset); this.listBoxOcrFixList.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ListBoxKeyDownSearch); // @@ -3265,6 +3266,7 @@ this.listBoxUserWordLists.Size = new System.Drawing.Size(150, 225); this.listBoxUserWordLists.TabIndex = 30; this.listBoxUserWordLists.SelectedIndexChanged += new System.EventHandler(this.ListBoxUserWordListsSelectedIndexChanged); + this.listBoxUserWordLists.DoubleClick += new System.EventHandler(this.listBoxUserWordLists_DoubleClick); this.listBoxUserWordLists.Enter += new System.EventHandler(this.ListBoxSearchReset); this.listBoxUserWordLists.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ListBoxKeyDownSearch); // @@ -3348,6 +3350,7 @@ this.listBoxNames.Size = new System.Drawing.Size(150, 225); this.listBoxNames.TabIndex = 20; this.listBoxNames.SelectedIndexChanged += new System.EventHandler(this.ListBoxNamesSelectedIndexChanged); + this.listBoxNames.DoubleClick += new System.EventHandler(this.listBoxNames_DoubleClick); this.listBoxNames.Enter += new System.EventHandler(this.ListBoxSearchReset); this.listBoxNames.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ListBoxKeyDownSearch); // diff --git a/src/Forms/Settings.cs b/src/Forms/Settings.cs index a103ba2e6..77e119c38 100644 --- a/src/Forms/Settings.cs +++ b/src/Forms/Settings.cs @@ -3192,5 +3192,38 @@ namespace Nikse.SubtitleEdit.Forms { treeViewShortcuts.CollapseAll(); } + + private void listBoxNames_DoubleClick(object sender, EventArgs e) + { + var idx = listBoxNames.SelectedIndex; + if (idx >= 0) + { + textBoxNameEtc.Text = (string)listBoxNames.Items[idx]; + } + } + + private void listBoxUserWordLists_DoubleClick(object sender, EventArgs e) + { + var idx = listBoxUserWordLists.SelectedIndex; + if (idx >= 0) + { + textBoxUserWord.Text = (string)listBoxUserWordLists.Items[idx]; + } + } + + private void listBoxOcrFixList_DoubleClick(object sender, EventArgs e) + { + var idx = listBoxOcrFixList.SelectedIndex; + if (idx >= 0) + { + var text = (string)listBoxOcrFixList.Items[idx]; + var splitIdx = text.IndexOf(" --> ", StringComparison.Ordinal); + if (splitIdx > 0) + { + textBoxOcrFixKey.Text = text.Substring(0, splitIdx); + textBoxOcrFixValue.Text = text.Remove(0, splitIdx + " --> ".Length); + } + } + } } }