unit demoUnit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ComCtrls, psvHTMLRTF, psvPas, psvSQL, psvPHPSCript, psvVBScript, psvJScript,
  psvDFM, psvXML, psvVB;

type
  TfrmDemo = class(TForm)
    PageControl: TPageControl;
    tsDelphi: TTabSheet;
    tsHTML: TTabSheet;
    tsSQL: TTabSheet;
    edDelphi: TRichEdit;
    edHTML: TRichEdit;
    edSQL: TRichEdit;
    tsPHP: TTabSheet;
    edPHP: TRichEdit;
    tsVBScript: TTabSheet;
    edVBScript: TRichEdit;
    tsJScript: TTabSheet;
    edJScript: TRichEdit;
    tsDFM: TTabSheet;
    edDFM: TRichEdit;
    tsXML: TTabSheet;
    edXML: TRichEdit;
    tsVB: TTabSheet;
    edVB: TRichEdit;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    PasSyn  : TpsvPasRTF;
    SQLSyn  : TpsvSQLRTF;
    HTMLSyn : TpsvHTMLRTF;
    PHPSyn  : TpsvPHPRTF;
    VBScriptSyn : TpsvVBScriptRTF;
    JScriptSyn : TpsvJScriptRTF;
    DFMSyn : TpsvDFMRTF;
    XMLSyn : TpsvXMLRTF;
    VBSyn : TpsvVBRTF;
  end;

var
  frmDemo: TfrmDemo;

implementation




{$R *.DFM}

procedure TfrmDemo.FormCreate(Sender: TObject);
var
 A : TMemoryStream;
begin
   PasSyn := TpsvPasRTF.Create;
   PasSyn.Settext(edDelphi.Text);
   A := TMemoryStream.Create;
   PasSyn.ConvertToRTFStream(A);
   edDelphi.PlainText := false;
   A.Position := 0;
   edDelphi.Lines.LoadFromStream(A);
   edDelphi.PlainText := true;
   A.Free;
   PasSyn.Free;

   SQLSyn := TpsvSQLRTF.Create;
   SQLSyn.SetText(edSQL.Text);
   A := TMemoryStream.Create;
   SQLSyn.ConvertToRTFStream(A);
   edSQL.PlainText := false;
   A.Position := 0;
   edSQL.Lines.LoadFromStream(A);
   edSQL.PlainText := true;
   A.Free;
   SQLSyn.Free;

   HTMLSyn := TpsvHTMLRTF.Create;
   HTMLSyn.SetText(edHTML.Text);
   A := TMemoryStream.Create;
   HTMLSyn.ConvertToRTFStream(A);
   edHTML.PlainText := false;
   A.Position := 0;
   edHTML.Lines.LoadFromStream(A);
   edHTML.PlainText := true;
   A.Free;
   HTMLSyn.Free;

   PHPSyn := TpsvPHPRTF.Create;
   PHPSyn.SetText(edPHP.Text);
   A := TMemoryStream.Create;
   PHPSyn.ConvertToRTFStream(A);
   edPHP.PlainText := false;
   A.Position := 0;
   edPHP.Lines.LoadFromStream(A);
   edPHP.PlainText := true;
   A.Free;
   PHPSyn.Free;



   VBScriptSyn := TpsvVBScriptRTF.Create;
   VBScriptSyn.SetText(edVBScript.Text);
   A := TMemoryStream.Create;
   VBScriptSyn.ConvertToRTFStream(A);
   edVBScript.PlainText := false;
   A.Position := 0;
   edVBScript.Lines.LoadFromStream(A);
   edVBScript.PlainText := true;
   A.Free;
   VBScriptSyn.Free;


   JScriptSyn := TpsvJScriptRTF.Create;
   JScriptSyn.SetText(edJScript.Text);
   A := TMemoryStream.Create;
   JScriptSyn.ConvertToRTFStream(A);
   edJScript.PlainText := false;
   A.Position := 0;
   edJScript.Lines.LoadFromStream(A);
   edJScript.PlainText := true;
   A.Free;
   JScriptSyn.Free;

   DFMSyn := TpsvDFMRTF.Create;
   DFMSyn.SetText(edDFM.Text);
   A := TMemoryStream.Create;
   DFMSyn.ConvertToRTFStream(A);
   edDFM.PlainText := false;
   A.Position := 0;
   edDFM.Lines.LoadFromStream(A);
   edDFM.PlainText := true;
   A.Free;
   DFMSyn.Free;

   XMLSyn := TpsvXMLRTF.Create;
   XMLSyn.SetText(edXML.Text);
   A := TMemoryStream.Create;
   XMLSyn.ConvertToRTFStream(A);
   edXML.PlainText := false;
   A.Position := 0;
   edXML.Lines.LoadFromStream(A);
   edXML.PlainText := true;
   A.Free;
   XMLSyn.Free;


   VBSyn := TpsvVBRTF.Create;
   VBSyn.SetText(edVB.Text);
   A := TMemoryStream.Create;
   VBSyn.ConvertToRTFStream(A);
   edVB.PlainText := false;
   A.Position := 0;
   edVB.Lines.LoadFromStream(A);
   edVB.PlainText := true;
   A.Free;
   VBSyn.Free;

end;

end.
