Text preview for : 12_Text_Building_Block.pdf part of apple 12 Text Building Block apple lisa toolkit_3.0 Package_2_Examples 12_Text_Building_Block.pdf
Back to : 12_Text_Building_Block.pd | Home
Text
Building
Block
To: Users of the TOOlKit's Text Building BloCk
From:
Date: 21 Marcr! 1984
Subject: How to use the Text Building Block (TK8E) (draft version 3)
==============================================:====================-========:==
When reading this document it is suggested that you have a copy of the UText
interface available for reference.
The Text Building Block allows users to specify an LRect in their view irl w~ii:~;ri
m..Jltiple paragraphs may be entered either from the keyooara or pasted frOlT tne
clipboard. "i thin this box, te>tt klill word klrap based on the bounos of t!'"l~ b:JY
and optional 1ndentation fields 1n the TPara=ornet object. Trlese fields oe-foiJl t
to zero, thus if the values are not Changed, the text kl1ll fit tig!"ltly 11.:1 tnir:
the LRect specified. (Currently only left justified text is supported so trtere
klill be a ragged right edge.)
Application programmers must create a TTextlmage for eaCh separate grouo Of te~t
they wiSh to display. The CREATE method expects an LReet within its vie~. Ir:
adOi tion, the 1sGro~le ooolea!! parameter speCifies Whether or not tr,e LRect
can grow at the bottom if text that is oisplayea cannot fit in the spe:ifiEJ
LRect.
Textlmages display TText Objects. A TText Object contains a list Of TParagr~~
oOjects. EaCh TParaglaph Object contains the characters ana typeStyle
1nformation for one paragraprl. Associated wit~ eaCh paragraph is a TParaImage
wrl1c~ 1s stored 1n a list Of TParaImages in TTextlnage. A TParaImage cO;ltains
all Of the display specific information about a particular paragraptl suerl a~
where each line ends and tne pixel height of the displayed paragratJn. Wrte:-I a
TIextlmage is created, 1t nust have an 1nit1al TText object. Ttle next oeject,
in turn, rust nave at least one paragraph 1n its paragraph l1st. Also, eaCf,
paragrap~ points to a TParaFormat, Whicrl spec1fies margins, taos, paragraph
spacing and other formatting Characteristics.
TParaFormats are stored in a TStyleSheet, WhiCh is simply a list Of
TParaFormats. Since the list is an indexed list, one can store commonly U$eo
form&ts at known posi tioras in ttte list for rapia retrieval when reformatting a
part1CUlar paragraph. Typically, app11cations store a single styleSrleet in a
fie10 Of their applicat10n windOW. Eacn TText ooject, 1n adaition to containing
a 11st -Of paragraphS also points to a styleSheet. By storing ttle styleSheet in
the w1naow, eaCh next Object can refer-ence tr.e sarne styleStleet.
Text Butldlrtg BlOCk