diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/apps/ide/src/frm_main.pas | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/examples/apps/ide/src/frm_main.pas b/examples/apps/ide/src/frm_main.pas index 0b221f6c..6c1ffb8c 100644 --- a/examples/apps/ide/src/frm_main.pas +++ b/examples/apps/ide/src/frm_main.pas @@ -167,7 +167,8 @@ const cString1 = '''.*'''; cDecimal = '\b(([0-9]+)|([0-9]+\.[0-9]+([Ee][-]?[0-9]+)?))\b'; - cHexidecimal = '\b\$[0-9a-fA-F]*\b'; + cHexadecimal = '\$[0-9a-fA-F]+'; + {@VFD_NEWFORM_IMPL} @@ -762,6 +763,23 @@ begin until not FRegex.ExecNext; end; + { syntax highlighting for: cHexadecimal } + ACanvas.TextColor := clMagenta; + FRegex.Expression := cHexadecimal; + if FRegex.Exec(ALineText) then + begin + repeat + lMatchPos := FRegex.MatchPos[0]; + lOffset := FRegex.MatchLen[0]; + s := FRegex.Match[0]; + j := Length(s); + r.SetRect(ATextRect.Left + (edt.FontWidth * (lMatchPos-1)), ATextRect.Top, + (edt.FontWidth *j), ATextRect.Height); + ACanvas.FillRectangle(r); + ACanvas.DrawText(r, s); + until not FRegex.ExecNext; + end; + { syntax highlighting for: comments2 } ACanvas.TextColor := clDarkCyan; FRegex.Expression := cComments2; |