GpiQueryTextAlignment: Difference between revisions
Appearance
Created page with "This function returns the current value of the text alignment attribute, as set by the GpiSetTextAlignment function. ==Syntax== GpiQueryTextAlignment(hps, plHoriz, plVert) ==Parameters== ; hps (HPS) - input : Presentation-space handle. ; plHoriz (PLONG) - output : Horizontal alignment. : The horizontal alignment determines character positioning in a text string. The value returned will be one of those described under the GpiSetTextAlignment function...." |
mNo edit summary |
||
| Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
; hps ([[HPS]]) - input | ; hps ([[HPS]]) - input: Presentation-space handle. | ||
: Presentation-space handle. | ; plHoriz ([[PLONG]]) - output: Horizontal alignment. | ||
; plHoriz ([[PLONG]]) - output | |||
: Horizontal alignment. | |||
: The horizontal alignment determines character positioning in a text string. The value returned will be one of those described under the [[GpiSetTextAlignment]] function. | : The horizontal alignment determines character positioning in a text string. The value returned will be one of those described under the [[GpiSetTextAlignment]] function. | ||
; plVert (PLONG) - output: Vertical alignment. | |||
; plVert ( | |||
: Vertical alignment. | |||
: The vertical alignment determines character positioning in a text string. The value returned will be one of those described under the [[GpiSetTextAlignment]] function. | : The vertical alignment determines character positioning in a text string. The value returned will be one of those described under the [[GpiSetTextAlignment]] function. | ||
==Return Value== | ==Return Value== | ||
; rc ([[BOOL]]) - returns | ;rc ([[BOOL]]) - returns: Success indicator. | ||
: Success indicator. | ::TRUE : Successful completion | ||
: | ::FALSE : Error occurred. | ||
: | |||
==Remarks== | ==Remarks== | ||
| Line 30: | Line 22: | ||
==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== | ||
<PRE> | <PRE> | ||
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */ | #define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */ | ||
#include | #include <os2.h> | ||
HPS hps; /* Presentation-space handle. */ | HPS hps; /* Presentation-space handle. */ | ||
Latest revision as of 21:58, 17 November 2025
This function returns the current value of the text alignment attribute, as set by the GpiSetTextAlignment function.
Syntax
GpiQueryTextAlignment(hps, plHoriz, plVert)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- plHoriz (PLONG) - output
- Horizontal alignment.
- The horizontal alignment determines character positioning in a text string. The value returned will be one of those described under the GpiSetTextAlignment function.
- plVert (PLONG) - output
- Vertical alignment.
- The vertical alignment determines character positioning in a text string. The value returned will be one of those described under the GpiSetTextAlignment function.
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. Support for this function is device dependent.
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. */ PLONG plHoriz; /* Horizontal alignment. */ PLONG plVert; /* Vertical alignment. */ BOOL rc; /* Success indicator. */ rc = GpiQueryTextAlignment(hps, plHoriz, plVert);