diff --git a/Binary/FastColoredTextBox.dll b/Binary/FastColoredTextBox.dll index 4c895334..b459d9d0 100644 Binary files a/Binary/FastColoredTextBox.dll and b/Binary/FastColoredTextBox.dll differ diff --git a/Binary/FastColoredTextBox.xml b/Binary/FastColoredTextBox.xml index d9852c9c..55eacace 100644 --- a/Binary/FastColoredTextBox.xml +++ b/Binary/FastColoredTextBox.xml @@ -684,6 +684,17 @@ + + + Highlights Assembly cod + + + + + Highlights Assembly code + + + String style @@ -799,6 +810,11 @@ SQL Types style + + + Assembly register style + + Language @@ -1412,6 +1428,11 @@ Occurs when mouse is moving over text and tooltip is needed + + + Default size of the markers + + Removes all hints diff --git a/Binary/Tester.exe b/Binary/Tester.exe index b086b8be..76b6addf 100644 Binary files a/Binary/Tester.exe and b/Binary/Tester.exe differ diff --git a/FastColoredTextBox/SyntaxHighlighter.cs b/FastColoredTextBox/SyntaxHighlighter.cs index 44dfe0bb..161c7946 100644 --- a/FastColoredTextBox/SyntaxHighlighter.cs +++ b/FastColoredTextBox/SyntaxHighlighter.cs @@ -22,6 +22,11 @@ public class SyntaxHighlighter : IDisposable public readonly Style MaroonStyle = new TextStyle(Brushes.Maroon, null, FontStyle.Regular); public readonly Style RedStyle = new TextStyle(Brushes.Red, null, FontStyle.Regular); public readonly Style BlackStyle = new TextStyle(Brushes.Black, null, FontStyle.Regular); + public readonly Style ForestGreenStyle= new TextStyle(Brushes.ForestGreen, null, FontStyle.Italic); + public readonly Style CrimsonStyle= new TextStyle(Brushes.Crimson, null, FontStyle.Regular); + public readonly Style OrangeStyle= new TextStyle(Brushes.Orange, null, FontStyle.Regular); + public readonly Style DodgerBlueStyle= new TextStyle(Brushes.DodgerBlue, null, FontStyle.Regular); + // protected readonly Dictionary descByXMLfileNames = new Dictionary(); @@ -118,6 +123,14 @@ public class SyntaxHighlighter : IDisposable protected Regex VBNumberRegex; protected Regex VBStringRegex; + protected Regex AssemblyStringRegex, + AssemblyCommentRegex, + AssemblyNumberRegex, + AssemblyAttributeRegex, + AssemblyKeywordsRegex, + AssemblyInstructionsRegex, + AssemblyRegisterRegex; + protected FastColoredTextBox currentTb; public static RegexOptions RegexCompiledOption @@ -179,6 +192,9 @@ public virtual void HighlightSyntax(Language language, Range range) case Language.JSON: JSONSyntaxHighlight(range); break; + case Language.Assembly: + AssemblySyntaxHighlight(range); + break; default: break; } @@ -235,6 +251,9 @@ public virtual void AutoIndentNeeded(object sender, AutoIndentEventArgs args) case Language.Lua: LuaAutoIndentNeeded(sender, args); break; + case Language.Assembly: + AssemblyAutoIndentNeeded(sender, args); + break; default: break; } @@ -370,6 +389,16 @@ protected void CSharpAutoIndentNeeded(object sender, AutoIndentEventArgs args) } } + private void AssemblyAutoIndentNeeded(object sender, AutoIndentEventArgs args) + { + //label + if (Regex.IsMatch(args.LineText, @"^\s*\w+\s*:\s*($|//)") && !Regex.IsMatch(args.LineText, @"^\s*default\s*:")) + { + args.Shift = -args.TabLength; + return; + } + } + /// /// Uses the given to parse a XML description and adds it as syntax descriptor. /// The syntax descriptor is used for highlighting when @@ -693,6 +722,14 @@ public void InitStyleSchema(Language lang) NumberStyle = MagentaStyle; KeywordStyle = BlueStyle; break; + case Language.Assembly: + AssemblyRegisterStyle = OrangeStyle; + StringStyle = RedStyle; + CommentStyle = ForestGreenStyle; + NumberStyle = CrimsonStyle; + KeywordStyle = DodgerBlueStyle; + ClassNameStyle = BlueStyle; + break; } } @@ -1344,6 +1381,80 @@ public virtual void JSONSyntaxHighlight(Range range) range.SetFoldingMarkers(@"\[", @"\]"); //allow to collapse comment block } + + /// + /// Highlights Assembly cod + /// + void InitAssemblyRegex() + { + AssemblyStringRegex = new Regex(@"""""|@""""|''|@"".*?""|(?"".*?[^\\]"")|'.*?[^\\]'", RegexCompiledOption); + AssemblyCommentRegex = new Regex(@"(;.*)", RegexOptions.Multiline | RegexCompiledOption); + AssemblyNumberRegex = new Regex(@"\b\d+[\.]?\d*([eE]\-?\d+)?[abcedfh|ahbhchdhehfh]?\b|\b0x[abcedfh|ahbhchdhehfh\d]+\b", RegexOptions.IgnoreCase | RegexCompiledOption); + AssemblyAttributeRegex = new Regex(@"^\s*(?\[.+?\])\s*$", RegexOptions.Multiline | RegexCompiledOption); + AssemblyKeywordsRegex = new Regex(@"\b(%(1)|.186(m)|.286(m)|.286c(m)|.286p(m)|.386(m)|.386c(m)|.386p(m)|.387(m)|.8086(m)|.8087(m)|;(2)|=(2)|align|.alpha(m)|arg|arpl|assume|%bin|bound|bsf|bsr|bt|btc|btr|bts|catstr(2)|cdq|clts|cmpbw|cmps|cmpsd|.code(m)|codeseg|comm(1)|comment(1)|%conds|const|.const(m)|%cref|.cref(m)|%crefall|%crefref|%crefuref|%ctls|cwde|.data(m)|.data?(m)|dataseg|dw|db|db(2)|dd(2)|%depth|df(2)|display|dosseg|dp(2)|dq(2)|dt(2)|dw(2)|else(1)|elseif(1)|elseif1(1)|elseif2(1)|elseifb(1)|elseifdef(1)|elseifdif(1)|elseifdifi(1)|elseife(1)|elseifidn(1)|elseifidni(1)|elseifnb(1)|elseifndef(1)|emul|end|endif(1)|endm|endp(2)|ends(2)|enter|equ(2)|.err(l)(m)|err|.err1(1)(m)|.err2(1)(m)|.errb(1)(m)|.errdef(l)(m)|.errdif(1)(m)|.errdifi(1)(m)|.erre(l)(m)|.erridn(1)(m)|.erridni(1)(m)|errif|errif1|errif2|errifb|errifdef|errifdif|errifdifi|errife|errifidn|errifidni|errifnb|errifndef|.errnb(1)(m)|.errndef(1)(m)|.errnz(1)(m)|esc|even|evendata|exitm|extrn(1)|f2xm1|fabs|fadd|faddp|fardata|.fardata(m)|.fardata?(m)|fbld|fbstp|fchs|fclex|fcom|fcomp|fcompp|fdecstp|fdisi|fdiv|fdivp|fdivr|fdivrp|feni|ffree|fiadd|ficom|ficomp|fidiv|fidivr|fild|fimul|fincstp|finit|fist|fistp|fisub|fisbr|fld|fld!|fldcw|fldenv|fldl2e|fldl2t|fldlg2|fldln2|fldpi|fldz|fmul|fmulp|fnclex|fndisi|fneni|fninit|fnop|fnsave|fnstcw|ifidn(1)|ltr|fnstenv|ifidni(1)|%macs|fnstsw|ifnb(1)|macro(2)|fpatan|ifndef(1)|masm|fprem|ijecxz|jump|model|fptan|jumps|.model(m)|frndint|frstor|label(2)|movmovs|fsave|%incl|fscale|include(1)|.lall(m)|movsd|fsqrt|includelib(1)|lar|fst|ins|movsx|fstcw|insb|movzx|fstenv|insd|leave|fstp|instr(2)|multerrs|fstsw|insw|.lfcond(m)|name(1)|fsub|lfs|fsubp|lgdt|%newpage|fsubr|lgs|%noconds|fsubrp|ireid|lidt|%nocref|ftst|irp(1)|%linum|%noctls|fwait|irpc(1)|%list|noemul|fxam|.list(m)|%noincl|fxch|lldt|nojumps|fxtract|lmsw|%nolist|fyl2x|local|nolocals|fyl2xp1|locals|nomasm51|fsetpm|lock|%nomacs|fpcos|lods.|nomulterrs|fprem1|fpsin|lodsd|nosmart|fpsincos|%nosyms|fucom|le|fucomp|loopd|%notrunc|fucompp|loopde|nowarn|global(1)|loopdne|group(2)|loopdnz|org|loopdz|ideal|%out(l)|outs|if(1)|outsb|if!(1)|loopw|outsd|if2(1)|loopwe|outsw|ifb(1)|loopwne|p186|ifdef(1)|loopwnz|p286|ifdif(1)|loopwz|p286n|ifdifi(1)|p287|!fe|(1)|lsllss|p386|p386n|rept(1)|setne|str|p387|setng|struc(2)|p8086|setnge|p8087|se1nl|substr(2)|page|se1nle|subtil(1)|%pagesize|setno|%subtil|%pcnt|setnp|%syms|pn087|setns|%tabsize|retn|setnz|popa|seto|%text|popad|setp|.tfcond(m)|popfd|setpe|title(1)|%poplctl|setpo|%title|ppf|.5all(m)|sets|%trunc|proc(2)|setz|udataseg|.sfcond(m)|ufardata|scas|sgdt|union(2)|pushad|uses|scasd|shld|verr|pushfd|verw|%pushlctl|segment(2)|shrd|wait|public(1)|.5eq(m)|sidt|warn|purge|seta|sizestr(2)|xall(m)|%pagesize|setae|sldt|%pcnt|setb|smart|.xcref(m)|pn087|setbe|smsw|xlat|%poplctl|setc|sor|proc(2)|sete|stack|.xlist(m)|%pushlctl|setg|.5tack(m)|usecs|public(1)|setge|.startup(m)|useds|purge|setl|usees|quirks|setle|sid|usefs|radix|setna|usegs|.radix(m)|setnae|stos|usess|rcl|setnb|setnbe|stosd|record(2)|setnc|bswap|cmpxchg|invd|xadd|p486|p486n|p487|invlpg|startupcode|wbinvd|publicdll(i)|retcode|enterd|leaved|enterw|leavew|clrflag|goto(l)|tblinit|enum(2)|largestack|tblinst|exitcode|setfield|typedef|fastimul|setflag|tblinit|flipflag|smallstack|tblinst|getfield|table(2)|version|while(1)|pushstate|popstate|iretw|popfw|protype(2)|popaw|procdesc(2)|pushaw|pushfw|alias|p586n|rsm|cmpxchg8b|p587|wrmsr|cpuid|rdmsr|p586|rdtsc|break|.continue|.else|.elseif|.endif|.endw|.if|.listall|.listif|.listmacro|.listmacroall|nolist|nolistif|.nolistmacro|.repeat|.until|.untilcxz|.while|carry?|echo|export|extern|externdef|far16|far32|for|forc|near16|near32|option|overflow?|parity?|private|proto|public|realio|real4|real8|repeat|sbyte|sdword|sign?|struct|subtitle|sword|zero?|casemap|dotname|nodotname|emulator|noemulator|epilogue|expr16|expr32|language|ljmp|noljmp|m510|nom510|nokeyword|nosignextend|offset|oldmacros|nooldmacros|oldstructs|nooldstructs|proc|prologue|readonly|noreadonly|scoped|noscoped|segment|setif2|far|near|ends)\b", RegexOptions.IgnoreCase | RegexCompiledOption); + AssemblyInstructionsRegex = new Regex(@"\b(aaa|aad|aam|aas|adc|add|and|call|cbw|clc|cld|cli|cmc|cmp|cmpsb|cmpsw|cwd|daa|das|dec|div|hlt|idiv|imul|in|inc|int|into|iret|ja|jae|jb|jbe|jc|jcxz|je|jg|jge|jl|jle|jmp|jna|jnae|jnb|jnbe|jnc|jne|jng|jnge|jnl|jnle|jno|jnp|jns|jnz|jo|jp|jpe|jpo|js|jz|lahf|lds|lea|les|lodsb|lodsw|loop|loope|loopne|loopnz|loopz|mov|movsb|movsw|mul|neg|nop|not|or|out|pop|popa|popf|push|pusha|pushf|rcl|rcr|rep|repe|repne|repnz|repz|ret|retf|rol|ror|sahf|sal|sar|sbb|scasb|scasw|shl|shr|stc|std|sti|stosb|stosw|sub|test|xchg|xlatb|xor)\b", RegexOptions.IgnoreCase | RegexCompiledOption); + AssemblyRegisterRegex = new Regex(@"\b(ax|bx|cx|dx|ah|al|bl|bh|ch|cl|dh|dl|di|si|bp|sp|ds|es|ss|cs)\b", RegexOptions.IgnoreCase | RegexCompiledOption); + } + + /// + /// Highlights Assembly code + /// + /// + public virtual void AssemblySyntaxHighlight(Range range) + { + range.tb.CommentPrefix = ";"; + + //clear style of changed range + range.ClearStyle(StringStyle, CommentStyle, NumberStyle, AttributeStyle, ClassNameStyle, KeywordStyle, AssemblyRegisterStyle); + // + if (AssemblyStringRegex == null) + InitAssemblyRegex(); + //string highlighting + range.SetStyle(StringStyle, AssemblyStringRegex); + //comment highlighting + range.SetStyle(CommentStyle, AssemblyCommentRegex); + //number highlighting + range.SetStyle(NumberStyle, AssemblyNumberRegex); + //attribute highlighting + range.SetStyle(AttributeStyle, AssemblyAttributeRegex); + //class name highlighting + range.SetStyle(ClassNameStyle, AssemblyInstructionsRegex); + //keyword highlighting + range.SetStyle(KeywordStyle, AssemblyKeywordsRegex); + //Register highlighting + range.SetStyle(AssemblyRegisterStyle, AssemblyRegisterRegex); + + + //find document comments + foreach (var r in range.GetRanges(@"^\s*///.*$", RegexOptions.Multiline)) + { + //remove C# highlighting from this fragment + r.ClearStyle(StyleIndex.All); + + // + r.SetStyle(CommentStyle); + + //prefix '///' + foreach (var rr in r.GetRanges(@"^\s*///", RegexOptions.Multiline)) + { + rr.ClearStyle(StyleIndex.All); + rr.SetStyle(CommentTagStyle); + } + } + + //clear folding markers + range.ClearFoldingMarkers(); + //testing foling markers + range.SetFoldingMarkers("segment", "ends", RegexOptions.IgnoreCase);//allow to collapse brackets block + + //set folding markers + /* + * no foldling marker keywords in assembly + */ + } + + + #region Styles /// @@ -1461,6 +1572,11 @@ public virtual void JSONSyntaxHighlight(Range range) /// public Style TypesStyle { get; set; } + /// + /// Assembly register style + /// + public Style AssemblyRegisterStyle { get; set; } + #endregion } @@ -1478,6 +1594,7 @@ public enum Language PHP, JS, Lua, - JSON + JSON, + Assembly } } diff --git a/Tester/PowerfulSample.Designer.cs b/Tester/PowerfulSample.Designer.cs index 466508fe..0a52afb1 100644 --- a/Tester/PowerfulSample.Designer.cs +++ b/Tester/PowerfulSample.Designer.cs @@ -72,13 +72,14 @@ private void InitializeComponent() this.pHPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.jSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.luaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.jSONToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.assemblyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.miExport = new System.Windows.Forms.ToolStripMenuItem(); this.hTMLToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.rTFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.miChangeColors = new System.Windows.Forms.ToolStripMenuItem(); this.changeHotkeysToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fctb = new FastColoredTextBoxNS.FastColoredTextBox(); - this.jSONToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.fctb)).BeginInit(); this.SuspendLayout(); @@ -94,8 +95,7 @@ private void InitializeComponent() this.changeHotkeysToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2); - this.menuStrip1.Size = new System.Drawing.Size(461, 28); + this.menuStrip1.Size = new System.Drawing.Size(346, 24); this.menuStrip1.TabIndex = 4; this.menuStrip1.Text = "menuStrip1"; // @@ -132,189 +132,189 @@ private void InitializeComponent() this.startStopMacroRecordingToolStripMenuItem, this.executeMacroToolStripMenuItem}); this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.Size = new System.Drawing.Size(47, 24); + this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); this.editToolStripMenuItem.Text = "&Edit"; // // findToolStripMenuItem // this.findToolStripMenuItem.Name = "findToolStripMenuItem"; - this.findToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.findToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.findToolStripMenuItem.Text = "&Find [Ctrl+F]"; this.findToolStripMenuItem.Click += new System.EventHandler(this.findToolStripMenuItem_Click); // // replaceToolStripMenuItem // this.replaceToolStripMenuItem.Name = "replaceToolStripMenuItem"; - this.replaceToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.replaceToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.replaceToolStripMenuItem.Text = "&Replace [Ctrl+H]"; this.replaceToolStripMenuItem.Click += new System.EventHandler(this.replaceToolStripMenuItem_Click); // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(323, 6); + this.toolStripMenuItem1.Size = new System.Drawing.Size(264, 6); // // setSelectedAsReadonlyToolStripMenuItem // this.setSelectedAsReadonlyToolStripMenuItem.Name = "setSelectedAsReadonlyToolStripMenuItem"; - this.setSelectedAsReadonlyToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.setSelectedAsReadonlyToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.setSelectedAsReadonlyToolStripMenuItem.Text = "Set selected as readonly"; this.setSelectedAsReadonlyToolStripMenuItem.Click += new System.EventHandler(this.setSelectedAsReadonlyToolStripMenuItem_Click); // // setSelectedAsWritableToolStripMenuItem // this.setSelectedAsWritableToolStripMenuItem.Name = "setSelectedAsWritableToolStripMenuItem"; - this.setSelectedAsWritableToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.setSelectedAsWritableToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.setSelectedAsWritableToolStripMenuItem.Text = "Set selected as writable"; this.setSelectedAsWritableToolStripMenuItem.Click += new System.EventHandler(this.setSelectedAsWritableToolStripMenuItem_Click); // // toolStripMenuItem8 // this.toolStripMenuItem8.Name = "toolStripMenuItem8"; - this.toolStripMenuItem8.Size = new System.Drawing.Size(323, 6); + this.toolStripMenuItem8.Size = new System.Drawing.Size(264, 6); // // collapseSelectedBlockToolStripMenuItem // this.collapseSelectedBlockToolStripMenuItem.Name = "collapseSelectedBlockToolStripMenuItem"; - this.collapseSelectedBlockToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.collapseSelectedBlockToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.collapseSelectedBlockToolStripMenuItem.Text = "Collapse selected block"; this.collapseSelectedBlockToolStripMenuItem.Click += new System.EventHandler(this.collapseSelectedBlockToolStripMenuItem_Click); // // toolStripMenuItem3 // this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(323, 6); + this.toolStripMenuItem3.Size = new System.Drawing.Size(264, 6); // // collapseAllregionToolStripMenuItem // this.collapseAllregionToolStripMenuItem.Name = "collapseAllregionToolStripMenuItem"; - this.collapseAllregionToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.collapseAllregionToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.collapseAllregionToolStripMenuItem.Text = "Collapse all #region"; this.collapseAllregionToolStripMenuItem.Click += new System.EventHandler(this.collapseAllregionToolStripMenuItem_Click); // // exapndAllregionToolStripMenuItem // this.exapndAllregionToolStripMenuItem.Name = "exapndAllregionToolStripMenuItem"; - this.exapndAllregionToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.exapndAllregionToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.exapndAllregionToolStripMenuItem.Text = "Exapnd all #region"; this.exapndAllregionToolStripMenuItem.Click += new System.EventHandler(this.exapndAllregionToolStripMenuItem_Click); // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(323, 6); + this.toolStripMenuItem2.Size = new System.Drawing.Size(264, 6); // // increaseIndentSiftTabToolStripMenuItem // this.increaseIndentSiftTabToolStripMenuItem.Name = "increaseIndentSiftTabToolStripMenuItem"; - this.increaseIndentSiftTabToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.increaseIndentSiftTabToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.increaseIndentSiftTabToolStripMenuItem.Text = "Increase Indent [Tab]"; this.increaseIndentSiftTabToolStripMenuItem.Click += new System.EventHandler(this.increaseIndentSiftTabToolStripMenuItem_Click); // // decreaseIndentTabToolStripMenuItem // this.decreaseIndentTabToolStripMenuItem.Name = "decreaseIndentTabToolStripMenuItem"; - this.decreaseIndentTabToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.decreaseIndentTabToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.decreaseIndentTabToolStripMenuItem.Text = "Decrease Indent [Shift + Tab]"; this.decreaseIndentTabToolStripMenuItem.Click += new System.EventHandler(this.decreaseIndentTabToolStripMenuItem_Click); // // toolStripMenuItem10 // this.toolStripMenuItem10.Name = "toolStripMenuItem10"; - this.toolStripMenuItem10.Size = new System.Drawing.Size(323, 6); + this.toolStripMenuItem10.Size = new System.Drawing.Size(264, 6); // // commentSelectedLinesToolStripMenuItem // this.commentSelectedLinesToolStripMenuItem.Name = "commentSelectedLinesToolStripMenuItem"; - this.commentSelectedLinesToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.commentSelectedLinesToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.commentSelectedLinesToolStripMenuItem.Text = "Comment selected lines"; this.commentSelectedLinesToolStripMenuItem.Click += new System.EventHandler(this.commentSelectedLinesToolStripMenuItem_Click); // // uncommentSelectedLinesToolStripMenuItem // this.uncommentSelectedLinesToolStripMenuItem.Name = "uncommentSelectedLinesToolStripMenuItem"; - this.uncommentSelectedLinesToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.uncommentSelectedLinesToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.uncommentSelectedLinesToolStripMenuItem.Text = "Uncomment selected lines"; this.uncommentSelectedLinesToolStripMenuItem.Click += new System.EventHandler(this.uncommentSelectedLinesToolStripMenuItem_Click); // // toolStripMenuItem4 // this.toolStripMenuItem4.Name = "toolStripMenuItem4"; - this.toolStripMenuItem4.Size = new System.Drawing.Size(323, 6); + this.toolStripMenuItem4.Size = new System.Drawing.Size(264, 6); // // goBackwardCtrlToolStripMenuItem // this.goBackwardCtrlToolStripMenuItem.Name = "goBackwardCtrlToolStripMenuItem"; - this.goBackwardCtrlToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.goBackwardCtrlToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.goBackwardCtrlToolStripMenuItem.Text = "Go Backward [Ctrl+ -]"; this.goBackwardCtrlToolStripMenuItem.Click += new System.EventHandler(this.goBackwardCtrlToolStripMenuItem_Click); // // goForwardCtrlShiftToolStripMenuItem // this.goForwardCtrlShiftToolStripMenuItem.Name = "goForwardCtrlShiftToolStripMenuItem"; - this.goForwardCtrlShiftToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.goForwardCtrlShiftToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.goForwardCtrlShiftToolStripMenuItem.Text = "Go Forward [Ctrl+Shift+ -]"; this.goForwardCtrlShiftToolStripMenuItem.Click += new System.EventHandler(this.goForwardCtrlShiftToolStripMenuItem_Click); // // toolStripMenuItem5 // this.toolStripMenuItem5.Name = "toolStripMenuItem5"; - this.toolStripMenuItem5.Size = new System.Drawing.Size(323, 6); + this.toolStripMenuItem5.Size = new System.Drawing.Size(264, 6); // // autoIndentToolStripMenuItem // this.autoIndentToolStripMenuItem.Name = "autoIndentToolStripMenuItem"; - this.autoIndentToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.autoIndentToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.autoIndentToolStripMenuItem.Text = "Auto Indent selected text"; this.autoIndentToolStripMenuItem.Click += new System.EventHandler(this.autoIndentToolStripMenuItem_Click); // // toolStripMenuItem6 // this.toolStripMenuItem6.Name = "toolStripMenuItem6"; - this.toolStripMenuItem6.Size = new System.Drawing.Size(323, 6); + this.toolStripMenuItem6.Size = new System.Drawing.Size(264, 6); // // goLeftBracketToolStripMenuItem // this.goLeftBracketToolStripMenuItem.Name = "goLeftBracketToolStripMenuItem"; - this.goLeftBracketToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.goLeftBracketToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.goLeftBracketToolStripMenuItem.Text = "Go Left Bracket"; this.goLeftBracketToolStripMenuItem.Click += new System.EventHandler(this.goLeftBracketToolStripMenuItem_Click); // // goRightBracketToolStripMenuItem // this.goRightBracketToolStripMenuItem.Name = "goRightBracketToolStripMenuItem"; - this.goRightBracketToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.goRightBracketToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.goRightBracketToolStripMenuItem.Text = "Go Right Bracket"; this.goRightBracketToolStripMenuItem.Click += new System.EventHandler(this.goRightBracketToolStripMenuItem_Click); // // toolStripMenuItem7 // this.toolStripMenuItem7.Name = "toolStripMenuItem7"; - this.toolStripMenuItem7.Size = new System.Drawing.Size(323, 6); + this.toolStripMenuItem7.Size = new System.Drawing.Size(264, 6); // // miPrint // this.miPrint.Name = "miPrint"; - this.miPrint.Size = new System.Drawing.Size(326, 26); + this.miPrint.Size = new System.Drawing.Size(267, 22); this.miPrint.Text = "Print..."; this.miPrint.Click += new System.EventHandler(this.miPrint_Click); // // toolStripMenuItem9 // this.toolStripMenuItem9.Name = "toolStripMenuItem9"; - this.toolStripMenuItem9.Size = new System.Drawing.Size(323, 6); + this.toolStripMenuItem9.Size = new System.Drawing.Size(264, 6); // // startStopMacroRecordingToolStripMenuItem // this.startStopMacroRecordingToolStripMenuItem.Name = "startStopMacroRecordingToolStripMenuItem"; - this.startStopMacroRecordingToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.startStopMacroRecordingToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.startStopMacroRecordingToolStripMenuItem.Text = "Start/Stop macro recording [Ctrl+M]"; this.startStopMacroRecordingToolStripMenuItem.Click += new System.EventHandler(this.startStopMacroRecordingToolStripMenuItem_Click); // // executeMacroToolStripMenuItem // this.executeMacroToolStripMenuItem.Name = "executeMacroToolStripMenuItem"; - this.executeMacroToolStripMenuItem.Size = new System.Drawing.Size(326, 26); + this.executeMacroToolStripMenuItem.Size = new System.Drawing.Size(267, 22); this.executeMacroToolStripMenuItem.Text = "Execute macro [Ctrl+E]"; this.executeMacroToolStripMenuItem.Click += new System.EventHandler(this.executeMacroToolStripMenuItem_Click); // @@ -330,95 +330,110 @@ private void InitializeComponent() this.pHPToolStripMenuItem, this.jSToolStripMenuItem, this.luaToolStripMenuItem, - this.jSONToolStripMenuItem}); + this.jSONToolStripMenuItem, + this.assemblyToolStripMenuItem}); this.miLanguage.Name = "miLanguage"; - this.miLanguage.Size = new System.Drawing.Size(86, 24); + this.miLanguage.Size = new System.Drawing.Size(71, 20); this.miLanguage.Text = "Language"; this.miLanguage.DropDownOpening += new System.EventHandler(this.miLanguage_DropDownOpening); // // miCSharp // this.miCSharp.Name = "miCSharp"; - this.miCSharp.Size = new System.Drawing.Size(269, 26); + this.miCSharp.Size = new System.Drawing.Size(224, 22); this.miCSharp.Text = "CSharp (custom highlighter)"; this.miCSharp.Click += new System.EventHandler(this.miCSharp_Click); // // cSharpbuiltinHighlighterToolStripMenuItem // this.cSharpbuiltinHighlighterToolStripMenuItem.Name = "cSharpbuiltinHighlighterToolStripMenuItem"; - this.cSharpbuiltinHighlighterToolStripMenuItem.Size = new System.Drawing.Size(269, 26); + this.cSharpbuiltinHighlighterToolStripMenuItem.Size = new System.Drawing.Size(224, 22); this.cSharpbuiltinHighlighterToolStripMenuItem.Text = "CSharp (built-in highlighter)"; this.cSharpbuiltinHighlighterToolStripMenuItem.Click += new System.EventHandler(this.miCSharp_Click); // // miVB // this.miVB.Name = "miVB"; - this.miVB.Size = new System.Drawing.Size(269, 26); + this.miVB.Size = new System.Drawing.Size(224, 22); this.miVB.Text = "VB"; this.miVB.Click += new System.EventHandler(this.miCSharp_Click); // // hTMLToolStripMenuItem // this.hTMLToolStripMenuItem.Name = "hTMLToolStripMenuItem"; - this.hTMLToolStripMenuItem.Size = new System.Drawing.Size(269, 26); + this.hTMLToolStripMenuItem.Size = new System.Drawing.Size(224, 22); this.hTMLToolStripMenuItem.Text = "HTML"; this.hTMLToolStripMenuItem.Click += new System.EventHandler(this.miCSharp_Click); // // xmlToolStripMenuItem // this.xmlToolStripMenuItem.Name = "xmlToolStripMenuItem"; - this.xmlToolStripMenuItem.Size = new System.Drawing.Size(269, 26); + this.xmlToolStripMenuItem.Size = new System.Drawing.Size(224, 22); this.xmlToolStripMenuItem.Text = "XML"; this.xmlToolStripMenuItem.Click += new System.EventHandler(this.miCSharp_Click); // // sQLToolStripMenuItem // this.sQLToolStripMenuItem.Name = "sQLToolStripMenuItem"; - this.sQLToolStripMenuItem.Size = new System.Drawing.Size(269, 26); + this.sQLToolStripMenuItem.Size = new System.Drawing.Size(224, 22); this.sQLToolStripMenuItem.Text = "SQL"; this.sQLToolStripMenuItem.Click += new System.EventHandler(this.miCSharp_Click); // // pHPToolStripMenuItem // this.pHPToolStripMenuItem.Name = "pHPToolStripMenuItem"; - this.pHPToolStripMenuItem.Size = new System.Drawing.Size(269, 26); + this.pHPToolStripMenuItem.Size = new System.Drawing.Size(224, 22); this.pHPToolStripMenuItem.Text = "PHP"; this.pHPToolStripMenuItem.Click += new System.EventHandler(this.miCSharp_Click); // // jSToolStripMenuItem // this.jSToolStripMenuItem.Name = "jSToolStripMenuItem"; - this.jSToolStripMenuItem.Size = new System.Drawing.Size(269, 26); + this.jSToolStripMenuItem.Size = new System.Drawing.Size(224, 22); this.jSToolStripMenuItem.Text = "JS"; this.jSToolStripMenuItem.Click += new System.EventHandler(this.miCSharp_Click); // // luaToolStripMenuItem // this.luaToolStripMenuItem.Name = "luaToolStripMenuItem"; - this.luaToolStripMenuItem.Size = new System.Drawing.Size(269, 26); + this.luaToolStripMenuItem.Size = new System.Drawing.Size(224, 22); this.luaToolStripMenuItem.Text = "Lua"; this.luaToolStripMenuItem.Click += new System.EventHandler(this.miCSharp_Click); // + // jSONToolStripMenuItem + // + this.jSONToolStripMenuItem.Name = "jSONToolStripMenuItem"; + this.jSONToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.jSONToolStripMenuItem.Text = "JSON"; + this.jSONToolStripMenuItem.Click += new System.EventHandler(this.miCSharp_Click); + // + // assemblyToolStripMenuItem + // + this.assemblyToolStripMenuItem.Name = "assemblyToolStripMenuItem"; + this.assemblyToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.assemblyToolStripMenuItem.Text = "Assembly"; + this.assemblyToolStripMenuItem.Click += new System.EventHandler(this.miCSharp_Click); + // // miExport // this.miExport.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.hTMLToolStripMenuItem1, this.rTFToolStripMenuItem}); this.miExport.Name = "miExport"; - this.miExport.Size = new System.Drawing.Size(64, 24); + this.miExport.Size = new System.Drawing.Size(53, 20); this.miExport.Text = "Export"; // // hTMLToolStripMenuItem1 // this.hTMLToolStripMenuItem1.Name = "hTMLToolStripMenuItem1"; - this.hTMLToolStripMenuItem1.Size = new System.Drawing.Size(123, 26); + this.hTMLToolStripMenuItem1.Size = new System.Drawing.Size(106, 22); this.hTMLToolStripMenuItem1.Text = "HTML"; this.hTMLToolStripMenuItem1.Click += new System.EventHandler(this.hTMLToolStripMenuItem1_Click); // // rTFToolStripMenuItem // this.rTFToolStripMenuItem.Name = "rTFToolStripMenuItem"; - this.rTFToolStripMenuItem.Size = new System.Drawing.Size(123, 26); + this.rTFToolStripMenuItem.Size = new System.Drawing.Size(106, 22); this.rTFToolStripMenuItem.Text = "RTF"; this.rTFToolStripMenuItem.Click += new System.EventHandler(this.rTFToolStripMenuItem_Click); // @@ -426,14 +441,14 @@ private void InitializeComponent() // this.miChangeColors.Enabled = false; this.miChangeColors.Name = "miChangeColors"; - this.miChangeColors.Size = new System.Drawing.Size(115, 24); + this.miChangeColors.Size = new System.Drawing.Size(95, 20); this.miChangeColors.Text = "Change colors"; this.miChangeColors.Click += new System.EventHandler(this.miChangeColors_Click); // // changeHotkeysToolStripMenuItem // this.changeHotkeysToolStripMenuItem.Name = "changeHotkeysToolStripMenuItem"; - this.changeHotkeysToolStripMenuItem.Size = new System.Drawing.Size(125, 24); + this.changeHotkeysToolStripMenuItem.Size = new System.Drawing.Size(104, 20); this.changeHotkeysToolStripMenuItem.Text = "Change hotkeys"; this.changeHotkeysToolStripMenuItem.Click += new System.EventHandler(this.changeHotkeysToolStripMenuItem_Click); // @@ -453,12 +468,13 @@ private void InitializeComponent() this.fctb.AutoIndentCharsPatterns = "^\\s*[\\w\\.]+(\\s\\w+)?\\s*(?=)\\s*(?[^;=]+);\r\n^\\s*(case|default)\\s*[^:]*" + "(?:)\\s*(?[^;]+);"; this.fctb.AutoIndentExistingLines = false; - this.fctb.AutoScrollMinSize = new System.Drawing.Size(362, 361); + this.fctb.AutoScrollMinSize = new System.Drawing.Size(284, 285); this.fctb.BackBrush = null; this.fctb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.fctb.CharHeight = 19; - this.fctb.CharWidth = 9; + this.fctb.CharHeight = 15; + this.fctb.CharWidth = 7; this.fctb.Cursor = System.Windows.Forms.Cursors.IBeam; + this.fctb.DefaultMarkerSize = 8; this.fctb.DelayedEventsInterval = 200; this.fctb.DelayedTextChangedInterval = 500; this.fctb.DisabledColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180))))); @@ -466,15 +482,14 @@ private void InitializeComponent() this.fctb.Font = new System.Drawing.Font("Consolas", 9.75F); this.fctb.ImeMode = System.Windows.Forms.ImeMode.Off; this.fctb.IsReplaceMode = false; - this.fctb.Location = new System.Drawing.Point(0, 28); - this.fctb.Margin = new System.Windows.Forms.Padding(4); + this.fctb.Location = new System.Drawing.Point(0, 24); this.fctb.Name = "fctb"; this.fctb.Paddings = new System.Windows.Forms.Padding(0); this.fctb.PreferredLineWidth = 80; this.fctb.ReservedCountOfLineNumberChars = 2; this.fctb.SelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255))))); this.fctb.ServiceColors = ((FastColoredTextBoxNS.ServiceColors)(resources.GetObject("fctb.ServiceColors"))); - this.fctb.Size = new System.Drawing.Size(461, 384); + this.fctb.Size = new System.Drawing.Size(346, 311); this.fctb.TabIndex = 3; this.fctb.Text = resources.GetString("fctb.Text"); this.fctb.Zoom = 100; @@ -483,23 +498,15 @@ private void InitializeComponent() this.fctb.AutoIndentNeeded += new System.EventHandler(this.fctb_AutoIndentNeeded); this.fctb.CustomAction += new System.EventHandler(this.fctb_CustomAction); // - // jSONToolStripMenuItem - // - this.jSONToolStripMenuItem.Name = "jSONToolStripMenuItem"; - this.jSONToolStripMenuItem.Size = new System.Drawing.Size(269, 26); - this.jSONToolStripMenuItem.Text = "JSON"; - this.jSONToolStripMenuItem.Click += new System.EventHandler(this.miCSharp_Click); - // // PowerfulSample // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(461, 412); + this.ClientSize = new System.Drawing.Size(346, 335); this.Controls.Add(this.fctb); this.Controls.Add(this.menuStrip1); this.ImeMode = System.Windows.Forms.ImeMode.Hiragana; this.MainMenuStrip = this.menuStrip1; - this.Margin = new System.Windows.Forms.Padding(4); this.Name = "PowerfulSample"; this.Text = "FastColoredTextBox sample"; this.menuStrip1.ResumeLayout(false); @@ -560,6 +567,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem luaToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem xmlToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem jSONToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem assemblyToolStripMenuItem; } } diff --git a/Tester/PowerfulSample.cs b/Tester/PowerfulSample.cs index d103c0a2..68c8cf48 100644 --- a/Tester/PowerfulSample.cs +++ b/Tester/PowerfulSample.cs @@ -141,6 +141,7 @@ private void miCSharp_Click(object sender, EventArgs e) case "JS": fctb.Language = Language.JS; break; case "Lua": fctb.Language = Language.Lua; break; case "JSON": fctb.Language = Language.JSON; break; + case "Assembly": fctb.Language = Language.Assembly; break; } fctb.OnSyntaxHighlight(new TextChangedEventArgs(fctb.Range)); miChangeColors.Enabled = lang != "CSharp (custom highlighter)"; diff --git a/Tester/Tester.csproj b/Tester/Tester.csproj index 455d7028..0c5bcc8c 100644 --- a/Tester/Tester.csproj +++ b/Tester/Tester.csproj @@ -444,6 +444,9 @@ Resources.resx True + + .editorconfig + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/TesterVB/PowerfulSample.Designer.vb b/TesterVB/PowerfulSample.Designer.vb index eae6469d..51ca8670 100644 --- a/TesterVB/PowerfulSample.Designer.vb +++ b/TesterVB/PowerfulSample.Designer.vb @@ -23,6 +23,7 @@ Partial Class PowerfulSample _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(PowerfulSample)) Me.menuStrip1 = New System.Windows.Forms.MenuStrip() Me.editToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.findToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -37,6 +38,7 @@ Partial Class PowerfulSample Me.hTMLToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() Me.FontDialog1 = New System.Windows.Forms.FontDialog() Me.FastColoredTextBox1 = New FastColoredTextBoxNS.FastColoredTextBox() + Me.assemblyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.menuStrip1.SuspendLayout() CType(Me.FastColoredTextBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() @@ -71,7 +73,7 @@ Partial Class PowerfulSample ' 'miLanguage ' - Me.miLanguage.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.miCSharp, Me.miVB, Me.hTMLToolStripMenuItem, Me.sQLToolStripMenuItem, Me.pHPToolStripMenuItem}) + Me.miLanguage.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.miCSharp, Me.miVB, Me.hTMLToolStripMenuItem, Me.sQLToolStripMenuItem, Me.pHPToolStripMenuItem, Me.assemblyToolStripMenuItem}) Me.miLanguage.Name = "miLanguage" Me.miLanguage.Size = New System.Drawing.Size(71, 20) Me.miLanguage.Text = "Language" @@ -79,44 +81,44 @@ Partial Class PowerfulSample 'miCSharp ' Me.miCSharp.Name = "miCSharp" - Me.miCSharp.Size = New System.Drawing.Size(112, 22) + Me.miCSharp.Size = New System.Drawing.Size(180, 22) Me.miCSharp.Text = "CSharp" ' 'miVB ' Me.miVB.Name = "miVB" - Me.miVB.Size = New System.Drawing.Size(112, 22) + Me.miVB.Size = New System.Drawing.Size(180, 22) Me.miVB.Text = "VB" ' 'hTMLToolStripMenuItem ' Me.hTMLToolStripMenuItem.Name = "hTMLToolStripMenuItem" - Me.hTMLToolStripMenuItem.Size = New System.Drawing.Size(112, 22) + Me.hTMLToolStripMenuItem.Size = New System.Drawing.Size(180, 22) Me.hTMLToolStripMenuItem.Text = "HTML" ' 'sQLToolStripMenuItem ' Me.sQLToolStripMenuItem.Name = "sQLToolStripMenuItem" - Me.sQLToolStripMenuItem.Size = New System.Drawing.Size(112, 22) + Me.sQLToolStripMenuItem.Size = New System.Drawing.Size(180, 22) Me.sQLToolStripMenuItem.Text = "SQL" ' 'pHPToolStripMenuItem ' Me.pHPToolStripMenuItem.Name = "pHPToolStripMenuItem" - Me.pHPToolStripMenuItem.Size = New System.Drawing.Size(112, 22) + Me.pHPToolStripMenuItem.Size = New System.Drawing.Size(180, 22) Me.pHPToolStripMenuItem.Text = "PHP" ' 'exportToolStripMenuItem ' Me.exportToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.hTMLToolStripMenuItem1}) Me.exportToolStripMenuItem.Name = "exportToolStripMenuItem" - Me.exportToolStripMenuItem.Size = New System.Drawing.Size(52, 20) + Me.exportToolStripMenuItem.Size = New System.Drawing.Size(53, 20) Me.exportToolStripMenuItem.Text = "Export" ' 'hTMLToolStripMenuItem1 ' Me.hTMLToolStripMenuItem1.Name = "hTMLToolStripMenuItem1" - Me.hTMLToolStripMenuItem1.Size = New System.Drawing.Size(107, 22) + Me.hTMLToolStripMenuItem1.Size = New System.Drawing.Size(106, 22) Me.hTMLToolStripMenuItem1.Text = "HTML" ' 'FontDialog1 @@ -125,12 +127,15 @@ Partial Class PowerfulSample ' 'FastColoredTextBox1 ' + Me.FastColoredTextBox1.AutoCompleteBracketsList = New Char() {Global.Microsoft.VisualBasic.ChrW(40), Global.Microsoft.VisualBasic.ChrW(41), Global.Microsoft.VisualBasic.ChrW(123), Global.Microsoft.VisualBasic.ChrW(125), Global.Microsoft.VisualBasic.ChrW(91), Global.Microsoft.VisualBasic.ChrW(93), Global.Microsoft.VisualBasic.ChrW(34), Global.Microsoft.VisualBasic.ChrW(34), Global.Microsoft.VisualBasic.ChrW(39), Global.Microsoft.VisualBasic.ChrW(39)} + Me.FastColoredTextBox1.AutoIndentCharsPatterns = "" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "^\s*[\w\.\(\)]+\s*(?=)\s*(?.+)" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) Me.FastColoredTextBox1.AutoScrollMinSize = New System.Drawing.Size(158, 15) Me.FastColoredTextBox1.BackBrush = Nothing Me.FastColoredTextBox1.CharHeight = 15 Me.FastColoredTextBox1.CharWidth = 7 Me.FastColoredTextBox1.CommentPrefix = "'" Me.FastColoredTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam + Me.FastColoredTextBox1.DefaultMarkerSize = 8 Me.FastColoredTextBox1.DisabledColor = System.Drawing.Color.FromArgb(CType(CType(100, Byte), Integer), CType(CType(180, Byte), Integer), CType(CType(180, Byte), Integer), CType(CType(180, Byte), Integer)) Me.FastColoredTextBox1.Dock = System.Windows.Forms.DockStyle.Fill Me.FastColoredTextBox1.Font = New System.Drawing.Font("Consolas", 9.75!) @@ -142,9 +147,17 @@ Partial Class PowerfulSample Me.FastColoredTextBox1.Paddings = New System.Windows.Forms.Padding(0) Me.FastColoredTextBox1.RightBracket = Global.Microsoft.VisualBasic.ChrW(41) Me.FastColoredTextBox1.SelectionColor = System.Drawing.Color.FromArgb(CType(CType(50, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.FastColoredTextBox1.ServiceColors = CType(resources.GetObject("FastColoredTextBox1.ServiceColors"), FastColoredTextBoxNS.ServiceColors) Me.FastColoredTextBox1.Size = New System.Drawing.Size(362, 302) Me.FastColoredTextBox1.TabIndex = 0 Me.FastColoredTextBox1.Text = "FastColoredTextBox1" + Me.FastColoredTextBox1.Zoom = 100 + ' + 'assemblyToolStripMenuItem + ' + Me.assemblyToolStripMenuItem.Name = "assemblyToolStripMenuItem" + Me.assemblyToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.assemblyToolStripMenuItem.Text = "Assembly" ' 'PowerfulSample ' @@ -176,5 +189,5 @@ Partial Class PowerfulSample Private WithEvents exportToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem Private WithEvents hTMLToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem Friend WithEvents FontDialog1 As System.Windows.Forms.FontDialog - + Friend WithEvents assemblyToolStripMenuItem As ToolStripMenuItem End Class diff --git a/TesterVB/PowerfulSample.resx b/TesterVB/PowerfulSample.resx index 8ab1dc20..351094c8 100644 --- a/TesterVB/PowerfulSample.resx +++ b/TesterVB/PowerfulSample.resx @@ -123,4 +123,22 @@ 132, 17 + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdGYXN0Q29sb3JlZFRleHRCb3gsIFZlcnNpb249Mi4xNi4yNi4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWZiOGFhMTJiOTk0ZWY2MWIMAwAAAFFTeXN0 + ZW0uRHJhd2luZywgVmVyc2lvbj0yLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu + PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACJGYXN0Q29sb3JlZFRleHRCb3hOUy5TZXJ2aWNlQ29sb3JzBgAA + ACg8Q29sbGFwc2VNYXJrZXJGb3JlQ29sb3I+a19fQmFja2luZ0ZpZWxkKDxDb2xsYXBzZU1hcmtlckJh + Y2tDb2xvcj5rX19CYWNraW5nRmllbGQqPENvbGxhcHNlTWFya2VyQm9yZGVyQ29sb3I+a19fQmFja2lu + Z0ZpZWxkJjxFeHBhbmRNYXJrZXJGb3JlQ29sb3I+a19fQmFja2luZ0ZpZWxkJjxFeHBhbmRNYXJrZXJC + YWNrQ29sb3I+a19fQmFja2luZ0ZpZWxkKDxFeHBhbmRNYXJrZXJCb3JkZXJDb2xvcj5rX19CYWNraW5n + RmllbGQEBAQEBAQUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAA + ABRTeXN0ZW0uRHJhd2luZy5Db2xvcgMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAFFN5c3RlbS5E + cmF3aW5nLkNvbG9yAwAAABRTeXN0ZW0uRHJhd2luZy5Db2xvcgMAAAACAAAABfz///8UU3lzdGVtLkRy + YXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAACgAAAAAA + AAAAlgABAAH7/////P///woAAAAAAAAAAKQAAQAB+v////z///8KAAAAAAAAAACWAAEAAfn////8//// + CgAAAAAAAAAAjQABAAH4/////P///woAAAAAAAAAAKQAAQAB9/////z///8KAAAAAAAAAACWAAEACw== + + \ No newline at end of file diff --git a/TesterVB/PowerfulSample.vb b/TesterVB/PowerfulSample.vb index 115cb5e7..3b2b317b 100644 --- a/TesterVB/PowerfulSample.vb +++ b/TesterVB/PowerfulSample.vb @@ -95,7 +95,7 @@ Public Class PowerfulSample e.ChangedRange.SetFoldingMarkers("/\*", "\*/") 'allow to collapse comment block End Sub - Private Sub miCSharp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles miCSharp.Click, sQLToolStripMenuItem.Click, pHPToolStripMenuItem.Click, miVB.Click, hTMLToolStripMenuItem.Click + Private Sub miCSharp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles miCSharp.Click, sQLToolStripMenuItem.Click, pHPToolStripMenuItem.Click, miVB.Click, hTMLToolStripMenuItem.Click, assemblyToolStripMenuItem.Click 'set language lang = CType(sender, ToolStripMenuItem).Text @@ -113,6 +113,8 @@ Public Class PowerfulSample Case "HTML" : FastColoredTextBox1.Language = Language.HTML Case "SQL" : FastColoredTextBox1.Language = Language.SQL Case "PHP" : FastColoredTextBox1.Language = Language.PHP + Case "Assembly" : FastColoredTextBox1.Language = Language.Assembly + End Select FastColoredTextBox1.OnSyntaxHighlight(New TextChangedEventArgs(FastColoredTextBox1.Range))