Screen classes: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 7: Line 7:
[[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|"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.


=Screens and ScreenFields=
==Screens and ScreenFields==


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.
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.
Line 13: Line 13:
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.”
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 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.
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.
Line 21: Line 21:
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 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.


=See also=
==Useful enumerations==
Screen methods make use of these [[Enumerations|enumerations]]:
<ul class="nobul">
<li><var>[[#ActionKey enumeration|ActionKey]]</var>
<li><var>[[#ActionKey enumeration|ActionKey]]</var>
<li><var>[[#ActionKey enumeration|ActionKey]]</var>
</ul>
 
===ActionKey enumeration===
<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>.
 
Besides the [[#Common Enumeration methods|common enumeration methods]], the
<var>ActionKey</var> enumeration has an additional method available (<var>ToNumber</var>), as
described in the following section.
====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.
====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>
====Syntax terms====
<table class="syntaxTable">
<tr><th>%num</th>
<td>A number variable that is assigned the integer part of the action key name.
</td></tr>
<tr><th>key</th>
<td>An <var>ActionKey</var> enumeration variable or expression.
</td></tr></table>
 
==See also==


*The [[List of Screen methods|"List of Screen methods"]] and the [[List of ScreenField methods|"List of ScreenField methods"]]  
*The [[List of Screen methods|"List of Screen methods"]] and the [[List of ScreenField methods|"List of ScreenField methods"]]  

Revision as of 01:39, 17 August 2011

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 UL/SPF customer, you can also find screen object coding examples in the SIRIUS file.

Screens and ScreenFields

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.

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. 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 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.

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.

Besides the common enumeration 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 that is assigned the integer part of the action key name.
key An ActionKey enumeration variable or expression.

See also