added lcl test for synedit

git-svn-id: trunk@9321 -
This commit is contained in:
mattias 2006-05-21 07:58:27 +00:00
parent 3787720bcf
commit 8d4b943024
3 changed files with 130 additions and 0 deletions

2
.gitattributes vendored
View File

@ -2370,6 +2370,8 @@ lcl/tests/test2_1buttonnavigation.lpi svneol=native#text/plain
lcl/tests/test2_1buttonnavigation.lpr svneol=native#text/pascal
lcl/tests/test2_2labelattributes.lpi svneol=native#text/plain
lcl/tests/test2_2labelattributes.lpr svneol=native#text/pascal
lcl/tests/test4_1synedit.lpi svneol=native#text/plain
lcl/tests/test4_1synedit.lpr svneol=native#text/plain
lcl/textstrings.pas svneol=native#text/pascal
lcl/toolwin.pp svneol=native#text/pascal
lcl/translations.pas svneol=native#text/pascal

View File

@ -0,0 +1,46 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="/"/>
<Version Value="5"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=""/>
</General>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="SynEdit"/>
</Item1>
</RequiredPackages>
<Units Count="1">
<Unit0>
<Filename Value="test4_1synedit.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test4_1synedit"/>
</Unit0>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
</CONFIG>

View File

@ -0,0 +1,82 @@
{
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.LCL, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
LCL Test 4_1
Showing a form at 0,0,320,240 with a TSynEdit Align=alClient and a TSynPasSyn.
}
program Test4_1Synedit;
{$mode objfpc}{$H+}
uses
Interfaces, FPCAdds, LCLProc, LCLType, Classes, Controls, Forms, TypInfo,
LMessages, Buttons, ExtCtrls, ComCtrls, SynEdit, SynHighlighterPas,
Graphics;
type
{ TForm1 }
TForm1 = class(TForm)
SynEdit1: TSynEdit;
SynPasSyn1: TSynPasSyn;
procedure Form1Create(Sender: TObject);
public
constructor Create(TheOwner: TComponent); override;
end;
{ TForm1 }
procedure TForm1.Form1Create(Sender: TObject);
begin
debugln('TForm1.Form1Create ',DbgSName(Sender));
SetBounds(50,50,950,700);
SynPasSyn1:=TSynPasSyn.Create(Self);
with SynPasSyn1 do begin
Name:='SynPasSyn1';
CommentAttri.Foreground:=clBlue;
CommentAttri.Style:=[fsBold];
NumberAttri.Foreground:=clBlue;
StringAttri.Foreground:=clBlue;
SymbolAttri.Foreground:=clRed;
DirectiveAttri.Foreground:=clRed;
DirectiveAttri.Style:=[fsBold];
end;
SynEdit1:=TSynEdit.Create(Self);
with SynEdit1 do begin
Name:='SynEdit1';
Align:=alClient;
Highlighter:=SynPasSyn1;
Parent:=Self;
Lines.LoadFromFile('../controls.pp');
end;
end;
constructor TForm1.Create(TheOwner: TComponent);
begin
OnCreate:=@Form1Create;
inherited Create(TheOwner);
end;
var
Form1: TForm1 = nil;
begin
Application.Initialize;
Application.CreateForm(TForm1,Form1);
Application.Run;
end.