GUI ScreenIO for Windows |
A listview-START-AT event is returned when the listview needs you to provide records beginning at a specified percentage into the file.
It occurs when the user drags the scrollbar thumb significantly beyond the beginning or end of the data already loaded to the listview.
In panel-3 area | Data |
listview-START-AT-PERCENT | The position of the scrollbar thumb as a percentage along the scrollbar. |
In panel-3 area | Data |
listview-MAX | Maximum number records that may be passed in the listview buffer, useful for PERFORMed loops when loading records to your listview buffer. |
listview-SCROLL-TO-KEY | Set to HIGH-VALUES. |
listview-SEL1-KEY | The value of the invisible key column for the first selected record in the list. |
listview-SEL2-KEY | The value of the invisible key column for the last
selected record record in the list.
Note: Since GUI ScreenIO does not presently support a selection range (multiple record selections), this field is always the same as listview-SEL1-KEY. |
listview-TOP-OF-LIST-KEY | The value of the invisible key column for the first (top) record that is visible in the listview control. |
All other fields | Set to LOW-VALUES. |
In panel-4 area | Data |
listview | Number of items in the list that are selected. |
Position the file to that percentage along the keypath, then load the listview as you would for a listview-GET-NEXT.
PERFORM WITH TEST AFTER
CALL 'GS' USING panel-1
END-PERFORM. |
Here's the general form of the performed routine that positions the file and loads the listview buffer. The PERFORMed routine BROWSE-FORWARD is also used to load the listview the first time and in response to a listview-GET-NEXT event.
START-AT-PERCENT.
|
Suppose your file consists of a million records and the user dragged the scrollbar thumb to the halfway mark. If you load the listview sequentially you'd need to read 500,000(!) records before you'd have loaded the data the user wanted.
The listview-START-AT event allows you to go directly to the desired records and load the data on demand. This gives great performance when browsing very large databases, plus it uses memory very efficiently (which also improves performance).
GUI ScreenIO only returns a listview-START-AT event when the scrollbar thumb is dragged some distance beyond the current position. If the thumb is only dragged a small amount, you will receive listview-GET-NEXT event(s) instead of a listview-START-AT event.
The listview implementation requires that you be able to position the file to a percentage along the keypath, and that you be able to supply this percentage with each record loaded to the listview.
Go here for a complete discussion of percentages with respect to using listviews, and one technique of synthesizing percentages for file systems (like ISAM) which do not provide them.
When you respond to a listview-START-AT event, GUI ScreenIO discards previously cached records for this listview and begins caching from this new point in the list.
© 2000-2019 Norcom, all rights reserved |