Yes, you should be able to do this in a descendent preview class that you can register. There is a new key catcher object in the preview which began in RB 7.01. However, if the focus is in the text search or outline controls, then it doesn't work which appears to be a bug we'll work on. If the focus is on any of the other controls of the preview it should work just fine though.
Comments
Yes, you should be able to do this in a descendent preview class that you
can register. There is a new key catcher object in the preview which began
in RB 7.01. However, if the focus is in the text search or outline controls,
then it doesn't work which appears to be a bug we'll work on. If the focus
is on any of the other controls of the preview it should work just fine
though.
unit HotKeyPageUpDown;
interface
uses
Classes, Windows,
ppPreview;
type
TmyHotKeyPageUpDown = class(TppPreview)
public
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
end;
implementation
{ TmyHotKeyPageUpDown}
procedure TmyHotKeyPageUpDown.KeyDown(var Key: Word; Shift: TShiftState);
begin
inherited KeyDown(Key, Shift);
if (Shift = []) and (Key = VK_PRIOR ) then
Report.PreviewForm.Previous;
if(Shift = []) and (Key = VK_NEXT) then
Report.PreviewForm.Next;
end;
initialization
TppPreviewPlugIn.Register(TmyHotKeyPageUpDown);
finalization
TppPreviewPlugIn.UnRegister(TmyHotKeyPageUpDown);
end.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com