Program Control of Screen Updates Under Microsoft Windows

Automatic screen updating of Vermont Views functions is controlled by a global variable, VID_ECHO. This variable is 1 in the Microsoft Windows environment and 0 otherwise. The Vermont Views output functions call the Microsoft Windows Update Video function only when VID_ECHO is TRUE. Thus, automatic updating can be disabled simply by setting VID_ECHO to FALSE.

Two functions, vs_upd() and vs_updrgn(), are provided in the Vermont Views library for calling the Microsoft Windows Update Video function. vs_upd() updates the entire screen. vs_updrgn() updates a specified region of the screen.

To directly control screen updating in a part of your program:

1 Save the value of VID_ECHO (so it can be restored at the end).
2 Set VID_ECHO to FALSE (0) to disable automatic updating.
3 Carry out the procedures for which screen updating is not desired.
4 Restore the original value of VID_ECHO.
5 Issue an Update Video call, using vs_upd() or vs_updrgn(), if the restored value of VID_ECHO is TRUE.

vs_upd() updates the entire screen. vs_updrgn() updates the specified rectangular region on the screen. If you need to update the contents of a window, but not its border and margin area, you should specify the following:

vs_updrgn(wnp->rb, wnp->cb, wnp->re, wnp->ce);

The window structure members rb, cb, re, and ce give the beginning and ending row and column numbers for the interior of the window.

If you need to update the border and margin area of the window also, you should specify the following:

vs_updrgn(wnp->rbf, wnp->cbf, wnp->ref, wnp->cef);

The window structure members rbf, cbf, ref, and cef give the beginning and ending row and column numbers for the entire window, including the border and margins.

If you are using windows with shadows, you may also need to update the part of the screen covered by the shadows. For example, if the shadows are one character wide and on the bottom and to the right of the window, the call to vs_updrgn() would be as follows:

vs_updrgn(wnp->rbf, wnp->cbf, wnp->ref + 1, wnp->cef + 1);


Home Contents Previous Next