PF-Scroll-Panel (Value 10)

Scrolls a rectangular area of a panel.

A rectangle is a specific area within a panel. You can scroll this identified area either up or down by row, or left or right by column.

You must specify certain data items depending on the bit settings in PPB-Update-Mask:

Bit Data Items Needed
0 text-buffer, PPB-Buffer-Offset and PPB-Vertical-Stride.
1 attribute-buffer, PPB-Buffer-Offset and PPB-Vertical-Stride.
2 PPB-Fill-Character.
3 PPB-Fill-Attribute.

Parameters:

attribute-buffer pic x(n).
PPB-Buffer-Offset pic 9(4) comp-x.
PPB-Fill-Attribute pic x.
PPB-Fill-Character pic x.
PPB-Panel-ID pic 9(4) comp-x.
PPB-Scroll-Count pic 9(4) comp-x.
PPB-Scroll-Direction pic 9(2) comp-x.
PPB-Update-Height pic 9(4) comp-x.
PPB-Update-Mask pic x.
PPB-Update-Start-Col pic 9(4) comp-x.
PPB-Update-Start-Row pic 9(4) comp-x.
PPB-Update-Width pic 9(4) comp-x.
PPB-Vertical-Stride pic 9(4) comp-x.
text-buffer pic x(n).

On Entry:

Bit Data Items Needed
attribute-buffer If bit 1 of PPB-Update-Mask is set, specifies the attribute buffer to fill the rectangle from.
PPB-Buffer-Offset If bit 0 of PPB-Update-Mask is set, specifies the position of the first character to display from the text-buffer. If bit 1 of PPB-Update-Mask is set, specifies the position of the first attribute to display from attribute-buffer.
PPB-Fill-Attribute If bit 3 of PPB-Update-Mask is set, specifies the attribute that is to be used to fill the rectangle.
PPB-Fill-Character If bit 2 of PPB-Update-Mask is set, specifies the character that is to be used to fill the rectangle.
PPB-Panel-ID The identifying handle of the panel to be scrolled. This value is returned from a call to PF-Create-Panel.
PPB-Scroll-Count The number of lines to scroll.
PPB-Scroll-Direction The direction of the scrolling:
0
Up
1
Down
2
Left
3
Right
PPB-Update-Height The height of the rectangle to scroll.
PPB-Update-Mask See the section Panels Parameter Block.
PPB-Update-Start-Col The first column of the rectangle to be affected by the scrolling.
PPB-Update-Start-Row The first row of the rectangle to be affected by the scrolling.
PPB-Update-Width The width of the rectangle to scroll.
PPB-Vertical-Stride If bit 0 or 1 of PPB-Update-Mask is set, specifies the length of a line in text-buffer or attribute-buffer.
text-buffer If bit 0 of PPB-Update-Mask is set, specifies the text buffer to fill the rectangle from.

On Exit:

None

Comments:

Panels does not allow you to scroll text and attributes separately.

Example:

A panel has been defined that is 50 characters wide and 15 rows deep. The handle for this panel is saved in the data item ws-save-panel-id.

This example scrolls the text and attributes in the panel up 15 rows and replaces the vacated text with text and attributes from text and attribute buffers. The first 15 lines of the text and attribute buffers are already used (displayed on the screen). Therefore, scrolling starts with the 16th line of the text and attribute buffer (one line in the text and attribute buffers is 50 characters wide).

* Define an update rectangle; that is a block of the panel 
* to scroll. In this case, define the entire panel as the
* rectangle.
       move 50 to ppb-update-width.
       move 15 to ppb-update-height.
* Since the update rectangle is the same size as the panel,
* begin scrolling with line 1, column 1 of the panel (where 
* 0,0 is the top left-hand corner of the panel).
       move 0 to ppb-update-start-row.
       move 0 to ppb-update-start-col.
* The rectangle scrolls up.
       move 0 to ppb-scroll-direction
* Scroll up 15 lines.
       move 15 to ppb-scroll-count.
* The panel is filled with text and attributes from user
* specified buffers. The first 15 lines (each line in the 
* buffer is 50 characters wide) are already displayed. Start
* updating with the 16th line of the buffers. 
* PPB-Buffer-Offset specifies what character of the buffers 
* to begin with (where 1 is the first character). Therefore, 
* start with the 751st character (15 rows times 50 
* characters per row equals 750 characters already on the 
* screen).
       move 751 to ppb-buffer-offset.
* One row of the update rectangle is 50 characters wide.
       move 50 to ppb-vertical-stride.
* Update the vacated portions of the panel using text and
* attribute buffers (set bits 0 and 1 of PPB-Update-Mask) 
* and changes are seen on the screen as the rectangle 
* scrolls in the enabled panel(set bits 4 and 5 of 
* PPB-Update-Mask). x"33" is binary 00110011.
       move x"33" to ppb-update-mask.
* The panel ID was saved in ws-save-panel-id.
       move ws-save-panel-id to ppb-panel-id.
* Scroll the panel. The text buffer is text-buffer and the
* attribute buffer is attribute-buffer.
       move pf-scroll-panel to ppb-function.
       call "PANELS" using panels-parameter-block
       text-buffer
       attribute-buffer
       if ppb-status not = zero
*         (code to abort)