A+ Reference: The Page Display Class

# The Page Display Class

Colors
Page Updates
Key Press Events

> The page display class is designed for displaying page-based information from data services. Objects displayed in this format are character matrices. Normally the matrix is completely displayed; there are no scrollbars, and the firstrow, firstcol, cols, and rows attributes do not apply to page objects. This display class is not designed for large objects that require scrollbars, even though scrolling can be provided by putting a page object inside a window (see "The Window Display Class").

> Page objects cannot be edited directly. However, keyboard entry can be captured with the key and keysym attributes, and therefore entry and edit modes can be programmed. For best behavior, the font in which the page is set should be fixed width (monospaced).

> Boxes can be drawn at the screen. See "User Interactions with Displays", and specifically "Page Objects".

Visual Representation

>          r
>         The Page Display Class

>       This text will illustrate
>       page display class.

>          Òr
>      5 29
>          `r is `page
>          `r has (`underline;5Ùr[,0]¨' ')
>          `r has (`box;1 4Ò2 2 2 25)
>          `r has (`fg;`green)
>          show `r

# Colors

> The fg and bg attributes together determine the color of any box the user draws. The foreground and background colors are not set directly, but rather, in the simplest case, by setting the colormap attribute to be a 1 by 2 matrix whose elements are those colors (and retaining the default setting of the color attribute, Null).

> The foreground and background colors can be set separately for each cell. If you want the cells to be shown in k distinct pairs of colors, set the colormap attribute to a k by 2 matrix whose rows are the pairs (in symbol form), and set the color attribute to an array of row indices of colormap. A nonfunctional setting of color is treated as if it were reshaped to the shape of the underlying character matrix, and each element determines the colors of the corresponding cell. A functional setting must always be a value with the same shape as the underlying character matrix.

> For example, to have stripes, alternating rows of black on grey, blue on peru (brown), and red on tan:

>     cû(ÒPg)[1]    ã Row length
>     Pg .has(`colormap;3 2Ò`black`grey `blue`peru `red`tan;
>             `color;   (cÒ0),(cÒ1),cÒ2);

# Page Updates

> The cells of a page are redrawn when a change to the corresponding elements of the global variable occurs, and automatically reflect the current settings of the bold, color, and underline attributes for those cells. For any particular cell, whenever one of these attributes is a function, the effect of that attribute on the cell is not reflected until the corresponding element of the global variable is changed.

> The blink attribute is somewhat different from the other functional attributes, bold, color, and underline. When it is a function, and when any change to the global variable occurs, the blink function is evaluated for the entire array, not just the part that was changed. Consequently, blinking may be turned on for characters that do not change value.

# Key Press Events

> The value of the keysym attribute is a nested pair of the form (k;s), where the integer k is the ASCII code of the character pressed, and s is a boolean vector of eight integers indicating which modifier keys were pressed when the key press event occurred. These are:

> (Shift, Caps Lock, Control, mod1, mod2, mod3, mod4, mod5)

> where mod1 is Meta and mod2 is NumLock, using the standard A+ profiles. mod3 through mod5 are unused.

> There is no cursor shown for the page display class. There is a cursor attribute, which is set to the pointer position (row and column) whenever any mouse button is pressed while the pointer is on the page. The programmer can account for the usual cursor with the blink attribute. It is up to the programmer to move this "cursor" - i.e., select an appropriate character to blink - based on the key press and mouse button events.

Attributes

> A nonfunctional setting of a functional attribute is treated as if it were reshaped to the shape of the underlying character matrix. A functional setting should always be a value with the same shape as the underlying character matrix.

> See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the page display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are P, ALL, CNFT, NFT, and TOP.

> The attributes that are meaningful for the page display class (other than the print... attributes) are:

> active
> ancestors
> arrowdown
> arrowkeys
> arrowleft
> arrowlist
> arrowright
> arrowup
> at
> atsector
> b
> bg
> blink
> blinkrate
> bold
> bound
> box
> boxcolor
> class
> clear
> color
> colormap
> cursor
> deiconized
> doc
> done
> downto
> dynamic
> eval
> evaluate
> exit
> extent
> f1-f12
> fg
> fkeys
> focus
> followers
> followertree
> font
> foot
> freeze
> fullscreen
> h
> H
> has
> head
> hide
> hl
> hlthickness
> icon
> iconic
> iconized
> icontitle
> incurrentworkspace
> is
> key
> keysym
> l
> leader
> leftto
> line
> linewidth
> literal
> lower
> mapped
> naturalsize
> notify
> outofcurrentworkspace
> parent
> pin
> preset
> primary
> r
> raise
> rband
> rbandbox
> realize
> refresh
> request
> resize
> resizeable
> rightto
> script
> sensitive
> set
> settings
> shadowthickness
> shell
> shelltitle
> show
> state
> stateself
> syncshow
> t
> tabfrom
> tablist
> tabto
> 3down
> 3up
> title
> titlefg
> titlefont
> titlejustify
> 2down
> 2up
> underline
> upto
> vcol
> vcols
> verify
> vrow
> vrows
> w
> W
> ws
> x
> X
> xs
> y
> Y
> ys
> yx
> YX
> yxs (Point the mouse cursor to an attribute to display a short description at the bottom of the screen)