Problem of Preview Plugin for KeyDown
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?
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
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.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The modification has been completed and the function is working normally.