UTS Connect User's Guide

APPENDIX B

UTS Display Attributes

The Screen.getAttribute() method will return one of the values shown below, representing the current attribute state of the onscreen character at the given location. The attributes listed below are just the most common and any combination of what is stated below could, theoretically occur. Basically, underlined, bold, blinking and reverse characters return a standard integer. This is then added to the hexadecimal number indicating whether the field is secure, protected, selected and/or vertical.

Number

Attribute

0

standard (can type into - e.g., entry field)

16 (0X10)

secure (can type into - e.g., passwords)

32 (0X20)

protected (cannot type into)

33 (0X20)+1

protected and underlined

34 (0X20)+2

protected and bold

36 (0X20)+4

protected and blinking

40 (0X20)+8

protected and reverse

48 (0X10)+(0X20)

secure and protected

64 (0X40)

selected

80 (0X40) + (0X10)

selected and secure

96 (0X20)+(0X40)

selected and protected

98 (0X20)+(0X40)+2

selected, protected and bold

0X100

vertical

Viewing All Character Attributes at Once

Using the Screen.getAttribute() method, you can easily write a function that captures all attributes (at all screen locations) at once. The following custom script, for example, can be used at design time to display screen attributes in an alert dialog.

  function showAttributes( myScreen )
  {
       var attribs = new String(); // create empty string
       // Iterate over all rows and columns:
  for (var i = 1; i <= myScreen.getRows(); i++, attribs += "\n" )
            for (var k = 1; k <= myScreen.getCols(); k++)
                 attribs += " " + myScreen.getAttribute(i,k);
  } 

In your Action Model, you would include a function action with the following ECMAScript expression to call the script.:

  alert(showAttributes( Screen ));

The following illustration shows a UTS screen:

leo

The illustration below shows the result of applying the showAttributes() function to the screen (the illustration had to be cropped as the right/left margin would have gone outside the boundaries of the page):

leoAtts



Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...