Chapter 6:
Graph Modification Functions
 

The graph modification functions are primarily used to modify attributes of the chart. Your application can get information about the current attribute setting and also modify an attribute setting.

 

GetGraphAttr(); Get Graph Attribute

 

GetGraphAttrSI(); Get Graph Attribute of an item in a selection list

 

GetGraphAttrSL(); Get Graph Attribute for all items in a selection list

 

GetObjectMobility(); Get Object Mobility

 

SetGraphAttr(); Set Graph Attribute

 

SetGraphAttrSI(); Set Graph Attribute for an item in a Selection List

 

SetGraphAttrSL(); Set Graph Attribute for all items in a Selection List

GetGraphAttr()

 

This function gets the attribute defined by attrcode and stores the attribute information in pData. The return value indicates the results of the request. ::

Syntax:

INT16 PUBLIC
GetGraphAttr (
     GraphPtr pGraph,
     INT16 nLayerID,
     INT16 nObjectID,
     INT16 nSeriesID,
     INT16 nGroupID,
     INT16 attrCode,
     void FAR * pData
);

Input:

pGraph: Pointer to the graph object created by AllocGraphPtr()

 

nLayerID: Layer ID of the engine object attribute.

 

GRAPH_LAYER

Graph Layer

 

BACKGROUND_LAYER

Background Layer

 

ANNOTATION_LAYER

Annotation Layer

 

This field normally uses GRAPH_LAYER.

 

nObjectID: ObjectID of the engine object attribute. Use NULL_OBJECTID if there is no object associated with the attribute.

 

nSeriesID: Identifies the series number when getting an attribute that only applies to a specific series. Use NULL_SERIESID if there is no series number associated with the attribute.

 

nGroupID: Identifies the group number when getting an attribute that only applies to a specific group. Use NULL_GROUPID if there is no group number associated with the attribute.

 

attrCode: Attribute code. See the PGSDK Attributes Guide.

 

pData: Pointer to location to store the attribute value. This could be a pointer to an integer, double, structure, or other data type depending on the attribute.

Return:

INT16:

 

NO_UNDO (-2)=

Attribute changed, no undo but redraw

 

NO_ACTION (-1) =

Attribute changed, but no action necessary

 

NO_MATCH (0) =

Attribute not found

 

IS_CHANGED (1) =

Attribute changed, redraw all the view entirely

 

CUSTOM_VIEW (2) =

Not Used

 

NO_REDRAW (3) =

Attribute changed, no redraw

 

UPDATE_ME (4) =

Attribute changed, update only selected objects

Example:

See the PGSDK Attributes Guide

Notes:

1.

Do not use SERCON_DOALL or SERCON_USESELLIST as the nSeriesID. It is not possible to get the attributes for all the series.

 

2.

Use GetGraphAttr() to get attribute information for a specific object. Use GetGraphAttrSI() to get attribute information for a specific item in a selection list. Use GetGraphAttrSL() to get attribute information for the first item in a selection list. These functions all have equivalent "Set" attribute functions.

Also See:

GetGraphAttrSI(), GetGraphAttrSL(), SetGraphAttr()

GetGraphAttrSI()

 

This function gets the value assigned to an attribute code for a specific selected item in the selection list (pItem). :

Syntax:

INT16 PUBLIC
GetGraphAttrSI (
     GraphPtr pGraph,
     SelItemPtr pItem,
     INT16 attrCode,
     void FAR * pData
);

Input:

pGraph: Pointer to the graph object created by AllocGraphPtr()

 

pItem: Pointer to a selection list item. See the SelItemRec structure in Appendix A. You may use NULL if you want to get attribute information for non-series specific objects.

 

attrCode: Attribute Code. See the PGSDK Attributes Guide for a list of valid attribute codes

 

pData: Pointer to location for storing the attribute value. It can be a pointer to an integer, double, structure, or other data type depending on the attribute.

Return:

INT16: 0/1

 

0=

No match, selection item not in list.

 

1=

Attribute value successfully retrieved

Example:

See the PGSDK Attributes Guide

Notes:

1.

Use GetGraphAttr() to get attribute information for a specific object. Use GetGraphAttrSI() to get attribute information for a specific item in a selection list. Use GetGraphAttrSL() to get attribute information for the first item in a selection list. These functions all have equivalent "Set" attribute functions.

 

2.

Use this function as a short-cut to get attributes that are not series-dependent. Example: getGraphAttrSI(pGraph, NULL, A_LOCATE_FRAME, &FRAME);

Also See:

GetGraphAttr(), GetGraphAttrSL(), SetGraphAttrSI()

GetGraphAttrSL()

 

This function gets the attribute information for the first item in the selection list identified by pSelList. :

Syntax:

INT16 PUBLIC
GetGraphAttrSL (
     GraphPtr pGraph,
     SelListPtr pSelList,
     INT16 attrCode,
     void FAR * pData
);

Input:

pGraph: Pointer to the graph object created by AllocGraphPtr()

 

pSelList: Pointer to a selection list allocated by Select_AllocList().See the SelListRec structure in Appendix A. You may use NULL if you want to get attribute information for non-series specific objects.

 

attrCode: Attribute Code. See the PGSDK Attributes Guide for a list of attribute codes

 

pData: Pointer to location for storing the attribute value. This could be a pointer to an integer, double, structure, or other data type depending on the attribute.

Return:

INT16: 0/1

 

0=

Selection list not valid.

 

1=

Attribute value successfully retrieved

Notes:

1.

Use GetGraphAttr() to get attribute information for a specific object. Use GetGraphAttrSI() to get attribute information for a specific item in a selection list. Use GetGraphAttrSL() to get attribute information for the first item in a selection list. These functions all have equivalent "Set" attribute functions.

 

2.

Use this function as a short-cut to get attributes that are not series-dependent. Example: GetGraphAttrSL(pGraph, NULL, A_LOCATE_FRAME, &FRAME);

Example:

See the PGSDK Attributes Guide

Also See:

GetGraphAttr(), GetGraphAttrSI(), SetGraphAttrSL()

GetObjectMobility()

 

This function returns the attribute code necessary to move the object. If the object can't be moved, GetObjectMobility() returns zero.:

Syntax:

INT16 PUBLIC
GetObjectMobility (
     GraphPtr pGraph,
     INT16 objID
);

Input:

pGraph: Pointer to the graph object created by AllocGraphPtr()

 

objID: Object ID

Return:

INT16: Zero/None-Zero

 

Value

Description

 

Zero =

Object is not mobile

 

Non-Zero=

Attribute code necessary to move the object

Example:

// see if this is a movable
//engine-specific object -*/
return GetObjectMobility(pGraph, nObjID);
break;

   

SetGraphAttr()

 

This function sets the attribute (attrcode) to the value stored at pData. The return value indicates the result of modifying the attribute.

Syntax:

INT16 PUBLIC SetGraphAttr (
     GraphPtr pGraph,
     INT16 nLayerID,
     INT16 nObjectID,
     INT16 nSeriesID,
     INT16 nGroupID,
     INT16 attrCode,
     void FAR * pData
);

Input:

pGraph: Pointer to the graph object created by AllocGraphPtr()

 

nLayerID: LayerID of the engine object attribute.

 

Possible Values

Description

 

ANNOTATION_LAYER

Annotation Layer

 

GRAPH_LAYER

Graph Layer

 

BACKGROUND_LAYER

Background Layer

 

This field normally uses GRAPH_LAYER.

 

nObjectID: An Object ID. Use NULL_OBJECTID if there is no object associated with the attribute or if the attribute is object-specific.

 

nSeriesID: Identifies the series number when changing attributes that only apply to a specific series. Use NULL_SERIESID if there is no series number associated with the attribute. Use SERCON_DOALL to change the attributes of all the series in the chart.

 

nGroupID: Identifies the group number when changing attributes that only apply to a specific group. Use NULL_GROUPID if there is no group number associated with the attribute.

 

attrCode: Attribute code of the attribute to set (e.g., A_AREACOLOR_RGB, A2D_BAR_RISER_WIDTH, A3D_GLOW_RISER, etc.). See the PGSDK Programmer's Manual or the PGSDK Attributes Guide for a complete list of attribute codes.

 

pData: Pointer to the new attribute value. It can be a pointer to an integer, double, structure, or other data type depending on the attribute (attrCode). See the individual attribute codes in the PGSDK Attributes Guide.

Return:

INT16: One of the following values from the AttrStatusType enum:

 

NO_UNDO (-2)=

Attribute changed, no undo but redraw

 

NO_ACTION (-1) =

Attribute changed, but no action necessary

 

NO_MATCH (0) =

Attribute not found

 

IS_CHANGED (1) =

Attribute changed, redraw all the view entirely

 

CUSTOM_VIEW (2) =

Not Used

 

NO_REDRAW (3) =

Attribute changed, no redraw

 

UPDATE_ME (4) =

Attribute changed, update only selected objects

Example:

See the PGSDK Attributes Guide

Notes:

Use SetGraphAttr() to set attribute information for a specific object. Use SetGraphAttrSI() to set attribute information for an item in a selection list. Use SetGraphAttrSL() to set attribute information for the all items in a selection list. These functions have equivalent Get attribute functions.

Also See:

GetGraphAttr(), SetGraphAttrSI(), SetGraphAttrSL()

SetGraphAttrSI()

 

This function assigns the value at pData to the attribute code (attrCode) for a specific selected item (pItem) in the selection list.

Syntax:

INT16 PUBLIC
SetGraphAttrSI (
     GraphPtr pGraph,
     SelItemPtr pItem,
     INT16 attrCode,
     void FAR * pData
);

Input:

pGraph: Pointer to the graph object created by AllocGraphPtr()

 

pItem: Pointer to a selection list item. See the SelItemRec in Appendix A. You may use NULL if you want to set attribute information for non-series specific objects.

 

attrCode: Attribute Code. See the PGSDK Attributes Guide.

 

pData: Pointer to location where the new attribute value is stored. It can be a pointer to an integer, double, structure, or other data type depending on the attribute. See the individual attribute codes in the PGSDK Attributes Guide.

Return:

INT16: One of the following values from the AttrStatusType enum:

 

Possible Values

Description

 

IS_CHANGED =

pItem was located and the attribute code was set

 

NO_ACTION =

pItem was not in the selection list

 

NO_MATCH =

attribute code not valid for item in list

Example:

See the PGSDK Attributes Guide

Notes:

1.

Use SetGraphAttr() to set attribute information for a specific object. Use SetGraphAttrSI() to set attribute information for a particular item in a selection list. Use SetGraphAttrSL() to set attribute information for the all items in a selection list. These functions all have equivalent Get attribute functions.

 

2.

Use this function as a short-cut to set attributes that are not series-dependent. Example: SetGraphAttrSI(pGraph, NULL, A_LOCATE_FRAME, &FRAME);

Also See:

GetGraphAttrSI(), SetGraphAttr(), SetGraphAttrSL()

SetGraphAttrSL()

 

This function sets the value of an attribute for the all items in the selection list identified by pSelList .

Syntax:

INT16 PUBLIC
SetGraphAttrSL (
     GraphPtr pGraph,
     SelListPtr pSelList,
     INT16 attrCode,
     void FAR * pData
);

Input:

pGraph: Pointer to the graph object created by AllocGraphPtr()

 

pSelList: Pointer to a selection list allocated by Select_AllocList(). See the SelListRec in Appendix A. You may use NULL if you want to set attribute information for non-series specific objects.

 

attrCode: INT16 value identifying a valid attribute code (See the PGSDK Attributes Guide for a list of valid attribute codes)

 

pData: Pointer to a new attribute value. The valid range of value(s) at pData depends on the attribute code (attrCode). See the individual attribute codes in the PGSDK Attributes Guide.

Return:

INT16: One of the following values from the AttrStatusType enum:

 

Possible Values

Description

 

IS_CHANGED =

attribute code was set for the first item in the selection list

 

NO_MATCH =

attribute code not valid for first item in list

Example:

See the PGSDK Attributes Guide

Notes:

1.

Use SetGraphAttr() to set attribute information for a specific object. Use SetGraphAttrSI() to set attribute information for a particular item in a selection list. Use SetGraphAttrSL() to set attribute information for the all items in a selection list. These functions all have equivalent Get attribute functions.

 

2.

Use this function as a short-cut to get attributes that are not series-dependent. Example: SetGraphAttrSI(pGraph, NULL, A_LOCATE_FRAME, &FRAME);

Also See:

GetGraphAttrSI(), SetGraphAttr(), SetGraphAttrSL()