Jump to content

GpiQueryViewingLimits: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Line 2: Line 2:


==Syntax==
==Syntax==
<PRE>
GpiQueryViewingLimits (hps, prclLimits)
#define INCL_GPITRANSFORMS /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>


HPS hps; /* Presentation-space handle. */
PRECTL prclLimits; /* Viewing limits. */
BOOL rc; /* Success indicator. */
rc = GpiQueryViewingLimits(hps, prclLimits);
</PRE>
==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.
Line 23: Line 15:
==Errors==
==Errors==
Possible returns from WinGetLastError
Possible returns from WinGetLastError
; PMERR_INV_HPS (0x207F) :  
;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_PS_BUSY (0x20F4) :  
; 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.
; 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==
==Remarks==
This function is invalid when the drawing mode (see [[GpiSetDrawingMode]]) is set to retain.
This function is invalid when the drawing mode (see [[GpiSetDrawingMode]]) is set to retain.


==Example Code==
==Example Code==
Line 59: Line 44:
fSuccess = GpiSetViewingLimits(hps, &rclLimits);
fSuccess = GpiSetViewingLimits(hps, &rclLimits);
</PRE>
</PRE>


[[Category:Gpi]]
[[Category:Gpi]]

Revision as of 02:42, 26 February 2017

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);