private void NrichTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Down && suggestionBox.Items.Count > 0) { e.Handled = true; } if (KeyEventsHandler.controlKeyPressed) { KeyEventsHandler.EditorMulitpleKeyPressHandler(e.KeyCode); } KeyEventsHandler.controlKeyPressed = e.Modifiers == Keys.Control; //if (e.KeyCode == Keys.Enter) //{ // int select = NrichTextBox.SelectionStart; // Utility.AppendText(NrichTextBox, Color.Black, "\n"); // NrichTextBox.SelectionStart = NrichTextBox.SelectionStart + 1; // for (int i = 0; i < Helper.tabs; i++) // { // Utility.AppendText(NrichTextBox, Color.Black, " "); // NrichTextBox.SelectionStart = NrichTextBox.SelectionStart + 1; // Utility.AppendText(NrichTextBox, Color.Black, " "); // NrichTextBox.SelectionStart = NrichTextBox.SelectionStart + 1; // Utility.AppendText(NrichTextBox, Color.Black, " "); // NrichTextBox.SelectionStart = NrichTextBox.SelectionStart + 1; // } // //Utility.AppendText(NrichTextBox, Color.Black, "\n"); // //NrichTextBox.SelectionStart = NrichTextBox.SelectionStart - 1; // //NrichTextBox.SelectionStart = select + Helper.tabs.Length; //} }
public static void Init(RichTextBox editor, RichTextBox errorLog, ListBox suggestionBox) { Utility.Init(editor, errorLog, suggestionBox); KeyEventsHandler.Init(editor, errorLog, suggestionBox); TokenGenerator.InitBox(editor); Highlighter.Init(editor); SuggestionProvider.InitSuggestionProvider(new List <string>(), suggestionBox, editor); Coloring.InitColoring(editor); Helper.Init(); MenuItemEvents.Init(editor); }
private void NrichTextBox_KeyUp(object sender, KeyEventArgs e) { suggestionBox.Items.Clear(); SuggestionProvider.GetSuggestion(Utility.GetLastWord()); KeyEventsHandler.EditorKeyHandler(e); if (e.KeyCode == Keys.Enter) { if (BackgroundErrorTracer.IsBusy) { BackgroundErrorTracer.CancelAsync(); } else { BackgroundErrorTracer.RunWorkerAsync(); } } }
private void suggestionBox_KeyDown(object sender, KeyEventArgs e) { KeyEventsHandler.SuggestionKeyHandler(e); }