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

Moving between pages with PageUp / PageDown

edited October 2003 in General
Is there anyway to make the report viewer move between pages when the user
pressed either the PageUp or PageDown keys?

David

Comments

  • edited October 2003
    Hi David,

    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.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.