unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, SynHighlighterPHP, SynHighlighterHtml,
SynEditHighlighter, SynHighlighterCSS, SynEdit, SynHighlighterIni,
SynHighlighterSQL, SynHighlighterUNIXShellScript, SynHighlighterPython,
SynHighlighterPerl, SynHighlighterBat, SynHighlighterXML,
SynHighlighterVBScript, SynHighlighterJScript, SynHighlighterCpp,
SynHighlighterCS, SynHighlighterVB, SynHighlighterPas, SynHighlighterJava;
type
TForm1 =
class(TForm)
SynEdit1: TSynEdit;
css: TSynCssSyn;
html: TSynHTMLSyn;
php: TSynPHPSyn;
Button1: TButton;
ComboBox1: TComboBox;
OpenDialog1: TOpenDialog;
Button2: TButton;
Button3: TButton;
SaveDialog1: TSaveDialog;
java: TSynJavaSyn;
pas: TSynPasSyn;
vb: TSynVBSyn;
c: TSynCSSyn;
cpp: TSynCppSyn;
js: TSynJScriptSyn;
vbs: TSynVBScriptSyn;
xml: TSynXMLSyn;
bat: TSynBatSyn;
perl: TSynPerlSyn;
python: TSynPythonSyn;
unix: TSynUNIXShellScriptSyn;
sql: TSynSQLSyn;
ini: TSynIniSyn;
procedure ComboBox1Change(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
IF ComboBox1.ItemIndex = 0
THEN Synedit1.Highlighter := css;
IF ComboBox1.ItemIndex = 1
THEN Synedit1.Highlighter :=
html;
IF ComboBox1.ItemIndex = 2
THEN Synedit1.Highlighter := php;
IF ComboBox1.ItemIndex = 3
THEN Synedit1.Highlighter := java;
IF ComboBox1.ItemIndex = 4
THEN Synedit1.Highlighter :=
pas;
IF ComboBox1.ItemIndex = 5
THEN Synedit1.Highlighter := vb;
IF ComboBox1.ItemIndex = 6
THEN Synedit1.Highlighter := c;
IF ComboBox1.ItemIndex = 7
THEN Synedit1.Highlighter := cpp;
IF ComboBox1.ItemIndex = 8
THEN Synedit1.Highlighter := js;
IF ComboBox1.ItemIndex = 9
THEN Synedit1.Highlighter := vbs;
IF ComboBox1.ItemIndex = 10
THEN Synedit1.Highlighter :=
xml;
IF ComboBox1.ItemIndex = 11
THEN Synedit1.Highlighter := bat;
IF ComboBox1.ItemIndex = 12
THEN Synedit1.Highlighter := perl;
IF ComboBox1.ItemIndex = 13
THEN Synedit1.Highlighter := python;
IF ComboBox1.ItemIndex = 14
THEN Synedit1.Highlighter := unix;
IF ComboBox1.ItemIndex = 15
THEN Synedit1.Highlighter :=
sql;
IF ComboBox1.ItemIndex = 16
THEN Synedit1.Highlighter := ini;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
IF OpenDialog1.Execute
THEN
SynEdit1.Lines.LoadFromFile(OpenDialog1.FileName);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
SynEdit1.Lines.SaveToFile(SaveDialog1.FileName);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
end.