git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5302 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
gbamber
2016-11-03 12:59:44 +00:00
parent 1e7013f67b
commit 4ca7a5e80b
2 changed files with 9 additions and 20 deletions

View File

@ -254,31 +254,20 @@ begin
//skip empty lines
if Length(s) > 0 then
begin
//check for url
if (Pos('http://', s) <> 0)
OR (Pos('https://', s) <> 0)
OR (Pos('mailto:', s) <> 0) then
begin
FBuffer.Canvas.Font := FLinkFont;
if i = FActiveLine then FBuffer.Canvas.Font.Style := FBuffer.Canvas.Font.Style+[fsUnderline];
end;
//check for bold format token
if s[1] = '#' then
begin
s := copy(s, 2, Length(s) - 1);
FBuffer.Canvas.Font.Style := [fsBold];
end;
begin
//check for url
if (Pos('http://', s) <> 0)
OR (Pos('https://', s) <> 0)
OR (Pos('mailto:', s) <> 0) then
begin
FBuffer.Canvas.Font := FLinkFont;
if i = FActiveLine then
begin
FBuffer.Canvas.Font.Style := FBuffer.Canvas.Font.Style+[fsUnderline];
//FBuffer.Canvas.Font.Color := clRed;
end
else
//FBuffer.Canvas.Font.Color := clBlue;
end
else FBuffer.Canvas.Font := FFont;
end;
w := FBuffer.Canvas.TextWidth(s);
FBuffer.Canvas.TextOut((FBuffer.Width - w) div 2, FOffset + i * FLineHeight, s);
end;

View File

@ -14,7 +14,7 @@
</CompilerOptions>
<Description Value="Graphic surface that scrolls (when Active=True) that can be loaded with a Stringlist"/>
<License Value="LGPL"/>
<Version Major="1" Minor="1"/>
<Version Major="1" Minor="1" Release="1"/>
<Files Count="2">
<Item1>
<Filename Value="scrollingtext.pas"/>