WPCubed Product Support

How to show the page corresponding to a click on a thumbnail

Hi:

With a TWPRichText control I need to click on a thumbnail when LayouMode is wpThumbNailView, change to LayoutMode and show the corresponding page where the click was made.

If the click was made over some text I want to position the cursor at the same place. If the click was made over areas with no text -or page numbers- I want the cursor positioned at the beggining of the corresponding page.

I am using the following code, but it doesn't work:

procedure TForm1.WPRichTextClick(Sender: TWPCustomRtfEdit; PageNo, X, Y: Integer; var Ignore: Boolean);
begin
  if ( Sender.LayoutMode = wpThumbNailView ) then begin
     Sender.LayoutMode := wplayLayout;
     Sender.ScrollToPosition(Sender.CPPosition, X, Y);
  end; // if ...
end;

Kind regards,

Carlos Borrero

#1 ♥ 0
3.6k Views 2 users read 1 min
support

Hi,
Did you try this?

procedure TWPTBXForm.WPRichText1Click(Sender: TWPCustomRtfEdit; PageNo, X,
Y: Integer; var Ignore: Boolean);
begin
WPRichText1.LayoutMode := wplayFullLayout;
end;

#2 ♥ 0
This category is archived. No new posts are possible.