GpiSetDefViewingLimits: Difference between revisions
Appearance
mNo edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
This function specifies the default value of the viewing limits (see GpiSetViewingLimits). | This function specifies the default value of the viewing limits (see [[GpiSetViewingLimits]]). | ||
==Syntax== | ==Syntax== | ||
GpiSetDefViewingLimits(hps, prclLimits) | |||
==Parameters== | ==Parameters== | ||
; hps (HPS) - input : Presentation-space handle. | ;hps (HPS) - input : Presentation-space handle. | ||
;prclLimits (PRECTL) - input : Default viewing limits. | |||
; prclLimits (PRECTL) - input : Default viewing limits. | |||
==Return Code== | ==Return Code== | ||
; rc (BOOL) - returns : Success indicator. | ;rc (BOOL) - returns : Success indicator. | ||
* TRUE Successful completion | * TRUE Successful completion | ||
* FALSE Error occurred. | * FALSE Error occurred. | ||
Line 25: | Line 15: | ||
==Errors== | ==Errors== | ||
Possible returns from WinGetLastError | Possible returns from WinGetLastError | ||
;PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified. | |||
;PMERR_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously. | |||
;PMERR_INV_COORDINATE (0x205B) : An invalid coordinate value was specified. | |||
==Remarks== | ==Remarks== | ||
The viewing limits are reset to their default value at the following times: | 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 the presentation space is associated with a device context (see GpiAssociate). | |||
* When GpiResetPS is issued. | * When GpiResetPS is issued. | ||
* When drawing of a chained segment begins or ends (see GpiOpenSegment and GpiCloseSegment for more details). | * 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. | |||
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. | |||
Presentation Manager Programming Reference for more information. | |||
==Example Code== | ==Example Code== |
Latest revision as of 19:33, 14 April 2020
This function specifies the default value of the viewing limits (see GpiSetViewingLimits).
Syntax
GpiSetDefViewingLimits(hps, prclLimits)
Parameters
- 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.
Errors
Possible returns from WinGetLastError
- PMERR_INV_HPS (0x207F)
- An invalid presentation-space handle was specified.
- PMERR_PS_BUSY (0x20F4)
- An attempt was made to access the presentation space from more than one thread simultaneously.
- PMERR_INV_COORDINATE (0x205B)
- An invalid coordinate value was specified.
Remarks
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.
#define INCL_GPIPRIMITIVES #include <OS2.H> HPS hps; /* Presentation-space */ /* handle. */ RECTL rclLimits; /* viewing limits. */ rclLimits.xRight = 100; rclLimits.xLeft = 100; GpiSetDefViewingLimits(hps, &rclLimits);