Enum bookmarks manually

General TRichView support forum. Please post your questions here
Post Reply
Martian
Posts: 95
Joined: Sun Apr 03, 2011 7:32 pm

Enum bookmarks manually

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

Post by Sergey Tkachenko »

The code looks correct.
Please send me a simple project reproducing the problem.
Martian
Posts: 95
Joined: Sun Apr 03, 2011 7:32 pm

Post by Martian »

Works fine. I didn't assign RVStyle to RVE.
Post Reply