Color (ScreenField property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{Template:ScreenField:Color subtitle}}
{{Template:ScreenField:Color subtitle}}
The <var>Color</var> sets or returns the <var>[[#FieldColor enumeration|FieldColor]]</var> for a <var>ScreenField</var>.  The <var>[[#FieldColor enumeration|FieldColor]]</var> enumeration provides the color value.
The <var>Color</var> sets or returns the <var>[[Screen classes#FieldColor enumeration|FieldColor]]</var> for a <var>ScreenField</var>.  The <var>FieldColor</var> enumeration provides the color value.


Colors may be initially set for a field when it is created by the <var>[[AddField_(Screen_function)|AddField]]</var> method.
Colors may be initially set for a field when it is created by the <var>[[AddField_(Screen_function)|AddField]]</var> method.
Line 9: Line 9:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%currentFieldcolor</th>
<tr><th>%currentFieldcolor</th>
<td>A <var>FieldColor</var> enumeration (see below) to get <var class="term">sField</var>'s current color.</td></tr>
<td>A <var>FieldColor</var> enumeration to get <var class="term">sField</var>'s current color.</td></tr>
<tr><th>sfield</th>
<tr><th>sfield</th>
<td>A reference to an instance of a <var>ScreenField</var> object.</td></tr>
<td>A reference to an instance of a <var>ScreenField</var> object.</td></tr>
<tr><th>newFieldcolor</th>
<tr><th>newFieldcolor</th>
<td>A <var>FieldColor</var> enumeration (see below) setting the color for the <var class="term">sField</var>. </td></tr>
<td>A <var>FieldColor</var> enumeration setting the color for the <var class="term">sField</var>. </td></tr>
</table>
</table>
===FieldColor enumeration===
The valid values (case unimportant) of this [[Enumerations|enumeration]] are <var>turquoise</var>, <var>green</var>, <var>blue</var>, <var>red</var>, <var>white</var>, <var>yellow</var> and <var>pink</var>. The default is <var>blue</var>.
'''Note:''' As with all enumerations, the <var>ToString</var> method implicitly converts an enumeration value to a character string whose value is the name of the enumeration value. For more information about methods available to all enumerations, see [[Enumerations#Common enumeration methods|"Common enumeration methods"]].


==Usage notes==
==Usage notes==

Revision as of 02:10, 17 August 2011

Set or return the FieldColor for a screenfield (ScreenField class)

The Color sets or returns the FieldColor for a ScreenField. The FieldColor enumeration provides the color value.

Colors may be initially set for a field when it is created by the AddField method.

Syntax

%currentFieldColor = sfield:Color sfield:Color = newFieldColor

Syntax terms

%currentFieldcolor A FieldColor enumeration to get sField's current color.
sfield A reference to an instance of a ScreenField object.
newFieldcolor A FieldColor enumeration setting the color for the sField.

Usage notes

  • Under either of these conditions, which are not detectable by the screen methods, the display may not show the intended colors:
    • Color lets you set colors regardless of the actual terminal type, although some terminals may not display these attributes correctly.
    • Many terminal emulator programs allow local customization of color attributes.

Examples

For an example using Color method calls, see "Screen object sample code".

See also