Page 1 of 1

Enum bookmarks manually

Posted: Wed Dec 21, 2016 9:16 am
by Martian
Please help me fill my ComboBox with checkpoints from RVE.
I checked BookmarkRVFrm.pas from Actions and did almost everything like there but it doesn't work. My EnumCheckpoints procedure never fires but I have several bookmarks in my document.

First of all I need to load my RVF from DB to a new empty RV.
I didn't even use RVStyle, just created TRichView and loaded from stream.

Code: Select all

type
  TCheckpointLocation = class
   public
      RVData: TCustomRVData;
      ItemNo: Integer;
   end;

Code: Select all

rve:=TRichView.Create(nil);
...
rve.LoadRVFFromStream(TmpStream);
rve.Format;
...
v:=0;
rve.RVData.EnumItems(EnumCheckpoints,v,'');
...
rve.Free;
rve.RVData.EnumItems always return True;
My EnumCheckpoints:

Code: Select all

procedure EnumCheckpoints(RVData: TCustomRVData; ItemNo: Integer; var UserData1: Integer; const UserData2: String; var ContinueEnum: Boolean);
var Loc: TCheckpointLocation;
    CP:  TCheckpointData;
    RaiseEvent :Boolean;
    Tag: TRVTag;
    Name: String;
begin
  CP:=RVData.GetItemCheckpoint(ItemNo);
  if CP<>nil then begin
    Loc:=TCheckpointLocation.Create;
    Loc.RVData:=RVData.GetSourceRVData;
    Loc.ItemNo:=ItemNo;
    RVData.GetCheckpointInfo(CP, Tag, Name, RaiseEvent);

    // Here I just want to fill ComboBox with bookmark names to use in URL after #
    BookmarksCombo.Items.Append(Name);
  end;
end;

Posted: Wed Dec 21, 2016 9:35 am
by Sergey Tkachenko
The code looks correct.
Please send me a simple project reproducing the problem.

Posted: Thu Dec 22, 2016 7:46 am
by Martian
Works fine. I didn't assign RVStyle to RVE.