The Notebook Display Class

The notebook is a special layout class for displaying several pages of objects in a compact and easily accessible manner. It has somewhat the appearance of a notebook with tabs, showing one page fully and just tabs and edges for other pages. Each child has its own page, and can, of course, be of any class, including a layout or notebook. The notebook does not honor any constraints on a child, configuring it for the available space.

The user can choose an object to be shown by clicking on the tab of its page, which causes the currentpage attribute to be set to the name of the object and thus that page to be shown. This causes a `pagechangecb callback.

The tabs are actually arranged in a line (rather than apparently attached to the pages), and as many are shown as will fit in the window. When not all are shown, scrolling arrows are provided. The tab of the page being shown is absent if it is outside the range of tabs being shown. Otherwise, it is shown attached to its page and aligned with the position in which it would appear if its page were not being shown.

The backpages attribute controls the apparent thickness of the notebook, i.e., the number of page edges depicted. It is not related to either the number of pages in the notebook or the number of tabs that are shown.

The backpagefg and backpagebg attributes control the colors of the tabs and page edges, but not of the titles on the tabs, which obey the fg attribute (and use the various title... attributes for their text).

Notebooks can be shown in horizontal or vertical orientation, that is, with binding left and tabs right or binding top and tabs bottom. The spiral binding can be shown or not, and its width (diameter) can be specified. The current page (with its tab, if shown) is outlined by a frame, half highlighted and half in shadow, which, especially when thickened, gives it a strange raised and beveled appearance. The background color (framebg) and thickness (framethickness) of that frame can be specified; 0 thickness makes it vanish. There are margins around an object on its page. The top and bottom margins are controlled by the marginheight attribute, the left and right by marginwidth.

Visual Representation
  `page1 is `view    page180 40" view "
  `page2 is `scalar  page2"scalar"
  page310 10
  `page3 has (`class;`array; `title;'Page 3')
  nb`page1 `page2 `page3
  `nb is `notebook
  `nb has (`title;'Sample Notebook';
           `shelltitle;'Window with Notebook')
  `page1 has (`pagetitle;"1. View")    Insert titles for the tabs,
  `page2 has (`pagetitle;"2. Scalar")  after making the objects
  `page3 has (`pagetitle;"3. Array")   the children of notebook.
   To make the tabs readable, lighten their background.
  `nb has `backpagebg `deepskyblue
   Place the third page at the front.
  `nb has (`currentpage;`page3)
  `nb has (`bg;`white)
  `nb has (`selectedpagebg;`yellow)
  show `nb

Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the notebook 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 O, ALL, CNFT, CNT, NFT, and TOP.

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

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
backpagebg
backpagefg
backpages
backpagethickness
be
bg
bindingwidth
blank
borderheight
borderwidth
bound
children
class
clear
copy
currentpage
deiconized
descendents
doc
downto
dynamic
eval
evaluate
exit
extent
extents
f1-f12
familytree
fg
fkeys
focus
followers
followertree
font
foot
framebg
framethickness
freeze
fullscreen
H
h
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
literal
locksize
lower
mapped
marginheight
marginwidth
naturalsize
newshow
notify
orientation
outofcurrentworkspace
pagechangecb
parent
pin
preset
primary
r
raise
realize
recursively
refresh
reparent
request
reshow
resize
resizeable
rightto
script
selectedpagebg
selectedpagefg
sensitive
set
settings
shadowthickness
shell
shelltitle
show
showbinding
showpopup
showtabs
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
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)


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