GpiQueryMarkerBox
Appearance
This function returns the current value of the marker-box attribute, as set by the GpiSetMarkerBox function.
Syntax
GpiQueryMarkerBox(hps, psizfxSize)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- psizfxSize (PSIZEF) - output
- Size of marker box.
- The size of the marker box is in world coordinates.
- If the marker box is currently set to the default, the default size is returned.
Return Value
- rc (BOOL) - returns
- Success indicator.
- TRUE
- Successful completion
- FALSE
- Error occurred.
Remarks
This function is invalid when the drawing mode (see GpiSetDrawingMode) is set to retain.
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.
Example Code
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */ #include <os2.h> HPS hps; /* Presentation-space handle. */ PSIZEF psizfxSize; /* Size of marker box. */ BOOL rc; /* Success indicator. */ rc = GpiQueryMarkerBox(hps, psizfxSize);
This example uses GpiQueryMarkerBox to return the current marker-box attribute after setting the draw mode to DRAW.
#define INCL_GPIPRIMITIVES /* Primitive functions */ #define INCL_GPICONTROL /* Control functions */ #include <os2.h> BOOL fSuccess; /* success indicator */ HPS hps; /* Presentation-space handle */ SIZEF psizfxSize; /* size of marker-box */ FIXED lWidth; /* marker-box width */ if (GpiSetDrawingMode(hps, DM_DRAW) == TRUE) fSuccess = GpiQueryMarkerBox(hps, &psizfxSize); /* if successful, assign value of marker-box width */ if (fSuccess == TRUE) lWidth = psizfxSize.cx;