SetCurAttr Function (ROM Call 0x19A)

graph.h

short SetCurAttr (short Attr);

Sets the default attribute.

SetCurAttr sets the default attribute for all commands which haven't an attribute as an explicite parameter to Attr. The interpretation of the attribute depends of concrete graphic command. Some attributes are only valid for certain graphic operation. Legal attribute values are defined in enum Attrs. In a general, the following attributes are supported:

A_REVERSEDestination pixels turned off
A_NORMALDestination pixels turned on
A_XORSource pixels XORed with destination pixels
A_SHADEDDestination pixels masked so that every other pixel turned off
A_REPLACESource pixels replace destination pixels
A_ORSource pixels ORed with destination pixels

For lines the following additional attributes are supported:

A_THICK1Draw a double thick line
A_SHADE_VDraw the line using a vertical shading pattern
A_SHADE_HDraw the line using a horizontal shading pattern
A_SHADE_NSDraw the line using a negative slope diagonal shading pattern
A_SHADE_PSDraw the line using a positive slope diagonal shading pattern

SetCurAttr returns the previous current attribute.

Note: Although TI said nothing about it, attributes A_SHADE_V, A_SHADE_H, A_SHADE_NS and A_SHADE_PS work only for lines with slope more than 45 degree (i.e. for lines which are more "vertical" than "horizontal"). For "nearly horizontal" lines all of them act like A_NORMAL. I don't know whether it is a bug, or planned feature. So, if you want to draw shaded-fill rectangle using a line drawing command (for example, DrawLine) in a loop, use vertical lines for drawing, not horizontal ones! Note also that these additional attributes work fine with FillTriangle and FillLines2, but not with ScrRectFill!


Used by: DrawClipRect, DrawMultiLines, MenuKey, MenuOff, MenuOn, MenuTopRedef, MenuTopSelect, DrawWinBorder, ROM Call 0x421