Jump to content

GreScrollRect

From EDM2

GreScrollRect scrolls the contents of the LVB through the DC.

Simulation support
This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.

Syntax

GreScrollRect(hdc, pVioPS, paScrollRect, pInstance, lFunction)

Parameters

hdc (HDC) - input
The device context handle.
pVioPS (VioPresentationSpace *) - input
A pointer to the Vio presentation space.
paScrollRect (LPScrollRectRef) - input
Pointer to parameter block for this function. This block is defined as a SCROLLRECTREF structure:
StartRow Starting row relative to the bottom left of the LVB
StartCol Starting column in the logical video buffer of the character string to be output
RectWidth Width of the scroll rectangle
RectDepth Depth of the scroll rectangle
HorzMovement Number of columns to be scrolled
VertMovement Number of rows to be scrolled
Note
Positive values mean movement downward or to the right, negative values mean upward or to the left.
lpFillCell Pointer to a cell containing the character and attributes to be used for filling the tail of the scroll region. This pointer is only used when GreBitblt is used to implement this function. When this lpFillCell is passed as NULL, the logical video buffer has been updated. The handling routine then must call GreCharRect to update the display.
pInstance (PVOID) - input
A pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreScrollRect.

Returns

rc (LONG) - returns
Return codes.
This function returns a LONG value as an error indicator.
  • NO_ERROR Successful
  • CE_INVALID_PRESENTATION_SPACE Error. For example, this message might be returned as a result of an invalid CellByteSize.

Sample

#define INCL_AVIOP
#include <os2.h>

HDC                   hdc;          /* The device context handle. */
VioPresentationSpace *pVioPS;       /* A pointer to the Vio presentation space. */
LPScrollRectRef       paScrollRect;
PVOID                 pInstance;    /* A pointer to instance data. */
ULONG                 lFunction;    /* High-order WORD=flags; low-order WORD=NGreScrollRect. */
LONG                  rc;           /* Return codes. */

rc = GreScrollRect(hdc, pVioPS, paScrollRect, pInstance, lFunction);

Remarks

The contents of the LVB are not affected by this function. Typically, the presentation driver responds to this call by calling GreCharRect. An alternative approach is to use the horizontal and vertical movement fields to define a new source rectangle in the DC and to use GreBitblt to transfer the bits. When new information is revealed from the LVB as a result of the scroll, the handling routine calls GreCharRect to update the display. This approach provides considerable performance advantages for devices that support GreBitblt.