Jump to content

GpiQueryViewingLimits: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
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==
Line 14: Line 14:


==Errors==
==Errors==
Possible returns from WinGetLastError
Possible returns from WinGetLastError:
;PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified.
: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_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_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.
: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==
Line 29: Line 29:
#include <OS2.H>
#include <OS2.H>


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

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