public void ShowAutocomplete(Pos pos) { completeSource.Initialize((IView)editor.FindForm()); var list = completeSource.GetItems(); ShowAutocomplete(pos, list); }
private AutocompleteWindow GetAutocompleteWindow() { if (window == null) { window = new AutocompleteWindow(editor) { MaxItems = 15, SmallFont = true }; window.Visible = false; window.MouseDown += AutocompleteClick; editor.FindForm().Controls.Add(window); window.BringToFront(); } return(window); }
private void RestyleRange(Range range) { if (range.End.Line < 0) { return; } if (StyleNeeded != null) { StyleNeeded?.Invoke(this, new StyleNeededEventArgs(range)); } else { var grm = App.Ext.Grammars().GetGrammar(editor.Buffer.GrammarKey); var styler = grm == null ? null : App.Catalog <IStylerComponent>().GetComponent(grm.StylerKey ?? defaultStyler); if (styler != null) { styler.Style((IView)editor.FindForm(), range); } } }
private void RunRebuild(int fvl, int lvl) { try { busy = true; while (fvl > -1 && !IsFoldingHeader(fvl)) { fvl--; } fvl = fvl < 0 ? 0 : fvl; lvl = lvl < fvl ? fvl : lvl; var range = new Range( new Pos(fvl, 0), new Pos(lvl, Lines[lvl].Length - 1)); if (FoldingNeeded != null) { FoldingNeeded?.Invoke(this, new FoldingNeededEventArgs(range)); } else { var aff = editor.AffinityManager.GetRootAffinity(); var key = aff?.FoldingComponentKey ?? editor.EditorSettings.FoldingComponentKey; if (key != null) { var fp = App.Catalog <IFoldingComponent>().GetComponent(key); fp.Fold((IView)editor.FindForm(), range); } } } finally { busy = false; } }
public bool CheckSpelling() { // check spelling using (SpellCheckerForm spellCheckerForm = new SpellCheckerForm(SpellingChecker, EditorControl.FindForm(), false)) { // center the spell-checking form over the document body spellCheckerForm.StartPosition = FormStartPosition.CenterParent; // create word range // TODO: smarter word range for html //TextBoxWordRange wordRange = new TextBoxWordRange(_textBox, _textBox.SelectionLength > 0); HtmlTextBoxWordRange wordRange = new HtmlTextBoxWordRange(_textBox); // check spelling spellCheckerForm.CheckSpelling(wordRange); // return completed status return(spellCheckerForm.Completed); } }