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.Items.AddRange(words);
|
||||||
listBox.Dock = DockStyle.Fill;
|
listBox.Dock = DockStyle.Fill;
|
||||||
listBox.ContextMenuStrip = this.wordContextMenuStrip;
|
listBox.ContextMenuStrip = this.wordContextMenuStrip;
|
||||||
|
// Double-clicking a word is equivalent to right click -> Look Up
|
||||||
|
listBox.DoubleClick += lookUpToolStripMenuItem_Click;
|
||||||
page.Controls.Add(listBox);
|
page.Controls.Add(listBox);
|
||||||
this.tabControl.TabPages.Add(page);
|
this.tabControl.TabPages.Add(page);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +47,7 @@ namespace ToeCracker {
|
||||||
private void Search(string query) {
|
private void Search(string query) {
|
||||||
this.Enabled = false;
|
this.Enabled = false;
|
||||||
|
|
||||||
Dictionary<string, string[]> results = new Dictionary<string,string[]>();
|
Dictionary<string, string[]> results = new Dictionary<string, string[]>();
|
||||||
try {
|
try {
|
||||||
results = Thesaurus.Search(query);
|
results = Thesaurus.Search(query);
|
||||||
} catch (WebException e) {
|
} catch (WebException e) {
|
||||||
|
@ -107,7 +109,8 @@ namespace ToeCracker {
|
||||||
|
|
||||||
private void searchButton_Click(object sender, EventArgs e) {
|
private void searchButton_Click(object sender, EventArgs e) {
|
||||||
string query = this.searchTextBox.Text.Trim();
|
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) {
|
private void wordContextMenuStrip_Opening(object sender, CancelEventArgs e) {
|
||||||
|
|
Loading…
Reference in New Issue