12 Text Building Block
12 Text Building Block
Lisa · 1984 · PDF
| Filename | 12_Text_Building_Block.pdf |
|---|---|
| Size | 1.48 MB |
| Year | 1984 |
| Subsection | toolkit_3.0 / Package_2_Examples |
| Downloads | 3 |
Enjoying MacTrove?
Anonymous downloads are free and unlimited.
Create a free account to track favorites,
contribute metadata corrections, and join the
community chat.
Reader
Loading…
OCR / Text contents
Text
Building
Block
To:
From:
Date:
Subject:
Users of the TOOlKit's Text Building BloCk
21 Marcr! 1984
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 ••••••••••••••.•••.•.••.•..•..•...•....•.....••••.•.....•.•..••.....•••.•................... PaQe 1
The typical order of allocation is then: Create a waraFormat. tnen create a
TStyleSheet and install the paraFormat in its list. Set TAppllnaow.styleSheet
to tne ne:J) stylesr'eet. create a paragraptl, passing the paraFormat just createa.
Create a next ObJect and install the parag~ just created in its paragraphs
list and trle set styleSheet field to the new styleSheet. Now cr…
Showing first 3,000 characters of 69,498 total. Open the full document →