ProtectedColor (Screen property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Template:Screen:ProtectedColor subtitle}}
{{Template:Screen:ProtectedColor subtitle}}
The <var>ProtectedColor</var> property sets or gets the current default for the color of protected fields in a <var>Screen</var> object.  A protected field is assigned this color unless another color value is explicitly specified in the <var>[[AddField_(Screen_function)|AddField]]</var> statement that defines the field.
An unprotected field's color can be changed by the <var>[[Color_(ScreenField_property)|Color]]</var> method.


This property sets or gets the current default for the color of protected fields in a Screen object. A protected field is assigned this color unless another color value is explicitly specified in the AddField statement that defines the field. A field's color can also be changed by the [[Screenfield class]] Color method (&#x201C;Color property&#x201D;).
==Syntax==
==Syntax==
{{Template:Screen:ProtectedColor syntax}}
===Syntax terms===
===Syntax terms===
<dd>
<table class="syntaxTable">
<dt>fieldcolor
<tr><th>%currentFieldColor</th>
<dd>A Fieldcolor enumeration. Valid values (case unimportant) are turquoise, green, blue, red, white, yellow, and pink. The default value is blue.
<td>A <var>[[Color_(ScreenField_property)#FieldColor_enumeration|Fieldcolor enumeration]]</var> to get the current default color for protected fields. Valid values (case unimportant) are <code>turquoise</code>, <code>green</code>, <code>blue</code>, <code>red</code>, <code>white</code>, <code>yellow</code>, and <code>pink</code>. The default value is <code>blue</code>.</td></tr>
<dt>%screen  
<tr><th>screen</th>
<dd>A reference to an instance of a Screen object.
<td>A reference to an instance of a <var>Screen</var> object.</td></tr><tr>
</dl>
<th>newFieldColor</th>
<td>A <var>Fieldcolor</var> enumeration setting the new default for a protected field's color. Valid values (case unimportant) are <code>turquoise</code>, <code>green</code>, <code>blue</code>, <code>red</code>, <code>white</code>, <code>yellow</code>, and <code>pink</code>. The default value is <code>blue</code>.</td></tr>
</table>
 
==Examples==
==Examples==
The following statement prints the color of the <code>%scr</code> screen:
<p class="code">print %scr:protectedColor:ToString
</p>


The following statement prints the color of the %scr screen:
Print %scr:protectedColor:ToString
==See also==
==See also==
{{Template:Screen:ProtectedColor footer}}
{{Template:Screen:ProtectedColor footer}}

Latest revision as of 22:53, 16 November 2012

Set color for protected screen fields (Screen class)

The ProtectedColor property sets or gets the current default for the color of protected fields in a Screen object. A protected field is assigned this color unless another color value is explicitly specified in the AddField statement that defines the field.

An unprotected field's color can be changed by the Color method.

Syntax

%currentFieldColor = screen:ProtectedColor screen:ProtectedColor = newFieldColor

Syntax terms

%currentFieldColor A Fieldcolor enumeration to get the current default color for protected fields. Valid values (case unimportant) are turquoise, green, blue, red, white, yellow, and pink. The default value is blue.
screen A reference to an instance of a Screen object.
newFieldColor A Fieldcolor enumeration setting the new default for a protected field's color. Valid values (case unimportant) are turquoise, green, blue, red, white, yellow, and pink. The default value is blue.

Examples

The following statement prints the color of the %scr screen:

print %scr:protectedColor:ToString

See also