Page 1 of 1

Data Base + HyperText

Posted: Fri Jan 05, 2007 6:01 pm
by asteblev
Hi Sergey. I have a problem when I load the data with hypertext from DB. All text and hupertext with formaing are right, but all links are corruped(OnJump: id=0; and

Code: Select all

RichViewEdit1.GetJumpPointLocation(id, RVData, ItemNo);
  URL := PChar(RVData.GetItemTag(ItemNo));
RETURNS '';

code:

(LOAD)

Code: Select all

procedure TSecond.RichViewEdit1Jump(Sender: TObject; id: Integer);
var URL: String;
    RVData: TCustomRVFormattedData;
    ItemNo: Integer;
begin
  RichViewEdit1.GetJumpPointLocation(id, RVData, ItemNo);
  URL := PChar(RVData.GetItemTag(ItemNo));
  ShellExecute(0, 'open', PChar(URL), nil, nil, SW_SHOW);
end;

Posted: Mon Jan 08, 2007 11:39 am
by Sergey Tkachenko
Is rvoTagsArePChars included in RichViewEdit1.Options?

Posted: Mon Jan 08, 2007 12:06 pm
by asteblev
Yes, Sergey. rvoTagsArePChars is TRUE.

Posted: Tue Jan 09, 2007 12:31 pm
by Sergey Tkachenko
If this code assigns empty string to URL, this means that hypertext target was not stored in tag.
How do you insert hyperlinks?

Posted: Wed Jan 10, 2007 9:51 am
by asteblev

Code: Select all

  URL := PChar(RichViewEdit1.GetCurrentTag);
  URL := main.LMDInputDlg1.InputBox('','','') ;
  IF URL<>'' THEN
    BEGIN
      RichViewEdit1.ApplyTextStyle(4);
      SetURLToSelection(URL);
    END;

Posted: Wed Jan 10, 2007 12:21 pm
by asteblev
Sergey, when I use a Action Hyperlink, All is OK. What is the problem?

Posted: Wed Jan 10, 2007 2:13 pm
by Sergey Tkachenko
Probably there is something wrong with SetURLToSelection. Is it taken from the demos Demos\Delphi\Assorted\Hypertext\CreateHyperlink\ ?
As far as I remember, there was a bug in older version of this demo, it should be fixed now.

But I recommend to use the more advanced demo as a base for hyperlink creation: http://www.trichview.com/forums/viewtopic.php?t=61

Posted: Thu Jan 11, 2007 9:24 am
by asteblev
Yes, Sergey. This Demo is OK.