The Table Display Class

This container is somewhat different from a window or layout, in that all children are of the class tableField and, if necessary, are re-bound to that class when a table is bound. If a table object is altered so as to omit some of its original children, the usual specification rule applies: those children remain on the screen, but not as part of the table object. Instead, they have independent displays, in the formats of their default display classes. In particular, they do not remain bound to the class tableField. An object can be bound to the tableField class only by A+ and only as a child of a table object. The children of a table object must be unique.

A variable can be bound to the table display class if it is a scalar or vector consisting of object symbols. The child objects, which are also called fields of the table, can be vectors or simple character matrices; they cannot appear more than once in the table variable. The display consists of a title area and a value area. The value area has a title bar on top that holds the names of the fields, while the area below consists of delineated cells, one column for each field. The fields appear on the screen in the same left to right order as their symbols appear in the variable that is bound to the table class. The top cell of each field is the first element of the corresponding variable; in the case of a character matrix field, the cells correspond to rows of the matrix and the top cell is the first row.

If a table requires more than just a few cells, then by default only a subtable is presented on the screen, and the display is provided with scrollbars. If the table fields have different numbers of elements, then whether or not a vertical scrollbar is used depends on the number of elements in the first field (i.e., t[0] for a table t). The particular subarray that appears in the value area can be controlled by the scrollbars and settings of the attributes firstrow, firstcol, rows and cols. Neither by scrollbars nor by firstrow is it possible to display rows for which the first field has no value: the number of elements in the first field completely controls the rows that can be displayed. If the table fields have different numbers of elements and you want to allow the display of all elements, the first field must have at least as many elements as any other field. For a table, the attribute firstcol refers to the leftmost field shown, and cols refers to the number of fields.

Be aware of one situation that can occur. Suppose a visible field is dependent upon the first field and another field, c:a+b, say. If a strand assignment changing their lengths is made to a and b, what happens depends upon the order in which the individual assignments are made. If the assignment to the first field is made last, there is no problem. Otherwise, the assignment to the first field causes the table to use its new length to determine the range of the vertical scrollbar and that involves materializing the field "too early", when a and b have unequal lengths, causing a length error in the evaluation of c. One workaround, as implied above, is to see that the first field is set last. Another is to unmap the table, perform the assignment, and then map it again.

Visual Representation
     thousandsū10«hundredsū10«tensū10«onesūÉ10
     tū`ones`tens`hundreds`thousands
     `t is `table
     `t has (`shelltitle;'t')
     show `t

A Table of Numeric Fields:

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

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

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
blank
bound
breakfont
breakstyle
children
class
clear
col
colors
cols
colsep
columncontrol
columnpagespan
columnresize
columnspacing
copy
currentbreakcolumn
cycle
deiconized
delete
descendents
doc
downto
dragdrop
dynamic
edit
editbg
editfg
editspace
eval
evaluate
execute
exit
extent
f1-f12
familytree
fg
field
fields
firstcol
firstfield
firstrow
fixedfields
fixedreportcolumns
fkeys
focus
followers
followertree
font
foot
framelinewidth
frameoffset
framestyle
freeze
fullscreen
h
H
has
head
headingstyle
hide
hl
hlthickness
hscrollsize
hscrollwith
icon
iconic
iconized
icontitle
in
incurrentworkspace
index
insertabove
insertbelow
is
l
leader
leading
leftto
literal
lower
mapped
na
naturalsize
newshow
newspapercolumn
notify
out
outofcurrentworkspace
outputstyle
parent
pin
preset
primary
protect
protected
r
raise
realize
recursively
refer
refresh
reparent
reportfont
reportheadingfont
reporttotalfont
reporttotalleading
reporttotalon
reporttotalstyle
request
reshow
resize
resizeable
respace
rightto
row
rowbg
rowcontrol
rowpagespan
rows
rowsep
script
scrollbg
scrollsize
select
selectbg
selected
selectedfield
selectfield
selectionmode
sensitive
set
setcol
setfirstcol
setfirstrow
setrow
settings
shadowthickness
shell
shelltitle
show
size
space
stars
state
stateself
style
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
vscrollsize
vscrollwith
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs

The keys in the Table of All Display Attributes that pertain to the tableField display class are tF and ALL.

The attributes that are meaningful for the tableField display class are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowright
arrowup
bg
bggrayscale
blank
bound
breakbggrayscale
breakcriteriafunc
breakfggrayscale
breakfont
breakleading
breakoffset
breakon
breakprocessfunc
breakprocesson
breakstyle
breaktext
class
colors
columnalignment
computationmode
copy
cycle
doc
done
editspace
eval
evaluate
execute
f1-f12
fg
fggrayscale
fkeys
font
formatbreakfunc
has
headingbggrayscale
headingfggrayscale
headingstyle
in
is
literal
mapped
na
out
pagebreakon
parent
preset
protect
protected
reportfont
reportheadingfont
respace
set
settings
shell
space
stars
state
stateself
style
suppressduplicate
title
titlefg
titlefont
verify
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.