trichview.com

trichview.support




Re: Maybe a bug this time


Return to index


Author

Message

s2o

Posted: 03/13/2002 1:50:00


> By the way, there is an example for applying hypertext style to URLs in

> Demos\Delphi\Assorted\URLs\


Thanks, i take a look !


> If implemented correctly, using SetSelectionBounds after SearchText will

be

> efficient (and I think it will not cause flicker). Do not forget to call

> Invalidate after SetSelectionBounds.


I think maybe it's a bug, to reproduce it, please, just open a new project,

put a button on it and copy past the src below.

The Search function only find 3 of 4 url's. The second url is always not

found. Omitted parameters or bug ? Thanks


//in head project

var

  Form1: TForm1;

  rve: TRichViewEdit;


//in the body

procedure TForm1.Button1Click(Sender: TObject);

Var SrchOptions: TRVESearchOptions;

begin


SrchOptions := [rvseoDown];

rve.Delimiters:= ' ;,(){}"';

rve.AddNL('a http://www.test.com and http://www.test.net new

http://www.test.org url http://www.test.fr ok', 1, -1);

rve.FormatTail;


while rve.SearchText('http://',SrchOptions) do begin

   rve.SelectCurrentWord;

   rve.ApplyTextStyle(3); //Basic style with red color

end;


end;


procedure TForm1.FormCreate(Sender: TObject);

begin

rve := TRichViewEdit.Create(Form1);

rve.Parent := Form1;

rve.Style := Form1.RVStyle1;

rve.Top := 1;

rve.Width := 400;

rve.Height := 150;

rve.Visible := True;

end;


procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);

begin

rve.Free;

end;






Powered by ABC Amber Outlook Express Converter