Color (ScreenField property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Created page with "This property sets or returns the FieldColor for a ScreenField. FieldColor is a ScreenField class enumeration. This attribute is initially set for a field by the [[Screen class#A...")
 
mNo edit summary
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This property sets or returns the FieldColor for a ScreenField. FieldColor is a ScreenField class enumeration. This attribute is initially set for a field by the [[Screen class#AddField function|AddField method]].
{{Template:ScreenField:Color subtitle}}
The <var>Color</var> method sets or returns the color value (<var>[[Screen classes#FieldColor enumeration|FieldColor]]</var> enumeration) of a <var>ScreenField</var>.


  %sfield:Color = fieldcolor
Colors may be initially set for a field when it is created by the <var>[[AddField_(Screen_function)|AddField]]</var> method.
  fieldcolor = %sfield:Color


; Color syntax
==Syntax==
{{Template:ScreenField:Color syntax}}


; fieldcolor
===Syntax terms===
: A FieldColor enumeration. Valid values (case unimportant) are turquoise, green, blue, red, white, yellow, and pink. The default is blue
<table class="syntaxTable">
<tr><th>%currentFieldcolor</th>
<td>A <var>FieldColor</var> enumeration to get <var class="term">sfield</var>'s current color.</td></tr>


; %sfield  
<tr><th>sfield</th>
: A reference to an instance of a ScreenField object.
<td>A reference to an instance of a <var>ScreenField</var> object.</td></tr>


; Usage Notes
<tr><th>newFieldcolor</th>
<td>A <var>FieldColor</var> enumeration setting the color for the <var class="term">sfield</var>. </td></tr>
</table>


The Color property lets you set colors regardless of the actual terminal type, although some terminals may not display these attributes correctly. Also, many terminal emulator programs allow local customization of color attributes. Under either of these conditions, which are not detectable by the screen methods, the
==Usage notes==
display may not show the intended colors.
<ul>
<li>Under either of these conditions, which are not detectable by the screen methods, the display may not show the intended colors:
<ul><li><var>Color</var> lets you set colors regardless of the actual terminal type, although some terminals may not display these attributes correctly.
<li>Many terminal emulator programs allow local customization of color attributes.
</ul>
<li>Default field colors may be set by the <var>[[ProtectedColor_(Screen_property)|ProtectedColor]]</var> or <var>[[UnprotectedColor_(Screen_property)|UnprotectedColor]]</var> properties.
</ul>


For an example using Color method calls, see [[Screen class example]].
==Examples==
For an example using <var>Color</var> method calls, see [[Screen object sample code|"Screen object sample code"]].
 
==See also==
{{Template:ScreenField:Color footer}}

Latest revision as of 18:05, 20 November 2012

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

The Color method sets or returns the color value (FieldColor enumeration) of a ScreenField.

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.
  • Default field colors may be set by the ProtectedColor or UnprotectedColor properties.

Examples

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

See also