Screen classes: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (RKTools replaces UL/SPF)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[File:ScreenObject.png|thumb|300px|Screen object code can dynamically resize the application to use whatever space is available in the user's chosen 3270 configuration.]]Introduced in version 7.1 of the <var class="product">[[Sirius Mods]]</var>, '''Screen objects''' are designed to make writing and maintaining User Language full-screen applications easier. They also let you take advantage of dynamic 3270 screen sizes in your applications.   
[[File:ScreenObject.png|thumb|300px|Screen object code can dynamically resize the application to use whatever space is available in the user's chosen 3270 configuration.]] Introduced in version 7.1 of the <var class="product">[[Sirius Mods]]</var>, '''Screen objects''' are designed to make writing and maintaining <var class="product">User Language</var> full-screen applications easier. They also let you take advantage of dynamic 3270 screen sizes in your applications.   


Most modern 3270 emulators allow flexible definitions of 3270 screen sizes beyond the standard Models 2, 3, 4, and 5. Traditional User Language screen definitions define a fixed layout for a screen and so must be designed to be display correctly on even the smallest screen. This is usually the 3278 Model 2, which contains a none-too-generous 24 rows by 80 columns. Though a screen designed for a 24x80 layout will usually display correctly on other models, screens designed for other models may display misaligned data on a smaller screen, often rendering the application unusable on these screen types. This leaves the application programmer little choice but to design for the lowest common denominator &mdash; Model 2 &mdash; wasting precious screen space on larger screens.
Most modern 3270 emulators allow flexible definitions of 3270 screen sizes beyond the standard Models 2, 3, 4, and 5. Traditional <var class="product">User Language</var> screen definitions define a fixed layout for a screen and so must be designed to be display correctly on even the smallest screen. This is usually the 3278 Model 2, which contains a none-too-generous 24 rows by 80 columns. Though a screen designed for a 24x80 layout will usually display correctly on other models, screens designed for other models may display misaligned data on a smaller screen, often rendering the application unusable on these screen types. This leaves the application programmer little choice but to design for the lowest common denominator &mdash; Model 2 &mdash; wasting precious screen space on larger screens.


With Screen objects, screen definition takes place during User Language request evaluation instead of during compilation, freeing the programmer to detect and take advantage of the current screen size and to make more efficient use of available screen space. It is therefore possible for a single application to support many different screen sizes without changing User Language code or resorting to special $functions to manipulate a traditional screen layout.
With <var>Screen</var> objects, screen definition takes place during <var class="product">User Language</var> request evaluation instead of during compilation, freeing the programmer to detect and take advantage of the current screen size and to make more efficient use of available screen space. It is therefore possible for a single application to support many different screen sizes without changing <var class="product">User Language</var> code or resorting to special $functions to manipulate a traditional screen layout.


[[Screen object sample code|"Screen object sample code"]] and [[Screen class using object-oriented syntax|"Screen class using object-oriented syntax"]] contain coding examples.  If you are a <var class="product">[[ULSPF|UL/SPF]]</var> customer, you can also find screen object coding examples in the SIRIUS file.
[[Screen object sample code]] and [[Screen class using object-oriented syntax]] contain coding examples.  If you are a <var class="product">[[RKTools]]</var> customer, you can also find screen object coding examples in the <code>SIRIUS</code> file.


==Screens and ScreenFields==
==Screens and ScreenFields==
The <var>Screen</var> class provides an object-oriented (OO) equivalent of the <var class="product">Model 204</var> full-screen feature. An instance of a <var>Screen</var> object is equivalent to a screen you might define with the [[SOUL]] OO full-screen feature. The <var>Screen</var> methods specify layout and certain visual attributes of each screen: where screen items are to appear on the video display, and how they are to be highlighted or colored.


The Screen class provides an object-oriented equivalent of the Model 204 full-screen feature. An instance of a Screen object is equivalent to a screen you might define with the User Language full-screen feature. The Screen methods specify layout and certain visual attributes of each screen: where screen items are to appear on the video display, and how they are to be highlighted or colored.
<var>Screen</var> objects are composed of screen fields and not screenlines as in the full-screen feature, and multiple screen fields may form the equivalent of a single screenline (or row). These screen fields are themselves objects: instances of the <var>Screenfield</var> class. In this document, <var>ScreenField</var> objects are sometimes referred to as “fields” and sometimes as “screenfields.”
 
Screen objects are composed of screen fields and not screenlines as in the full-screen feature, and multiple screen fields may form the equivalent of a single screenline (or row). These screen fields are themselves objects: instances of the Screenfield class. In this document, ScreenField objects are sometimes referred to as “fields” and sometimes as “screenfields.”


==System space for Screen objects==
==System space for Screen objects==
Traditional <var class="product">User Language</var> full-screen applications use FSCB (Full Screen Buffer) space to hold 3270 screen definitions. But screen objects must fit within the object-oriented architecture, which cannot utilize FSCB space. As a result, screen objects use STBL space for dynamic screen definitions.


Traditional User Language full-screen applications use FSCB (Full Screen Buffer) space to hold 3270 screen definitions. Since screen objects are part of Janus SOAP, the design must fit within this existing object-oriented architecture, which cannot utilize FSCB space. As a result, screen objects use STBL space for dynamic screen definitions.
Because the entire screen image must be in contiguous storage, any instance of a screen object must allocate the maximum allowable STBL space, even if some of this space may not be used by a particular application. You use the <var>[[SCRNSTBL parameter|SCRNSTBL]]</var> user parameter, which specifies the maximum size per screen, to prevent unnecessary waste of STBL space and to limit an application to a reasonable amount of space to prevent STBL exhaustion.
 
Because the entire screen image must be in contiguous storage, any instance of a screen object must allocate the maximum allowable STBL space, even if some of this space may not be used by a particular application. You use the SCRNSTBL user parameter, which specifies the maximum size per screen, to prevent unnecessary waste of STBL space and to limit an application to a reasonable amount of space to prevent STBL exhaustion.


A good starting value for SCRNSTBL is 6144 (this is the default as of Sirius Mods 7.3 and maintenance to earlier versions). Scrolling applications and applications designed for large screens with many fields may require two or more times this storage. An application that exceeds its screen STBL allocation is canceled.
A good starting value for <var>SCRNSTBL</var> is 6144. Scrolling applications and applications designed for large screens with many fields may require two or more times this storage. An application that exceeds its screen STBL allocation is canceled.


==Useful enumerations==
==Useful enumerations==
Line 32: Line 30:
<var>ActionKey</var> is used by the <var>[[ActionKey (Screen function)|ActionKey]]</var> and <var>[[Read (Screen function)|Read]]</var> methods to specify the keyboard key that activated the last screen read. Valid values are <var>Enter</var> and <var>Pf1</var>, <var>Pf2</var>, and so on through <var>Pf24</var>. The value that is set initially is <var>Enter</var>.
<var>ActionKey</var> is used by the <var>[[ActionKey (Screen function)|ActionKey]]</var> and <var>[[Read (Screen function)|Read]]</var> methods to specify the keyboard key that activated the last screen read. Valid values are <var>Enter</var> and <var>Pf1</var>, <var>Pf2</var>, and so on through <var>Pf24</var>. The value that is set initially is <var>Enter</var>.


As with all enumerations, the <var>ToString</var> method implicitly converts an <var>ActionKey</var> value to a character string whose value is the name of the enumeration value. Other methods available to all enumerations are described in [[Enumerations#Common enumeration methods|"Common enumeration methods"]]. Besides these common methods, the
As with all enumerations, the <var>ToString</var> method implicitly converts an <var>ActionKey</var> value to a character string whose value is the name of the enumeration value. Other methods available to all enumerations are described in [[Enumerations#Common enumeration methods|Common enumeration methods]]. Besides these common methods, the
<var>ActionKey</var> enumeration has an additional method available (<var>ToNumber</var>), as
<var>ActionKey</var> enumeration has an additional method available (<var>ToNumber</var>), as
described in the following section.
described in the following section.
Line 38: Line 36:
====ToNumber function====
====ToNumber function====
This function converts <var>ActionKey</var> enumeration values to a numeric value: the integer that remains after the key name is stripped of its "PF" prefix. For <var>Enter</var>, the numeric value is 0. These values are useful in a value-testing loop in conjunction with the <var class="product">User Language</var> <var>Jump</var> statement.
This function converts <var>ActionKey</var> enumeration values to a numeric value: the integer that remains after the key name is stripped of its "PF" prefix. For <var>Enter</var>, the numeric value is 0. These values are useful in a value-testing loop in conjunction with the <var class="product">User Language</var> <var>Jump</var> statement.
====ToNumber syntax====
====ToNumber syntax====
<p class="syntax"> <span class="term">%num</span> <span class="literal">= </span><span class="term">key</span><span class="literal">:ToNumber</span>
<p class="syntax"> <span class="term">%num</span> <span class="literal">= </span><span class="term">key</span><span class="literal">:ToNumber</span>
Line 54: Line 53:
<var>FieldColor</var> is used by the and <var>[[AddField (Screen function)|AddField]]</var>, <var>[[Color (ScreenField property)|Color]]</var>, <var>[[ProtectedColor (Screen property)|ProtectedColor]]</var>, and <var>[[UnprotectedColor (Screen property)|UnprotectedColor]]</var> methods. The valid values (case unimportant) of this 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>.  
<var>FieldColor</var> is used by the and <var>[[AddField (Screen function)|AddField]]</var>, <var>[[Color (ScreenField property)|Color]]</var>, <var>[[ProtectedColor (Screen property)|ProtectedColor]]</var>, and <var>[[UnprotectedColor (Screen property)|UnprotectedColor]]</var> methods. The valid values (case unimportant) of this 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 a <var>FieldColor</var> 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"]].
<p class="note">'''Note:''' As with all enumerations, the <var>ToString</var> method implicitly converts a <var>FieldColor</var> 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]]. </p>


===Highlight enumeration===
===Highlight enumeration===
<var>Highlight</var> contains a field's highlight value. It is used by the <var>[[Highlight (ScreenField property)|Highlight]]</var>, <var>[[AddField (Screen function)|AddField]]</var>, <var>[[ProtectedHighlight (Screen property)|ProtectedHighlight]]</var>, and <var>[[UnprotectedHighlight (Screen property)|UnprotectedHighlight]]</var> methods. Valid values of this enumeration are <var>None</var>, <var>Underline</var>, <var>Reverse</var>, and <var>Blink</var>. The default value is <var>None</var>.
<var>Highlight</var> contains a field's highlight value. It is used by the <var>[[AddField (Screen function)|AddField]]</var>, <var>[[Highlight (ScreenField property)|Highlight]]</var>, <var>[[ProtectedHighlight (Screen property)|ProtectedHighlight]]</var>, and <var>[[UnprotectedHighlight (Screen property)|UnprotectedHighlight]]</var> methods. Valid values of this enumeration are <var>None</var>, <var>Underline</var>, <var>Reverse</var>, and <var>Blink</var>. The default value is <var>None</var>.
 
==Lists of Screen and ScreenField methods==
The [[List of Screen methods]] and the [[List of ScreenField methods]] contain complete lists of the methods in these classes, and they are combined in [[List of Screen API methods]].


==See also==
==See also==
 
<ul>
*The [[List of Screen methods|"List of Screen methods"]] and the [[List of ScreenField methods|"List of ScreenField methods"]]
<li>[[Screen object sample code]] and [[Screen class using object-oriented syntax]]
*[[Screen object sample code|"Screen object sample code"]] and [[Screen class using object-oriented syntax|"Screen class using object-oriented syntax"]]
<li>How to use [[Terminal MODEL 6 support|Model 6]], or dynamically sized screens, in <var class="product">Model 204</var>  
 
</ul>
*How to use [[Mod6 Screen|Model 6]], or [[Mod6 Screens|Dynamically Sized screens]] in <var class="product">Model 204</var>  
 


[[Category:System classes]]
[[Category:System classes]]

Latest revision as of 20:51, 23 October 2015

Screen object code can dynamically resize the application to use whatever space is available in the user's chosen 3270 configuration.

Introduced in version 7.1 of the Sirius Mods, Screen objects are designed to make writing and maintaining User Language full-screen applications easier. They also let you take advantage of dynamic 3270 screen sizes in your applications.

Most modern 3270 emulators allow flexible definitions of 3270 screen sizes beyond the standard Models 2, 3, 4, and 5. Traditional User Language screen definitions define a fixed layout for a screen and so must be designed to be display correctly on even the smallest screen. This is usually the 3278 Model 2, which contains a none-too-generous 24 rows by 80 columns. Though a screen designed for a 24x80 layout will usually display correctly on other models, screens designed for other models may display misaligned data on a smaller screen, often rendering the application unusable on these screen types. This leaves the application programmer little choice but to design for the lowest common denominator — Model 2 — wasting precious screen space on larger screens.

With Screen objects, screen definition takes place during User Language request evaluation instead of during compilation, freeing the programmer to detect and take advantage of the current screen size and to make more efficient use of available screen space. It is therefore possible for a single application to support many different screen sizes without changing User Language code or resorting to special $functions to manipulate a traditional screen layout.

Screen object sample code and Screen class using object-oriented syntax contain coding examples. If you are a RKTools customer, you can also find screen object coding examples in the SIRIUS file.

Screens and ScreenFields

The Screen class provides an object-oriented (OO) equivalent of the Model 204 full-screen feature. An instance of a Screen object is equivalent to a screen you might define with the SOUL OO full-screen feature. The Screen methods specify layout and certain visual attributes of each screen: where screen items are to appear on the video display, and how they are to be highlighted or colored.

Screen objects are composed of screen fields and not screenlines as in the full-screen feature, and multiple screen fields may form the equivalent of a single screenline (or row). These screen fields are themselves objects: instances of the Screenfield class. In this document, ScreenField objects are sometimes referred to as “fields” and sometimes as “screenfields.”

System space for Screen objects

Traditional User Language full-screen applications use FSCB (Full Screen Buffer) space to hold 3270 screen definitions. But screen objects must fit within the object-oriented architecture, which cannot utilize FSCB space. As a result, screen objects use STBL space for dynamic screen definitions.

Because the entire screen image must be in contiguous storage, any instance of a screen object must allocate the maximum allowable STBL space, even if some of this space may not be used by a particular application. You use the SCRNSTBL user parameter, which specifies the maximum size per screen, to prevent unnecessary waste of STBL space and to limit an application to a reasonable amount of space to prevent STBL exhaustion.

A good starting value for SCRNSTBL is 6144. Scrolling applications and applications designed for large screens with many fields may require two or more times this storage. An application that exceeds its screen STBL allocation is canceled.

Useful enumerations

Screen methods make use of these enumerations:

ActionKey enumeration

ActionKey is used by the ActionKey and Read methods to specify the keyboard key that activated the last screen read. Valid values are Enter and Pf1, Pf2, and so on through Pf24. The value that is set initially is Enter.

As with all enumerations, the ToString method implicitly converts an ActionKey value to a character string whose value is the name of the enumeration value. Other methods available to all enumerations are described in Common enumeration methods. Besides these common methods, the ActionKey enumeration has an additional method available (ToNumber), as described in the following section.

ToNumber function

This function converts ActionKey enumeration values to a numeric value: the integer that remains after the key name is stripped of its "PF" prefix. For Enter, the numeric value is 0. These values are useful in a value-testing loop in conjunction with the User Language Jump statement.

ToNumber syntax

%num = key:ToNumber

Syntax terms

%num A number variable to receive the integer part of the action key name.
key An ActionKey enumeration variable or expression.

FieldColor enumeration

FieldColor is used by the and AddField, Color, ProtectedColor, and UnprotectedColor methods. The valid values (case unimportant) of this enumeration are turquoise, green, blue, red, white, yellow and pink. The default is blue.

Note: As with all enumerations, the ToString method implicitly converts a FieldColor value to a character string whose value is the name of the enumeration value. For more information about methods available to all enumerations, see Common enumeration methods.

Highlight enumeration

Highlight contains a field's highlight value. It is used by the AddField, Highlight, ProtectedHighlight, and UnprotectedHighlight methods. Valid values of this enumeration are None, Underline, Reverse, and Blink. The default value is None.

Lists of Screen and ScreenField methods

The List of Screen methods and the List of ScreenField methods contain complete lists of the methods in these classes, and they are combined in List of Screen API methods.

See also