GpiQueryViewingLimits: Difference between revisions
Appearance
mNo edit summary |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This function returns the current value of the viewing limits, as set by the GpiSetViewingLimits function. | This function returns the current value of the viewing limits, as set by the [[GpiSetViewingLimits]] function. | ||
==Syntax== | ==Syntax== | ||
GpiQueryViewingLimits (hps, prclLimits) | |||
==Parameters== | ==Parameters== | ||
; hps (HPS) - input : Presentation-space handle. | ;hps (HPS) - input : Presentation-space handle. | ||
; prclLimits (PRECTL) - output : Viewing limits. | ;prclLimits (PRECTL) - output : 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. | ||
==Errors== | ==Errors== | ||
Possible returns from WinGetLastError | Possible returns from WinGetLastError: | ||
:PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified. | |||
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_IN_RETAIN_MODE (0x208C) : An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain. | |||
An attempt was made to access the presentation space from more than one thread simultaneously. | :PMERR_INV_DC_TYPE (0x2060) : An invalid type parameter was specified with [[DevOpenDC]], or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context. | ||
An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or | |||
draw-and-retain. | |||
An invalid type parameter was specified with DevOpenDC, or a function was issued that is invalid for a OD_METAFILE_NOQUERY | |||
device context. | |||
==Remarks== | ==Remarks== | ||
This function is invalid when the drawing mode (see | This function is invalid when the drawing mode (see ''GpiSetDrawingMode'') is set to retain. | ||
==Example Code== | ==Example Code== | ||
Line 44: | Line 29: | ||
#include <OS2.H> | #include <OS2.H> | ||
HPS hps; /* Presentation-space | HPS hps; /* Presentation-space handle. */ | ||
RECTL rclLimits; /* viewing limits. */ | RECTL rclLimits; /* viewing limits. */ | ||
BOOL fSuccess; | BOOL fSuccess; | ||
Line 59: | Line 43: | ||
fSuccess = GpiSetViewingLimits(hps, &rclLimits); | fSuccess = GpiSetViewingLimits(hps, &rclLimits); | ||
</PRE> | </PRE> | ||
[[Category:Gpi]] | [[Category:Gpi]] |
Latest revision as of 22:42, 7 January 2024
This function returns the current value of the viewing limits, as set by the GpiSetViewingLimits function.
Syntax
GpiQueryViewingLimits (hps, prclLimits)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- prclLimits (PRECTL) - output
- 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_IN_RETAIN_MODE (0x208C) : An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain.
- PMERR_INV_DC_TYPE (0x2060) : An invalid type parameter was specified with DevOpenDC, or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context.
Remarks
This function is invalid when the drawing mode (see GpiSetDrawingMode) is set to retain.
Example Code
In this example the model space clipping region width is reduced to 100 if it is greater.
#define INCL_GPITRANSFORMS #include <OS2.H> HPS hps; /* Presentation-space handle. */ RECTL rclLimits; /* viewing limits. */ BOOL fSuccess; fSuccess = GpiQueryViewingLimits(hps, rclLimits); if ((rclLimits.xRight - rclLimits.xLeft) > 100) { rclLimits.xRight = 100; rclLimits.xLeft = 200; } fSuccess = GpiSetViewingLimits(hps, &rclLimits);