 |
SetCurAttr |
Function (ROM Call 0x19A) |
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_REVERSE | Destination pixels turned off |
A_NORMAL | Destination pixels turned on |
A_XOR | Source pixels XORed with destination pixels |
A_SHADED | Destination pixels masked so that every other pixel turned off |
A_REPLACE | Source pixels replace destination pixels |
A_OR | Source pixels ORed with destination pixels |
For lines the following additional attributes are supported:
A_THICK1 | Draw a double thick line |
A_SHADE_V | Draw the line using a vertical shading pattern |
A_SHADE_H | Draw the line using a horizontal shading pattern |
A_SHADE_NS | Draw the line using a negative slope diagonal shading pattern |
A_SHADE_PS | Draw 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