From EDM2
Jump to: navigation, search

This function specifies the default value of the viewing limits (see GpiSetViewingLimits).


GpiSetDefViewingLimits(hps, prclLimits)


hps (HPS) - input 
Presentation-space handle.
prclLimits (PRECTL) - input 
Default viewing limits.

Return Code

rc (BOOL) - returns 
Success indicator.
  • TRUE Successful completion
  • FALSE Error occurred.


Possible returns from WinGetLastError

An invalid presentation-space handle was specified.
An attempt was made to access the presentation space from more than one thread simultaneously.
An invalid coordinate value was specified.


The viewing limits are reset to their default value at the following times:

  • When the presentation space is associated with a device context (see GpiAssociate).
  • When GpiResetPS is issued.
  • When drawing of a chained segment begins or ends (see GpiOpenSegment and GpiCloseSegment for more details).

The initial default value of the viewing limits, when the presentation space is first created, is no clipping. The default value can be changed by GpiSetDefViewingLimits. Changing the default values has an immediate effect on the current viewing limits, if these are currently set to the default value.

Note: There are restrictions on the use of this function when creating SAA-conforming metafiles; see "MetaFile Resolutions" in the Presentation Manager Programming Reference for more information.

Example Code

In this example the default model space clipping region width is set to 100.

#include <OS2.H>

HPS hps;            /* Presentation-space */
                    /* handle. */
RECTL rclLimits;    /* viewing limits. */

rclLimits.xRight = 100;
rclLimits.xLeft = 100;

GpiSetDefViewingLimits(hps, &rclLimits);

Related Functions