Jump to content

GpiDeleteSetId

From EDM2

This function deletes a logical font or bit-map tag.

Syntax

GpiDeleteSetId(hps, lLcid)

Parameters

hps (HPS) - input
Presentation-space handle.
lLcid (LONG) - input
Local identifier.
The local identifier (lcid) for the object. It must be in the range of 0 through 254.
If LCID_ALL is specified, all logical fonts are deleted, and all bit-map tagging is removed. If LCID_DEFAULT or LCID_ALL is specified, the original default font is restored if it has been changed (see GpiCreateLogFont).

Return Value

rc (BOOL) - returns
Success indicator.
TRUE
Successful completion
FALSE
Error occurred.

Remarks

If the object is a logical font, it is deleted, and is no longer available for use. If the object is a bit map, it is no longer tagged with the local identifier; the bit map is not deleted and its handle remains valid. In either instance, the lLcid is released and is now available for reuse, unless the object is currently selected (as the current character, pattern, or marker set), in which instance an error is raised. If this function occurs within a path definition when the drawing mode (see GpiSetDrawingMode) is retain or draw-and-retain, its effect is not stored with the definition. Note: This function must not be used when creating SAA-conforming metafiles; see "MetaFile Resolutions" in the Presentation Manager Programming Reference for more information.

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_SETID (0x20CA)
An invalid setid parameter was specified.
PMERR_SETID_NOT_FOUND (0x2103)
An attempt was made to delete a setid that did not exist.
PMERR_SETID_IN_USE (0x2102)
An attempt was made to specify a setid that was already in use as the currently selected character, marker or pattern set.

Example Code

#define INCL_GPILCIDS /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>

HPS     hps;   /* Presentation-space handle. */
LONG    lLcid; /* Local identifier. */
BOOL    rc;    /* Success indicator. */

rc = GpiDeleteSetId(hps, lLcid);

This example uses the GpiDeleteSetId function to delete a logical font. The GpiSetCharSet function is required only if the logical font is the current font for the presentation space.

#define INCL_GPILCIDS /* Font functions */
#define INCL_GPIPRIMITIVES /* GPI primitive functions */
#include <os2.h>

HPS hps; /* presentation space handle */
FATTRS fat;

/* create and set the font */
GpiCreateLogFont(hps, NULL, 1L, &fat);
GpiSetCharSet(hps, 1L);

.
.
.

GpiSetCharSet(hps, 0L); /* release the font before deleting */
GpiDeleteSetId(hps, 1L); /* delete the logical font */

Related Functions