trichview.com

trichview.support




Re: Tags in DBRichViewEdit lost!


Return to index


Author

Message

Sergey Tkachenko

Posted: 06/11/2004 22:52:10


In RTF, tags can be saved only for hyperlinks.

You need to process OnWriteHyperlink and OnReadHyperlink event.


If you want to save tags as hyperlinks targets without changes:


// Importing hyperlink from RTF

procedure TForm3.RichViewEdit1ReadHyperlink(Sender: TCustomRichView;

  const Target, Extras: String; DocFormat: TRVLoadFormat; var StyleNo,

  ItemTag: Integer; var ItemName: String);

begin

  ItemTag := Integer(StrNew(PChar(Target)));

end;


// Exporting hyperlink to RTF and HTML

procedure TForm3.RichViewEdit1WriteHyperlink(Sender: TCustomRichView;

  id: Integer; RVData: TCustomRVData; ItemNo: Integer;

  SaveFormat: TRVSaveFormat; var Target, Extras: String);

begin

  Target := PChar(RVData.GetItemTag(ItemNo));

end;




> Hello,

>

> I have the following program.

>

> I use DBRichViewEdit

> rvoTagsAsPChars in Options

> FieldFormat = rvdbRTF

>

> I insert a new tag

>   DBRichViewEdit1.AddNLTag('test', 0, -1, Integer(StrNew('_TEST_')));

>   DBRichViewEdit1.Format;

>

> And search for that tag :

>

>   for i := 0 to DBRichViewEdit1.RVData.ItemCount - 1 do

>     if DBRichViewEdit1.RVData.GetItemStyle(i) >= 0 then

>        ShowMessage('Found tag "' +

> PChar(DBRichViewEdit1.RVData.GetItemTag(i)) + '"');

>

> When I set the FieldFormat to rvdRVF then the tag is found and everything

is

> OK

>

> BUT when use rvdRTF the tag is not found.

>

> Is it possible that saving in RTF format in the DB to "chop" the tags?

>

> Any comment will be appreciated.

>

> Gad D Lord

>

>





Powered by ABC Amber Outlook Express Converter