GpiLabel: Difference between revisions
Appearance
mNo edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
;hps (HPS) - input : Presentation-space handle. | ;hps ([[HPS]]) - input : Presentation-space handle. | ||
;lLabel (LONG) - input : Required label. | ;lLabel ([[LONG]]) - input : Required label. | ||
:No check is made on the value of this parameter. | :No check is made on the value of this parameter. | ||
==Return Code== | ==Return Code== | ||
;rc (BOOL) - returns : Success indicator. | ;rc (BOOL) - returns : Success indicator. | ||
:TRUE Successful completion | :;TRUE | ||
:FALSE Error occurred. | ::Successful completion | ||
:;FALSE | |||
::Error occurred. | |||
===Errors=== | ===Errors=== | ||
Possible returns from WinGetLastError: | 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_MICROPS_FUNCTION (0x20A1): An attempt was made to issue a function that is invalid in a micro presentation space. | |||
;PMERR_INV_IN_ELEMENT (0x2089): An attempt was made to issue a function invalid inside an element bracket. | |||
==Remarks== | ==Remarks== | ||
Line 43: | Line 45: | ||
==Graphic Elements and Orders== | ==Graphic Elements and Orders== | ||
Element Type: OCODE_GLABL | ;Element Type: OCODE_GLABL | ||
:Order: Label | |||
Order: Label | |||
==Related Functions== | ==Related Functions== | ||
*GpiSetElementPointerAtLabel | *[[GpiSetElementPointerAtLabel]] | ||
*GpiSetTag | *[[GpiSetTag]] | ||
[[Category:Gpi]] | [[Category:Gpi]] |
Latest revision as of 23:50, 7 April 2025
This function generates an element containing the specified label.
Syntax
GpiLabel (hps, lLabel)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- lLabel (LONG) - input
- Required label.
- No check is made on the value of this parameter.
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_MICROPS_FUNCTION (0x20A1)
- An attempt was made to issue a function that is invalid in a micro presentation space.
- PMERR_INV_IN_ELEMENT (0x2089)
- An attempt was made to issue a function invalid inside an element bracket.
Remarks
This function has no effect unless a retained segment is being constructed. It is invalid within an element bracket. Duplicate labels within a segment are allowed.
Example Code
This example uses the GpiLabel function to create label elements in a segment. If the segment is subsequently edited, the label elements can still be used to locate the elements near it.
#define INCL_GPISEGEDITING /* GPI Segment Edit functions */ #include <os2.h> HPS hps; /* presentation space handle */ POINTL ptlStart = { 0, 0 }; /* first vertex */ POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 }; /* vertices */ GpiOpenSegment(hps, 4L); /* creates a segment */ GpiLabel(hps, 5L); /* creates label 5 */ GpiLabel(hps, 10L); /* creates label 10 */ GpiMove(hps, &ptlStart); GpiCloseSegment(hps); GpiPolyLine(hps, 3L, ptlTriangle);
Graphic Elements and Orders
- Element Type
- OCODE_GLABL
- Order: Label