Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Problem of Preview Plugin for KeyDown

edited May 2 in General
Viewed
https://rbwiki.digital-metaphors.com/plugins/dialogs/preview-plugin/

// Version 21.02
procedure TMyPreviewPlugin.BeforePreview;
begin
inheritedBeforePreview;
//ShowMessage('PreviewPlugin-BeforePreview');
end;

procedure TMyPreviewPlugin.KeyDown(var Key: Word; Shift: TShiftState);
begin
inherited KeyDown(Key, Shift);

//ShowMessage('PreviewPlugin-KeyDown');

if (Shift=[]) and (Key=VK_PRIOR) then begin
Report.PreviewForm.Previous; // -> Must press [ctrl]+[Page-Up]
end;
if (Shift=[]) and (Key=VK_NEXT) then begin
Report.PreviewForm.Next; // -> Must press [ctrl]+[Page-Up]
end;

How can I make only Key Page-Up and Page-Down work properly?

Comments

  • Hi Andy,

    Take a look at the existing TppCustomPreview.KeyDown routine in the ppPreview.pas file.

    1. If you are trying to override the default behavior, be sure to remove the inherited call.

    2. Use the PerformPreviewAction routine to move between pages.
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • thank you.
    The modification has been completed and the function is working normally.
Sign In or Register to comment.