Example #1
0
        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;
            //}
        }
Example #2
0
 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);
 }
Example #3
0
        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();
                }
            }
        }
Example #4
0
 private void suggestionBox_KeyDown(object sender, KeyEventArgs e)
 {
     KeyEventsHandler.SuggestionKeyHandler(e);
 }