Jump to content

GreSetGlobalAttribute: Difference between revisions

From EDM2
Created page with "GreSetGlobalAttribute sets the specified attribute in the pen, pattern, character, image, and marker bundles. This function is supported by the graphics engine. ==Syntax==..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreSetGlobalAttribute sets the specified attribute in the pen, pattern, character, image, and marker bundles.  
GreSetGlobalAttribute sets the specified attribute in the pen, pattern, character, image, and marker bundles.


This function is supported by the graphics engine.  
This function is supported by the graphics engine.


==Syntax==
==Syntax==
  GreSetGlobalAttribute(hdc, lAttrType, lAttribute, flOptions, pInstance, lFunction);
  GreSetGlobalAttribute(hdc, lAttrType, lAttribute, flOptions, pInstance, lFunction)
 
==Parameters==
==Parameters==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;lAttrType (LONG) - input:Specifies the attribute type.
 
:Attribute types:
;lAttrType (LONG) - input  
::ATYPE_COLOR Foreground color
:Specifies the attribute type.  
::ATYPE_BACK_COLOR Background color
 
::ATYPE_MIX_MODE Foreground mix
:Attribute types:  
::ATYPE_BACK_MIX_MODE Background mix
 
:Note: ATYPE_BACK_COLOR and ATYPE_BACK_MIX_MODE do not apply to the line bundle.
::ATYPE_COLOR Foreground color  
;lAttribute (LONG) - input:New attribute value.
::ATYPE_BACK_COLOR Background color  
;flOptions (ULONG) - input:The only allowable option flag is GATTR_DEFAULT, which specifies that the attribute indicated by lAttrType should be set to its default value. If the GATTR_DEFAULT flag is not set, the function sets the attribute to the value specified by lAttribute.
::ATYPE_MIX_MODE Foreground mix  
;pInstance (PVOID) - input:Pointer to instance data.
::ATYPE_BACK_MIX_MODE Background mix  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreSetGlobalAttribute.
 
:Note: ATYPE_BACK_COLOR and ATYPE_BACK_MIX_MODE do not apply to the line bundle.  
 
;lAttribute (LONG) - input  
:New attribute value.  
 
;flOptions (ULONG) - input  
:The only allowable option flag is GATTR_DEFAULT, which specifies that the attribute indicated by lAttrType should be set to its default value. If the GATTR_DEFAULT flag is not set, the function sets the attribute to the value specified by lAttribute.  
 
;pInstance (PVOID) - input  
:Pointer to instance data.  


;lFunction (ULONG) - input
:High-order WORD=flags; low-order WORD=NGreSetGlobalAttribute.
==Return Code==
==Return Code==
;fSuccess (BOOL) - returns  
;fSuccess (BOOL) - returns:Return codes.
:Return codes.  
:On completion, the handling routine must return BOOLEAN (fSuccess).
 
:*TRUE Successful
:On completion, the handling routine must return BOOLEAN (fSuccess).  
:*FALSE Error
 
:Possible Errors Detected: When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:
:*TRUE Successful  
:*PMERR_DEV_FUNC_NOT_INSTALLED
:*FALSE Error  
:*PMERR_HDC_BUSY
 
:*PMERR_INV_BACKGROUND_COL_ATTR
:Possible Errors Detected:   When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:  
:*PMERR_INV_BACKGROUND_MIX_ATTR
 
:*PMERR_INV_COLOR_ATTR
:*PMERR_DEV_FUNC_NOT_INSTALLED  
:*PMERR_INV_HDC
:*PMERR_HDC_BUSY  
:*PMERR_INV_IN_AREA
:*PMERR_INV_BACKGROUND_COL_ATTR  
:*PMERR_INV_MIX_ATTR
:*PMERR_INV_BACKGROUND_MIX_ATTR  
:*PMERR_INV_RESET_OPTIONS
:*PMERR_INV_COLOR_ATTR  
:Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.
:*PMERR_INV_HDC  
:*PMERR_INV_IN_AREA  
:*PMERR_INV_MIX_ATTR  
:*PMERR_INV_RESET_OPTIONS  
 
:Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.  


==Remarks==
==Remarks==
The attribute can be set to its default value or to a specified value.  
The attribute can be set to its default value or to a specified value.


==Sample Code==
==Sample Code==
Line 72: Line 54:


fSuccess = GreSetGlobalAttribute(hdc, lAttrType,
fSuccess = GreSetGlobalAttribute(hdc, lAttrType,
             lAttribute, flOptions, pInstance,
             lAttribute, flOptions, pInstance, lFunction);
            lFunction);
</PRE>
</PRE>


[[Category:Gre]]
[[Category:Gre]]

Latest revision as of 16:50, 5 April 2025

GreSetGlobalAttribute sets the specified attribute in the pen, pattern, character, image, and marker bundles.

This function is supported by the graphics engine.

Syntax

GreSetGlobalAttribute(hdc, lAttrType, lAttribute, flOptions, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
lAttrType (LONG) - input
Specifies the attribute type.
Attribute types:
ATYPE_COLOR Foreground color
ATYPE_BACK_COLOR Background color
ATYPE_MIX_MODE Foreground mix
ATYPE_BACK_MIX_MODE Background mix
Note: ATYPE_BACK_COLOR and ATYPE_BACK_MIX_MODE do not apply to the line bundle.
lAttribute (LONG) - input
New attribute value.
flOptions (ULONG) - input
The only allowable option flag is GATTR_DEFAULT, which specifies that the attribute indicated by lAttrType should be set to its default value. If the GATTR_DEFAULT flag is not set, the function sets the attribute to the value specified by lAttribute.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreSetGlobalAttribute.

Return Code

fSuccess (BOOL) - returns
Return codes.
On completion, the handling routine must return BOOLEAN (fSuccess).
  • TRUE Successful
  • FALSE Error
Possible Errors Detected: When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:
  • PMERR_DEV_FUNC_NOT_INSTALLED
  • PMERR_HDC_BUSY
  • PMERR_INV_BACKGROUND_COL_ATTR
  • PMERR_INV_BACKGROUND_MIX_ATTR
  • PMERR_INV_COLOR_ATTR
  • PMERR_INV_HDC
  • PMERR_INV_IN_AREA
  • PMERR_INV_MIX_ATTR
  • PMERR_INV_RESET_OPTIONS
Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.

Remarks

The attribute can be set to its default value or to a specified value.

Sample Code

#define INCL_GRE_DEVSUPPORT
#include <os2.h>

HDC      hdc;         /*  Device context handle. */
LONG     lAttrType;   /*  Specifies the attribute type. */
LONG     lAttribute;  /*  New attribute value. */
ULONG    flOptions;
PVOID    pInstance;   /*  Pointer to instance data. */
ULONG    lFunction;   /*  High-order WORD=flags; low-order WORD=NGreSetGlobalAttribute. */
BOOL     fSuccess;    /*  Return codes. */

fSuccess = GreSetGlobalAttribute(hdc, lAttrType,
             lAttribute, flOptions, pInstance, lFunction);