Make double-clicks cause a lookup
This commit is contained in:
parent
3ee3b87ea8
commit
8fefcb9ab9
|
@ -34,6 +34,8 @@ namespace ToeCracker {
|
|||
listBox.Items.AddRange(words);
|
||||
listBox.Dock = DockStyle.Fill;
|
||||
listBox.ContextMenuStrip = this.wordContextMenuStrip;
|
||||
// Double-clicking a word is equivalent to right click -> Look Up
|
||||
listBox.DoubleClick += lookUpToolStripMenuItem_Click;
|
||||
page.Controls.Add(listBox);
|
||||
this.tabControl.TabPages.Add(page);
|
||||
}
|
||||
|
@ -45,7 +47,7 @@ namespace ToeCracker {
|
|||
private void Search(string query) {
|
||||
this.Enabled = false;
|
||||
|
||||
Dictionary<string, string[]> results = new Dictionary<string,string[]>();
|
||||
Dictionary<string, string[]> results = new Dictionary<string, string[]>();
|
||||
try {
|
||||
results = Thesaurus.Search(query);
|
||||
} catch (WebException e) {
|
||||
|
@ -96,7 +98,7 @@ namespace ToeCracker {
|
|||
word = word.Trim();
|
||||
if (word == String.Empty || word.StartsWith("-- "))
|
||||
return null;
|
||||
|
||||
|
||||
return word;
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +109,8 @@ namespace ToeCracker {
|
|||
|
||||
private void searchButton_Click(object sender, EventArgs e) {
|
||||
string query = this.searchTextBox.Text.Trim();
|
||||
if (query.Length > 0) this.Search(query);
|
||||
if (query.Length > 0)
|
||||
this.Search(query);
|
||||
}
|
||||
|
||||
private void wordContextMenuStrip_Opening(object sender, CancelEventArgs e) {
|
||||
|
|
Loading…
Reference in New Issue