Jump to content

GpiLabel

From EDM2
Revision as of 17:02, 1 March 2017 by Ak120 (talk | contribs)

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

Related Functions

  • GpiSetElementPointerAtLabel
  • GpiSetTag