private void ALPHA_Pressed(SystemHotkey p) { //Show(); if (p.Char != 0) { m_SelectForm.Input_TextBox.Text += p.Char; } if (Regex.IsMatch(m_SelectForm.Input_TextBox.Text, @"(^|[^/])[+\-]$")) { NONALPHA_Pressed(p); return; } selections_strings.Clear(); selections_words = word.Selections(m_SelectForm.Input_TextBox.Text); foreach (word w in selections_words) { selections_strings.Add(Converter.getKaputa(w.ToString().Replace("|", ""))); } //if (selections_words.Count == 0) //selections_strings.Add(Converter.getKaputa(m_SelectForm.Input_TextBox.Text.ToString().Replace("|", ""))); Reread(); m_SelectForm.SelectListBox.SelectedIndex = 0; SystemHotkey.RegisterHotKey(true, t_key_type.ALPHA | t_key_type.NONALPHA); m_SelectForm.Show(); User32.SetForegroundWindow(LastActiveWindow); }
private void ALPHA_Thread(/*SystemHotkey p*/) { selections_words = trie.TRIE.findAll(/*previous_seleted_word,*/ m_SelectForm.Input_TextBox.Text, false); selections_strings.Clear(); int i = 0; foreach (trie.word w in selections_words) { selections_strings.Add( (++i == selections_words.Count && -1 == w.ToString().IndexOf('|') ? "0" : i < 10 ? i.ToString() : " ") + " " + Converter.getters[menu_method](w.ToString().Replace("|", "")) //+ " "+w.m_index+ " " //+ " (" + w.OriginalProbability.ToString("F2") + ")" //+ " (" +(w.Probability-w.OriginalProbability).ToString("F2") + ")"//+w.m_index.ToString() ); } Reread(); if (menu_method == Method.kaputadotcom) { m_SelectForm.SelectListBox.Font = new Font("kaputadotcom", 22); } else { m_SelectForm.SelectListBox.Font = new Font("Potha", 22); } m_SelectForm.SelectListBox.SelectedIndex = 0; m_SelectForm.Show(); User32.SetForegroundWindow(LastActiveWindow); }