private void fctb_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { //clear previous highlighting e.ChangedRange.ClearStyle(maroonStyle); //highlight tags e.ChangedRange.SetStyle(maroonStyle, "<[^>]+>"); }
//Style BlueStyle = new TextStyle(Brushes.Blue, null, FontStyle.Regular); //public Regex operators = new Regex("[+*/[%-.,;|&=]()"); private void CodeTB_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { e.ChangedRange.ClearStyle(BlueStyle); e.ChangedRange.SetStyle(BlueStyle, keyWords); e.ChangedRange.ClearStyle(NumberStyle); e.ChangedRange.SetStyle(NumberStyle, NumbersRegex); }
public static void StyleFastColoredTextBox(FastColoredTextBoxNS.FastColoredTextBox box, Data.Style style) { box.BackColor = style.ControlBackColor; box.ForeColor = style.ForeColor; box.CaretColor = style.ForeColor; box.IndentBackColor = style.ControlBackColor; box.ServiceLinesColor = style.WindowBackColor; }
private void fctb_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { e.ChangedRange.ClearStyle(StyleIndex.All); foreach (var key in style.ImagesByText.Keys) { string pattern = Regex.Replace(key, RegexSpecSymbolsPattern, "\\$0"); e.ChangedRange.SetStyle(style, pattern); } }
public override void Draw(System.Drawing.Graphics gr, System.Drawing.Point position, FastColoredTextBoxNS.Range range) { base.Draw(gr, position, range); const int size = 2; var end = Math.Max(((range.End.iChar - range.Start.iChar) * range.tb.CharWidth) / size, size); position.Offset(0, range.tb.CharHeight - size); for (int i = 0; i < end; i++) { var start = position; position.Offset(size, size * (int)Math.Pow(-1, i)); gr.DrawLine(_pen, start, position); } }
private void conditionalScriptBox_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { if (dialogTreeViewer1.SelectedNode == null) return; if (dialogTreeViewer1.SelectedNode.NodeType == DialogNodeType.Action) { ActionNode an = dialogTreeViewer1.SelectedNode as ActionNode; if (an != null) an.Conditions = conditionalScriptBox.Text; } else { ResponseNode rn = dialogTreeViewer1.SelectedNode as ResponseNode; if (rn != null) rn.Conditions = conditionalScriptBox.Text; } }
private void ConsoleBox_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { if ((sender as ConsoleBox).LinesCount >= 200) { (sender as ConsoleBox).Clear(); (sender as ConsoleBox).ClearUndo(); } /*{ List<int> LinesToRemove = new List<int>(); LinesToRemove.Add(1); (sender as ConsoleBox).RemoveLines(LinesToRemove); }*/ if (chkAutoScroll.Checked) (sender as ConsoleBox).AutoScroll = true; else (sender as ConsoleBox).AutoScroll = false; }
private void fastColoredTextBox1_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { #region moo e.ChangedRange.ClearStyle(RedStyle, GreennStyle, GreenStyle, BlueStyle, BoldStyle, GrayStyle, MagentaStyle, BrownStyle, MaroonStyle); #endregion #region syntax highlighting e.ChangedRange.SetFoldingMarkers("{", "}"); //e.ChangedRange.SetStyle(MagentaStyle, @"@|<|>"); e.ChangedRange.SetStyle(BlueStyle, "true|false|null", RegexOptions.IgnoreCase); e.ChangedRange.SetStyle(BrownStyle, @"""([^""]*)"""); e.ChangedRange.SetStyle(GreenStyle, "//.*$", RegexOptions.Multiline); e.ChangedRange.SetStyle(GreenStyle, "(/\\*.*?\\*/)|(/\\*.*)", RegexOptions.Singleline); e.ChangedRange.SetStyle(GreenStyle, "(/\\*.*?\\*/)|(.*\\*/)", RegexOptions.Singleline | RegexOptions.RightToLeft); // e.ChangedRange.SetStyle(GreennStyle, "/p|/a"); fastColoredTextBox1.LeftBracket = '{'; fastColoredTextBox1.RightBracket = '}'; fastColoredTextBox1.RightBracket2 = ']'; fastColoredTextBox1.LeftBracket2 = '['; e.ChangedRange.SetStyle(RedStyle, "0|1|2|3|4|5|6|7|8|9|-"); #endregion }
public InsertLine(FastColoredTextBoxNS.FastColoredTextBox tb, InsertType t) { InitializeComponent(); it = t; fctb = tb; if (t == InsertType.Line) { this.Text = "Insert Lines"; label1.Text = "Number of Lines To Insert :"; button1.Text = "Insert"; } else if (t == InsertType.Column) { this.Text = "Insert Column"; label1.Text = "No. of Columns to Insert :"; button1.Text = "Insert"; } else if (t == InsertType.Macro) { this.Text = "Run Macro Multiple Times"; label1.Text = "No. of Times to Run :"; button1.Text = "Run"; } }
private void fastColoredTextBox1_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { e.ChangedRange.SetFoldingMarkers("{", "}"); e.ChangedRange.SetFoldingMarkers("function", "end"); e.ChangedRange.SetFoldingMarkers("if", "end"); var s = (FastColoredTextBox)sender; toolStripStatusLabel3.Text = "Lines: " + s.LineInfos.Count.ToString() + " Char Count: " + s.Text.Length.ToString(); }
private void Doc_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { var doc = ((Document)sender); if (doc.NeedsSaving) { doc.Parent.Text = doc.shortFileName; } }
private void Editor_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { var fctb = sender as FastColoredTextBox; FirstOpen = false; if (!Text.EndsWith("*")) Text = Text + "*"; e.ChangedRange.ClearStyle(Theme.StyleKeywords, Theme.StyleComments, Theme.StyleStrings, Theme.StyleNumbers); e.ChangedRange.SetStyle(Theme.StyleKeywords, @"\b(program|process|const|global|local|private|begin|end|if|else|end|loop|frame|while|repeat|for|from|until|break|return|type|offset)\b", RegexOptions.IgnoreCase); e.ChangedRange.SetStyle(Theme.StyleStrings, @"""""|@""""|''|@"".*?""|(?<!@)(?<range>"".*?[^\\]"")|'.*?[^\\]'"); e.ChangedRange.SetStyle(Theme.StyleNumbers, @"\b\d+[\.]?\d*([eE]\-?\d+)?[lLdDfF]?\b|\b0x[a-fA-F\d]+\b"); // TODO: Fix regex, strings don't get colored as comments fctb.Range.SetStyle(Theme.StyleComments, @"//.*$", RegexOptions.Multiline); fctb.Range.SetStyle(Theme.StyleComments, @"(/\*.*?\*/)|(/\*.*)", RegexOptions.Singleline); }
private void fctb_TextChangedDelayed(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { e.ChangedRange.ClearStyle(blueStyle); e.ChangedRange.SetStyle(blueStyle, @"(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?"); }
private void textBox_chat_TextChangedDelayed(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { //if (emotesStyle != null) //{ // e.ChangedRange.ClearStyle(emotesStyle); // foreach (var key in emotesStyle.ImagesByText.Keys) // { // string pattern = Regex.Replace(key, RegexSpecSymbolsPattern, "\\$0"); // e.ChangedRange.SetStyle(emotesStyle, pattern); // } //} e.ChangedRange.ClearStyle(blueStyle_); e.ChangedRange.SetStyle(blueStyle_, @"((http|ftp|https):\/\/)?[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?"); }
void fastColoredTextBox1_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { setdirty(); }
private void fastColoredTextBox2_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { this.fastColoredTextBox2.LeftBracket = '('; this.fastColoredTextBox2.RightBracket = ')'; this.fastColoredTextBox2.LeftBracket2 = '\0'; this.fastColoredTextBox2.RightBracket2 = '\0'; e.ChangedRange.ClearStyle(new Style[] { this.BlueStyle, this.BoldStyle, this.GrayStyle, this.MagentaStyle, this.GreenStyle, this.BrownStyle }); e.ChangedRange.SetStyle(this.BrownStyle, "\"\"|@\"\"|''|@\".*?\"|(?<!@)(?<range>\".*?[^\\\\]\")|'.*?[^\\\\]'"); e.ChangedRange.SetStyle(this.GreenStyle, "//.*$", RegexOptions.Multiline); e.ChangedRange.SetStyle(this.GreenStyle, "(/\\*.*?\\*/)|(/\\*.*)", RegexOptions.Singleline); e.ChangedRange.SetStyle(this.GreenStyle, "(/\\*.*?\\*/)|(.*\\*/)", RegexOptions.Singleline | RegexOptions.RightToLeft); e.ChangedRange.SetStyle(this.MagentaStyle, "\\b\\d+[\\.]?\\d*([eE]\\-?\\d+)?[lLdDfF]?\\b|\\b0x[a-fA-F\\d]+\\b"); e.ChangedRange.SetStyle(this.GrayStyle, "^\\s*(?<range>\\[.+?\\])\\s*$", RegexOptions.Multiline); e.ChangedRange.SetStyle(this.BoldStyle, "\\b(class|struct|enum|interface)\\s+(?<range>\\w+?)\\b"); e.ChangedRange.SetStyle(this.BlueStyle, "\\b(abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\\b|#region\\b|#endregion\\b"); e.ChangedRange.ClearFoldingMarkers(); e.ChangedRange.SetFoldingMarkers("{", "}"); e.ChangedRange.SetFoldingMarkers("#region\\b", "#endregion\\b"); e.ChangedRange.SetFoldingMarkers("/\\*", "\\*/"); }
/// <summary> /// When the text in the editor has changed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void editor_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { // set the default highlighter //editor.SyntaxHighlighter.InitStyleSchema(Language.JS); //editor.SyntaxHighlighter.JScriptSyntaxHighlight(editor.Range); e.ChangedRange.ClearStyle(commentStyle, dollarStyle, stringStyle, numberStyle, linkStyle); // highlight comments e.ChangedRange.SetStyle(commentStyle, new Regex(@"^[\s]*//.*$", RegexOptions.Multiline | RegexOptions.Compiled)); // highlight dots after dollars or closing braces e.ChangedRange.SetStyle(dollarStyle, @"\$\.|\)\."); // highlight links e.ChangedRange.SetStyle(linkStyle, @"['""](http|https):\/\/([^""']+)", RegexOptions.Compiled); // highlight string parameters e.ChangedRange.SetStyle(stringStyle, new Regex(@"['""][^'""]*['""]", RegexOptions.Compiled)); // highlight numbers e.ChangedRange.SetStyle(numberStyle, new Regex(@"\b\d+[\.]?\d*([eE]\-?\d+)?[lLdDfF]?\b|\b0x[a-fA-F\d]+\b", RegexOptions.Compiled)); // the background of the current line editor.CurrentLineColor = Color.LightYellow; }
private void tbInput_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { tbOutput.Text = parser.ParseText(tbInput.Text).ToString(); }
private void fastColoredTextBox1_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { e.ChangedRange.ClearStyle(); }
void fastColoredTextBox1_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { #region moo e.ChangedRange.ClearStyle(RedStyle, GreennStyle, GreenStyle, BlueStyle, BoldStyle, GrayStyle, MagentaStyle, BrownStyle, MaroonStyle); #endregion #region syntax highlighting e.ChangedRange.ClearStyle(); e.ChangedRange.SetFoldingMarkers(":", ":"); e.ChangedRange.SetStyle(MagentaStyle, @"@|<|>"); e.ChangedRange.SetStyle(BlueStyle, "echo|set|pause|sleep|title|if|goto|color|cls", RegexOptions.IgnoreCase); e.ChangedRange.SetStyle(BrownStyle, "%([^%]*)%"); e.ChangedRange.SetStyle(GreennStyle, "/p|/a"); e.ChangedRange.SetStyle(RedStyle, "0|1|2|3|4|5|6|7|8|9"); #endregion parent.baseNamespace(); Parse(fastColoredTextBox1.Lines); parent.basecode.classes.Add(program); parent.Update(); }
void Editor_TextChangedDelayed(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { if (Editor.IsChanged) UpdateText(true); }
private void Editor_TextChangedDelayed(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { UpdateCaption(); }
private void edtLog_TextChangedDelayed(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { edtLog.Navigate(edtLog.Lines.Count - 1); }
private void queryCode_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { if (!_codeControlLoaded) return; if (_changed == false) { _changed = true; toolStripButtonSave.Enabled = true; toolStripButtonRun.Enabled = true; this.Text = CAPTION + " - " + Path.GetFileName(_currFile) + "*"; } }
private void fastColoredTextBox1_ToolTipNeeded(object sender, FastColoredTextBoxNS.ToolTipNeededEventArgs e) { if (!string.IsNullOrEmpty(e.HoveredWord)) { e.ToolTipTitle = e.HoveredWord; e.ToolTipText = "This is tooltip for '" + e.HoveredWord + "'"; } }
private void currentEditor_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { saved = false; }
private void Editor_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { this.OnContentChanged(EventArgs.Empty); //colorization e.ChangedRange.ClearStyle(VocabStyle); e.ChangedRange.SetStyle(VocabStyle, @"(?i)(?<=\s|^)#[\w\-.]+(?=\s|$)", RegexOptions.None); e.ChangedRange.ClearStyle(CommandStyle); e.ChangedRange.SetStyle(CommandStyle, @"(?<![A-z_0-9öäüáéíóú+])\@[A-z_0-9öäüáéíóú+]+", RegexOptions.None); e.ChangedRange.ClearStyle(ResponseStyle); e.ChangedRange.SetStyle(ResponseStyle, @"\[.+\]", RegexOptions.None); e.ChangedRange.ClearStyle(ParanthesisStyle); e.ChangedRange.SetStyle(ParanthesisStyle, @"(?i)(?<=[A-z_0-9öäüáéíóú+\n])\([A-z_0-9öäüáéíóú,+\s]+\)", RegexOptions.None); e.ChangedRange.ClearStyle(GotoStyle); e.ChangedRange.SetStyle(GotoStyle, @"(?i)(\@goto|then|chance[0-9]{2})\([A-z_0-9öäüáéíóú+\s]+\)", RegexOptions.None); e.ChangedRange.ClearStyle(CheckFlagStyle); e.ChangedRange.SetStyle(CheckFlagStyle, @"(?i)(\@checkflag)\([A-z_0-9öäüáéíóú,+\s]+\)", RegexOptions.None); e.ChangedRange.ClearStyle(FragmentStyle); e.ChangedRange.SetStyle(FragmentStyle, @"(?i)\$\$frag\([A-z_0-9öäüáéíóú+\s]+\)", RegexOptions.None); //e.ChangedRange.ClearStyle(CommentStyle); //e.ChangedRange.SetStyle(CommentStyle, @"(?i)(?<!.)-.*", RegexOptions.None); ////code folding //e.ChangedRange.SetFoldingMarkers(@"-region", @"-endregion"); }
/////////////////////////////////////////////////////////////////////////////////////////// private void myScriptBox_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { Macro macro = (Macro)myMacroList.SelectedItem; macro.Script = myScriptBox.Text; //clear old styles of chars e.ChangedRange.ClearStyle(keywordStyle, preprocessorStyle); e.ChangedRange.SetStyle(keywordStyle, keywordList, System.Text.RegularExpressions.RegexOptions.IgnoreCase); e.ChangedRange.SetStyle(preprocessorStyle, preprocessorList, System.Text.RegularExpressions.RegexOptions.IgnoreCase); }
private void txtSource_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e) { _parseTree = null; //force it to recompile on run }
private void fastColoredTextBox_Code_LineRemoved(object aSender, FastColoredTextBoxNS.LineRemovedEventArgs aEventArgs) { foreach (int lId in aEventArgs.RemovedLineUniqueIds) { mErrorsLineId.Remove(lId); } }