home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Electronic Whole Earth Catalog
/
ElectronicWholeEarthCatalog.img
/
INTRODUCTION
/
background_5789.txt
< prev
next >
Wrap
Text File
|
1989-02-08
|
11KB
|
523 lines
-- background: 5789 from stack: in
-- bmap block id: 9647
-- flags: 0000
-- background id: 0
-- name: Review
-- part 1 (field)
-- low flags: 01
-- high flags: 2000
-- rect: left=28 top=65 right=315 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 17
-- part name: theReview
----- HyperTalk script -----
-- bg fld "theReview" script
on mouseUp
checkForXref
end mouseUp
on checkForXref
lock screen
set the lockText of the target to false
select before text of the target
click at the clickLoc
put word 4 of the selectedChunk into where
select empty
set the lockText of the target to true
unlock screen
put char where of fld "theReview" into char1
put char (where+1) of fld "theReview" into char2
if chartonum(char1) is 217 then
goReviewXref
else if chartonum(char2) is 217 then
goReviewXref
end if
end checkForXref
on goReviewXref
if fld "xrefDest" is not empty then
lookup fld "xrefDest", "zoom open"
else if fld "xrefAcc" is not empty then
lookup fld "xrefAcc", "zoom open"
end if
end goReviewXref
-- part 2 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=304 top=9 right=27 bottom=481
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 18
-- part name: theTopic
-- part 3 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=345 top=22 right=41 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: theHeading
----- HyperTalk script -----
on mouseDown
popMenuArticle
end mouseDown
-- part 4 (field)
-- low flags: 01
-- high flags: 2000
-- rect: left=28 top=42 right=66 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 14
-- style flags: 8448
-- line height: 18
-- part name: theTitle
-- part 5 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=354 top=318 right=338 bottom=456
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 15
-- part name: thePage
-- part 6 (field)
-- low flags: 81
-- high flags: 4002
-- rect: left=255 top=0 right=18 bottom=396
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: theIdent
-- part 7 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=463 top=139 right=173 bottom=508
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Map
----- HyperTalk script -----
on mouseUp
doArticleMapButton
end mouseUp
-- part 17 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=463 top=88 right=130 bottom=507
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Earth
----- HyperTalk script -----
on mouseUp
goWholeEarth
end mouseUp
-- part 21 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=482 top=184 right=230 bottom=507
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Right
----- HyperTalk script -----
on mouseUp
doArticleRightButton
end mouseUp
-- part 22 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=463 top=232 right=275 bottom=488
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Left
----- HyperTalk script -----
on mouseUp
doArticleLeftButton
end mouseUp
-- part 23 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=0 top=172 right=232 bottom=165
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name: Popup
-- part 25 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=0 top=0 right=18 bottom=86
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Accession
-- part 27 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=353 top=317 right=338 bottom=386
-- title width / last selected line: 0
-- icon id / first selected line: 1014 / 1014
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Up
----- HyperTalk script -----
on mouseUp
doArticleUpButton
end mouseUp
-- part 28 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=423 top=317 right=338 bottom=453
-- title width / last selected line: 0
-- icon id / first selected line: 1013 / 1013
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Down
----- HyperTalk script -----
on mouseUp
doArticleDownButton
end mouseUp
-- part 29 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=113 top=323 right=342 bottom=171
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: xrefAcc
-- part 31 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=410 top=128 right=143 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: MapDest
-- part 32 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=410 top=272 right=287 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: LeftDest
-- part 33 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=410 top=225 right=240 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: RightDest
-- part 34 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=354 top=285 right=300 bottom=456
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: UpDest
-- part 35 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=354 top=301 right=316 bottom=456
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: DownDest
-- part 36 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=163 top=172 right=232 bottom=277
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name: PopupDest
-- part 38 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=0 top=306 right=324 bottom=189
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: xrefDest
-- part 40 (button)
-- low flags: 80
-- high flags: 8002
-- rect: left=0 top=323 right=342 bottom=114
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Xref
----- HyperTalk script -----
-- Xref button for Review cards
on mouseUp
makeNewXref
end mouseUp
function findRabbit
put numtochar(217) into rabbit
put fld "theReview" into cardText
put findNext(rabbit, 0, cardText) into rabbitPos
-- use my XFCN findNext because HC's Find and offset() will
-- return position of 'y' as lower-case version of rabbit
-- findNext returns -1 if not found, or the position (zero-based)
if rabbitPos = -1 then
return 0
else
return rabbitPos + 1
end if
end findRabbit
on cancelThisXref
put findRabbit() into oldXref
if oldXref <> 0 then
delete char oldXref of fld "theReview"
put empty into fld "xrefAcc"
put empty into fld "xrefDest"
end if
end cancelThisXref
function wantsXref
global xrefTextPos
put true into getXrefFlag
-- check for old cross reference
put findRabbit() into oldXref
if oldXref <> 0 then
answer "What do you want to do with old xref?" with "Replace" or "Delete" or "Cancel"
if it is "Replace" then
delete char oldXref of fld "theReview"
put empty into fld "xrefAcc"
put true into getXrefFlag
else if it is "Delete" then
delete char oldXref of fld "theReview"
put empty into fld "xrefAcc"
put false into getXrefFlag
else if it is "Cancel" then
put false into getXrefFlag
end if
end if
if getXrefFlag is true then
-- get mouse click; if it's in theReview, deal with it
wait until the mouseClick
put numtochar(217) into rabbit
put the rect of fld "theReview" into reviewR
if the clickLoc is within reviewR then
click at the clickLoc
answer "Insert cross reference here?" with "OK" or "Cancel"
if it is "OK" then
lock screen
type rabbit
put findRabbit() into xrefTextPos
delete char xrefTextPos of fld "theReview"
unlock screen
else if it is "Cancel" then
put false into getXrefFlag
end if
end if
end if
return getXrefFlag
end wantsXref
-- works as a message sent from Xref Tools stack after user has
-- selected a cross reference.
on installNewXref linkTitle, linkAcc, linkID
global xrefTextPos
if linkAcc is empty then
put empty into fld "xrefAcc"
put empty into fld "xrefDest"
else
put linkID into fld "xrefDest"
put linkAcc into fld "xrefAcc"
put numtochar(217) && linkTitle & Space after char xrefTextPos of fld "theReview"
end if
end installNewXref
-----------------------------------------------------------------------
-- makeNewXref
--
--
-----------------------------------------------------------------------
on makeNewXref
global xrefStack, xrefReturn, xrefLooking
if short name of this bg is not "Review" then exit makeNewXref
set the hilite of target to true
put the lockText of fld "theReview" into lockState
if lockState then
set the lockText of fld "theReview" to false
end if
put wantsXref() into xrefFlag
set the hilite of target to false
set the lockText of fld "theReview" to lockState
if xrefFlag is true then
push card
pop card into xrefReturn
put true into xrefLooking
put short name of this stack into theDomain
if xrefStack is empty then -- user hasn't opened Tools stack yet
go to stack "Xref Tools" -- user will show HC the way to Xref Tools
end if
go to card theDomain of xrefStack
end if
end makeNewXref