Jump to content

GpiSetDefTag: Difference between revisions

From EDM2
Created page with "This function specifies the default value of the primitive tag (see GpiSetTag). ==Syntax== GpiSetDefTag(hps, lTag) ==Parameters== ;hps (HPS) - input :Presentation-space handle. ;lTag (LONG) - input :Default tag identifier. ==Returns== ;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..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function specifies the default value of the primitive tag (see GpiSetTag).  
This function specifies the default value of the primitive tag (see [[GpiSetTag]]).
 
==Syntax==
==Syntax==
  GpiSetDefTag(hps, lTag)
  GpiSetDefTag(hps, lTag)


==Parameters==
==Parameters==
;hps (HPS) - input :Presentation-space handle.  
;hps (HPS) - input :Presentation-space handle.
;lTag (LONG) - input :Default tag identifier.


;lTag (LONG) - input :Default tag identifier.
==Returns==
==Returns==
;rc (BOOL) - returns
;rc (BOOL) - returns:Success indicator.
: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_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_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_MICROPS_FUNCTION (0x20A1): An attempt was made to issue a function that is invalid in a micro presentation space.


==Remarks==
==Remarks==
The primitive tag is reset to its default value at the following times:
The primitive tag is reset to its default value at the following times:
 
* When the presentation space is associated with a device context (see [[GpiAssociate]]).
* When the presentation space is associated with a device context (see GpiAssociate).
* When [[GpiResetPS]] is issued.
* When GpiResetPS is issued.
* When drawing of a chained segment begins or ends (see [[GpiOpenSegment]] and [[GpiCloseSegment]] for more details).
* When drawing of a chained segment begins or ends (see GpiOpenSegment and GpiCloseSegment for more details).  


The initial default value of the primitive tag, when the presentation space is first created, is 0. The default value can be changed by GpiSetDefTag. Changing the default value has an immediate effect on the current primitive tag, if this is currently set to the default value.
The initial default value of the primitive tag, when the presentation space is first created, is 0. The default value can be changed by GpiSetDefTag. Changing the default value has an immediate effect on the current primitive tag, if this is currently set to the default value.
Line 48: Line 44:
#define INCL_GPIPRIMITIVES
#define INCL_GPIPRIMITIVES
#include <OS2.H>
#include <OS2.H>


HPS    hps;    /* Presentation space handle    */
HPS    hps;    /* Presentation space handle    */


GpiSetDefTag(hps, 1L);
GpiSetDefTag(hps, 1L);
</pre>
</pre>



Latest revision as of 10:53, 4 April 2025

This function specifies the default value of the primitive tag (see GpiSetTag).

Syntax

GpiSetDefTag(hps, lTag)

Parameters

hps (HPS) - input
Presentation-space handle.
lTag (LONG) - input
Default tag identifier.

Returns

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.

Remarks

The primitive tag is reset to its default value at the following times:

The initial default value of the primitive tag, when the presentation space is first created, is 0. The default value can be changed by GpiSetDefTag. Changing the default value has an immediate effect on the current primitive tag, if this is currently set to the default value.

Note: There are restrictions on the use of this function when creating SAA-conforming metafiles; see "MetaFile Resolutions" in the Presentation Manager Programming Reference for more information.

Example Code

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

HPS     hps;   /*  Presentation-space handle. */
LONG    lTag;  /*  Default tag identifier. */
BOOL    rc;    /*  Success indicator. */

rc = GpiSetDefTag(hps, lTag);

This function specifies the default value of the primitive tag (see GpiSetTag).

 
#define INCL_GPIPRIMITIVES
#include <OS2.H>

HPS     hps;    /* Presentation space handle     */

GpiSetDefTag(hps, 1L);

Related Functions