From 8d4b943024ceea10ecd64c273e14ba373eee3a51 Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 21 May 2006 07:58:27 +0000 Subject: [PATCH] added lcl test for synedit git-svn-id: trunk@9321 - --- .gitattributes | 2 + lcl/tests/test4_1synedit.lpi | 46 ++++++++++++++++++++ lcl/tests/test4_1synedit.lpr | 82 ++++++++++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 lcl/tests/test4_1synedit.lpi create mode 100644 lcl/tests/test4_1synedit.lpr diff --git a/.gitattributes b/.gitattributes index b3ee0a9c01..143113a45f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/lcl/tests/test4_1synedit.lpi b/lcl/tests/test4_1synedit.lpi new file mode 100644 index 0000000000..6c2449edc5 --- /dev/null +++ b/lcl/tests/test4_1synedit.lpi @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lcl/tests/test4_1synedit.lpr b/lcl/tests/test4_1synedit.lpr new file mode 100644 index 0000000000..da65dfed28 --- /dev/null +++ b/lcl/tests/test4_1synedit.lpr @@ -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. +