Consultor Eletrônico



Kbase 16294: How to code PAGE-UP and PAGE-DOWN in a browse
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
How to code PAGE-UP and PAGE-DOWN in a browse

Prior to Version 7.3, it was possible to apply "PAGE-UP" and
"PAGE-DOWN" events programmatically to a browse widget. This
ability was removed in Version 7.3 to allow for multiple selections
in the browse widget. This ability to programmatically apply
"PAGE-UP" and "PAGE-DOWN" was then added back to the product starting
with Version 8.

If programmers wish to have a page-up or page-down capability in
Version 7.3 they must therefore program it themselves.

For example, if Button-1 is a "Page-down" button, then the CHOOSE
trigger code for Button-1 would look like the following:

DEF VAR i AS INTEGER.
DEF VAR stat AS LOGICAL.

ON "CHOOSE" OF Button-1 IN FRAME Frame-a DO:
DO i = 1 TO Browse-1:DOWN:
stat = Browse-1:SELECT-NEXT-ROW().
END.
END.


Similar code would be required for a "Page-up" functionality. Instead
of using the SELECT-NEXT-ROW() method, the SELECT-PREV-ROW() method
would be used.

This trigger code can be used for any event that the programmer
wishes to use for paging. For example, on "Return" of the browse
a page-down could be executed.

NOTE: Remember to select a row (perhaps using select-focused-row
method) before running these triggers as a row needs to be selected
before running select-next-row() or select-prev-row(). If you do
not do this, then you may receive error 382:
Invalid use of browse method SELECT-PREV-ROW. There are no selected
rows. (382)

Progress Software Technical Support Note # 16294