GpiQueryLineType: Difference between revisions
Appearance
Created page with "This function returns the current cosmetic line-type attribute, as set by the GpiSetLineType function. ==Syntax== GpiQueryLineType(hps) ==Parameters== ; hps (HPS) - input : Presentation-space handle. ==Return Value== ; lLineType (LONG) - returns : Line type. :; LINETYPE_DEFAULT (0L) :: Default :; LINETYPE_DOT (1L) :: Dotted line :; LINETYPE_SHORTDASH (2L) :: Short-dashed line :; LINETYPE_DASHDOT (3L) :: Dash-dotted line :; LINETYPE_DOUBLEDOT (4L) :: Doubl..." |
mNo edit summary |
||
| Line 1: | Line 1: | ||
This function returns the current cosmetic line-type attribute, as set by the [[GpiSetLineType]] function. | This function returns the current cosmetic line-type attribute, as set by the [[GpiSetLineType]] function. | ||
| Line 5: | Line 6: | ||
==Parameters== | ==Parameters== | ||
; hps ([[HPS]]) - input | ; hps ([[HPS]]) - input: Presentation-space handle. | ||
: Presentation-space handle. | |||
==Return Value== | ==Return Value== | ||
; lLineType ([[LONG]]) - returns | ; lLineType ([[LONG]]) - returns: Line type. | ||
: Line type. | ::LINETYPE_DEFAULT (0L) : Default | ||
: | ::LINETYPE_DOT (1L) : Dotted line | ||
::LINETYPE_SHORTDASH (2L) : Short-dashed line | |||
: | ::LINETYPE_DASHDOT (3L) : Dash-dotted line | ||
::LINETYPE_DOUBLEDOT (4L) : Double-dotted line | |||
: | ::LINETYPE_LONGDASH (5L) : Long-dashed line | ||
::LINETYPE_DASHDOUBLE_DOT (6L) : Dash-double dotted line | |||
: | ::LINETYPE_SOLID (7L) : Solid line | ||
::LINETYPE_ALTERNATE (9L) : Alternate pale on | |||
: | ::LINETYPE_INVISIBLE (8L): Invisible line | ||
:; LINETYPE_ERROR (-1L):: Error. | |||
: | |||
: | |||
: | |||
: | |||
: | |||
:; LINETYPE_ERROR (-1L) | |||
:: Error. | |||
==Remarks== | ==Remarks== | ||
| Line 39: | Line 27: | ||
==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. | |||
==Example Code== | ==Example Code== | ||
This example uses GpiQueryLineType to return the current cosmetic line-type attribute after setting the draw mode to DRAW. | This example uses GpiQueryLineType to return the current cosmetic line-type attribute after setting the draw mode to DRAW. | ||
<pre> | <pre> | ||
#define INCL_GPIPRIMITIVES /* Primitive functions */ | #define INCL_GPIPRIMITIVES /* Primitive functions */ | ||
#define INCL_GPICONTROL /* Control functions */ | #define INCL_GPICONTROL /* Control functions */ | ||
#include | #include <os2.h> | ||
HPS hps; /* Presentation-space handle */ | HPS hps; /* Presentation-space handle */ | ||
Latest revision as of 22:15, 17 November 2025
This function returns the current cosmetic line-type attribute, as set by the GpiSetLineType function.
Syntax
GpiQueryLineType(hps)
Parameters
- hps (HPS) - input
- Presentation-space handle.
Return Value
- lLineType (LONG) - returns
- Line type.
- LINETYPE_DEFAULT (0L) : Default
- LINETYPE_DOT (1L) : Dotted line
- LINETYPE_SHORTDASH (2L) : Short-dashed line
- LINETYPE_DASHDOT (3L) : Dash-dotted line
- LINETYPE_DOUBLEDOT (4L) : Double-dotted line
- LINETYPE_LONGDASH (5L) : Long-dashed line
- LINETYPE_DASHDOUBLE_DOT (6L) : Dash-double dotted line
- LINETYPE_SOLID (7L) : Solid line
- LINETYPE_ALTERNATE (9L) : Alternate pale on
- LINETYPE_INVISIBLE (8L): Invisible line
- LINETYPE_ERROR (-1L)
- : Error.
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
This example uses GpiQueryLineType to return the current cosmetic line-type attribute after setting the draw mode to DRAW.
#define INCL_GPIPRIMITIVES /* Primitive functions */ #define INCL_GPICONTROL /* Control functions */ #include <os2.h> HPS hps; /* Presentation-space handle */ LONG lLineType; /* Line type */ if (GpiSetDrawingMode(hps, DM_DRAW) == TRUE) lLineType = GpiQueryLineType(hps);