Function GraSetAttrMarker() Foundation

Determines attributes for markers which are drawn by GraMarker().

Syntax
GraSetAttrMarker( [<oPS>], [<aAttributes>] ) --> aOldAttributes
Parameters
<oPS>
The argument <oPS> specifies the presentation space where marker attributes are set. If the current window is an XbpCrt window, <oPS>is optional. If it is NIL, the return value of SetAppWindow():presSpace() is used. In all other cases <oPS> is not optional. It must be created either using XbpPresSpace():new() or a "Micro PS" must be requested from an Xbase Part using the method:lockPS(). After graphic output the Micro PS must be released with :unlockPS().
<aAttributes> := Array( GRA_AM_COUNT )
<aAttributes> is an array whose elements contain the attributes for markers drawn by the function GraMarker().
#define constants for the attribute array of GraMarker()
Array element #define | value Default value
GRA_AM_COLOR GRA_CLR_* GRA_CLR_NEUTRAL
GRA_AM_BACKCOLOR GRA_CLR_* GRA_CLR_BACKGROUND
GRA_AM_MIXMODE GRA_FGMIX_* GRA_FGMIX_OVERPAINT
GRA_AM_BGMIXMODE GRA_BGMIX_* GRA_BGMIX_LEAVEALONE
GRA_AM_SYMBOL GRA_MARKSYM_* GRA_MARKSYM_CROSS
GRA_AM_BOX { nXSize, nYSize } Dependent on output device
Return

The function GraSetAttrMarker() returns a copy of the array containing the currently set marker attributes. If new attributes are specified by <aAttributes>, the function returns an array containing the previous attributes.

Description

The function GraSetAttrMarker() determines the attributes for point marking (markers) output by GraMarker(). The marker attributes which can be specified have the following results:

Attributes for markers
Array element Description
GRA_AM_COLOR Foreground color
GRA_AM_BACKCOLOR Background color
GRA_AM_MIXMODE Color mix attribute for foreground
GRA_AM_BGMIXMODE Color mix attribute for background
GRA_AM_SYMBOL Symbol for marker
GRA_AM_BOX Dimension of a marker in x and y direction

All marker attributes remain until the function GraSetAttrMarker() is called again. The exceptions to this are the colors, which are redefined with GraSetColor().

Foreground and background color

By default, the colors set by GraSetColor() are used. For markers a foreground and a background color can be specified separately.

Mix attributes

A detailed description of the mix attributes is found in the basic discussion of graphic attributesin the Xbase++ documentation.

Marker symbol

The following illustration shows all symbols for markers which can be selected by GraSetAttrMarker().

Symbols for markers and their #define constants

Marker size

The attribute GRA_AM_BOX determines the dimension of a marker in x and y direction. If the size is changed, an array with two elements is contained in the array element GRA_AM_BOX. The first element of the subarray contains the width of the marker and the second element contains its height.

Examples
Displays all markers
// The example displays all available markers and 
// their #define constants. 

#include "Gra.ch" 

PROCEDURE Main 
   LOCAL aAttr, aMarker, i, nX := 150, nY := 390 

   SetColor("N/W")                     // fill window with pale gray 
   CLS 
                                       // #define constants as 
   aMarker:= { ;                       // text and as  values 
      { "GRA_MARKSYM_DEFAULT       ", GRA_MARKSYM_DEFAULT        }, ; 
      { "GRA_MARKSYM_CROSS         ", GRA_MARKSYM_CROSS          }, ; 
      { "GRA_MARKSYM_PLUS          ", GRA_MARKSYM_PLUS           }, ; 
      { "GRA_MARKSYM_DIAMOND       ", GRA_MARKSYM_DIAMOND        }, ; 
      { "GRA_MARKSYM_SQUARE        ", GRA_MARKSYM_SQUARE         }, ; 
      { "GRA_MARKSYM_SIXPOINTSTAR  ", GRA_MARKSYM_SIXPOINTSTAR   }, ; 
      { "GRA_MARKSYM_EIGHTPOINTSTAR", GRA_MARKSYM_EIGHTPOINTSTAR }, ; 
      { "GRA_MARKSYM_SOLIDDIAMOND  ", GRA_MARKSYM_SOLIDDIAMOND   }, ; 
      { "GRA_MARKSYM_SOLIDSQUARE   ", GRA_MARKSYM_SOLIDSQUARE    }, ; 
      { "GRA_MARKSYM_DOT           ", GRA_MARKSYM_DOT            }, ; 
      { "GRA_MARKSYM_SMALLCIRCLE   ", GRA_MARKSYM_SMALLCIRCLE    }, ; 
      { "GRA_MARKSYM_BLANK         ", GRA_MARKSYM_BLANK          }  ; 
   } 

   aAttr  := Array( GRA_AM_COUNT )     // create attribute array 

   FOR i:=1 TO 12 
      aAttr[ GRA_AM_SYMBOL ] := aMarker[i,2] 
      GraSetAttrMarker( NIL, aAttr )   // set attributes 

      GraStringAt( NIL, { nX+10, nY-30*i }, ; // display text 
                               aMarker[i,1] ) 

      GraMarker( NIL, { nX+300, nY-30*i } )   // display marker 
   NEXT 

   Inkey(0)                            // wait for key press 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.