Data Base + HyperText

General TRichView support forum. Please post your questions here
Post Reply
asteblev
Posts: 9
Joined: Mon Jan 01, 2007 4:38 pm

Data Base + HyperText

Post 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;
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Is rvoTagsArePChars included in RichViewEdit1.Options?
asteblev
Posts: 9
Joined: Mon Jan 01, 2007 4:38 pm

Post by asteblev »

Yes, Sergey. rvoTagsArePChars is TRUE.
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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?
asteblev
Posts: 9
Joined: Mon Jan 01, 2007 4:38 pm

Post by asteblev »

Code: Select all

  URL := PChar(RichViewEdit1.GetCurrentTag);
  URL := main.LMDInputDlg1.InputBox('','','') ;
  IF URL<>'' THEN
    BEGIN
      RichViewEdit1.ApplyTextStyle(4);
      SetURLToSelection(URL);
    END;
asteblev
Posts: 9
Joined: Mon Jan 01, 2007 4:38 pm

Post by asteblev »

Sergey, when I use a Action Hyperlink, All is OK. What is the problem?
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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
asteblev
Posts: 9
Joined: Mon Jan 01, 2007 4:38 pm

Post by asteblev »

Yes, Sergey. This Demo is OK.
Post Reply