home *** CD-ROM | disk | FTP | other *** search
/ The Electronic Whole Earth Catalog / ElectronicWholeEarthCatalog.img / LEARNING / background_4284.txt < prev    next >
Text File  |  1989-02-07  |  11KB  |  523 lines

  1. -- background: 4284 from stack: in
  2. -- bmap block id: 15186
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: Review
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 01
  10. -- high flags: 2000
  11. -- rect: left=28 top=65 right=315 bottom=463
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 17
  19. -- part name: theReview
  20. ----- HyperTalk script -----
  21. -- bg fld "theReview" script
  22. on mouseUp
  23.   checkForXref
  24. end mouseUp
  25.  
  26. on checkForXref
  27.   lock screen
  28.   set the lockText of the target to false
  29.   select before text of the target
  30.   click at the clickLoc
  31.   put word 4 of the selectedChunk into where
  32.   select empty
  33.   set the lockText of the target to true
  34.   unlock screen
  35.  
  36.   put char where of fld "theReview" into char1
  37.   put char (where+1) of fld "theReview" into char2
  38.   if chartonum(char1) is 217 then
  39.     goReviewXref
  40.   else if chartonum(char2) is 217 then
  41.     goReviewXref
  42.   end if
  43. end checkForXref
  44.  
  45. on goReviewXref
  46.   if fld "xrefDest" is not empty then
  47.     lookup fld "xrefDest", "zoom open"
  48.   else if fld "xrefAcc" is not empty then
  49.     lookup fld "xrefAcc", "zoom open"
  50.   end if
  51. end goReviewXref
  52.  
  53.  
  54.  
  55.  
  56. -- part 2 (field)
  57. -- low flags: 81
  58. -- high flags: 0002
  59. -- rect: left=304 top=9 right=27 bottom=481
  60. -- title width / last selected line: 0
  61. -- icon id / first selected line: 0 / 0
  62. -- text alignment: 0
  63. -- font id: 3
  64. -- text size: 9
  65. -- style flags: 0
  66. -- line height: 18
  67. -- part name: theTopic
  68.  
  69.  
  70. -- part 3 (field)
  71. -- low flags: 01
  72. -- high flags: 0002
  73. -- rect: left=345 top=22 right=41 bottom=463
  74. -- title width / last selected line: 0
  75. -- icon id / first selected line: 0 / 0
  76. -- text alignment: 1
  77. -- font id: 0
  78. -- text size: 12
  79. -- style flags: 0
  80. -- line height: 16
  81. -- part name: theHeading
  82. ----- HyperTalk script -----
  83. on mouseDown
  84.   popMenuArticle
  85. end mouseDown
  86.  
  87.  
  88.  
  89. -- part 4 (field)
  90. -- low flags: 01
  91. -- high flags: 2000
  92. -- rect: left=28 top=42 right=66 bottom=463
  93. -- title width / last selected line: 0
  94. -- icon id / first selected line: 0 / 0
  95. -- text alignment: 0
  96. -- font id: 3
  97. -- text size: 14
  98. -- style flags: 8448
  99. -- line height: 18
  100. -- part name: theTitle
  101.  
  102.  
  103. -- part 5 (field)
  104. -- low flags: 01
  105. -- high flags: 0000
  106. -- rect: left=354 top=318 right=338 bottom=456
  107. -- title width / last selected line: 0
  108. -- icon id / first selected line: 0 / 0
  109. -- text alignment: 1
  110. -- font id: 3
  111. -- text size: 9
  112. -- style flags: 0
  113. -- line height: 15
  114. -- part name: thePage
  115.  
  116.  
  117. -- part 6 (field)
  118. -- low flags: 81
  119. -- high flags: 4002
  120. -- rect: left=255 top=0 right=18 bottom=396
  121. -- title width / last selected line: 0
  122. -- icon id / first selected line: 0 / 0
  123. -- text alignment: 0
  124. -- font id: 3
  125. -- text size: 12
  126. -- style flags: 0
  127. -- line height: 16
  128. -- part name: theIdent
  129.  
  130.  
  131. -- part 7 (button)
  132. -- low flags: 00
  133. -- high flags: 0000
  134. -- rect: left=463 top=139 right=173 bottom=508
  135. -- title width / last selected line: 0
  136. -- icon id / first selected line: 0 / 0
  137. -- text alignment: 1
  138. -- font id: 0
  139. -- text size: 12
  140. -- style flags: 0
  141. -- line height: 16
  142. -- part name: Map
  143. ----- HyperTalk script -----
  144. on mouseUp
  145.   doArticleMapButton
  146. end mouseUp
  147.  
  148.  
  149.  
  150. -- part 17 (button)
  151. -- low flags: 00
  152. -- high flags: 0000
  153. -- rect: left=463 top=88 right=130 bottom=507
  154. -- title width / last selected line: 0
  155. -- icon id / first selected line: 0 / 0
  156. -- text alignment: 1
  157. -- font id: 0
  158. -- text size: 12
  159. -- style flags: 0
  160. -- line height: 16
  161. -- part name: Earth
  162. ----- HyperTalk script -----
  163. on mouseUp
  164.   goWholeEarth
  165. end mouseUp
  166.  
  167.  
  168.  
  169. -- part 18 (button)
  170. -- low flags: 00
  171. -- high flags: 0000
  172. -- rect: left=423 top=317 right=338 bottom=453
  173. -- title width / last selected line: 0
  174. -- icon id / first selected line: 1013 / 1013
  175. -- text alignment: 1
  176. -- font id: 0
  177. -- text size: 12
  178. -- style flags: 0
  179. -- line height: 16
  180. -- part name: Down
  181. ----- HyperTalk script -----
  182. on mouseUp
  183.   doArticleDownButton
  184. end mouseUp
  185.  
  186.  
  187.  
  188. -- part 19 (button)
  189. -- low flags: 00
  190. -- high flags: 0000
  191. -- rect: left=353 top=317 right=338 bottom=386
  192. -- title width / last selected line: 0
  193. -- icon id / first selected line: 1014 / 1014
  194. -- text alignment: 1
  195. -- font id: 0
  196. -- text size: 12
  197. -- style flags: 0
  198. -- line height: 16
  199. -- part name: Up
  200. ----- HyperTalk script -----
  201. on mouseUp
  202.   doArticleUpButton
  203. end mouseUp
  204.  
  205.  
  206.  
  207. -- part 21 (button)
  208. -- low flags: 00
  209. -- high flags: 0000
  210. -- rect: left=482 top=184 right=230 bottom=507
  211. -- title width / last selected line: 0
  212. -- icon id / first selected line: 0 / 0
  213. -- text alignment: 1
  214. -- font id: 0
  215. -- text size: 12
  216. -- style flags: 0
  217. -- line height: 16
  218. -- part name: Right
  219. ----- HyperTalk script -----
  220. on mouseUp
  221.   doArticleRightButton
  222. end mouseUp
  223.  
  224.  
  225.  
  226. -- part 22 (button)
  227. -- low flags: 00
  228. -- high flags: 0000
  229. -- rect: left=463 top=232 right=275 bottom=488
  230. -- title width / last selected line: 0
  231. -- icon id / first selected line: 0 / 0
  232. -- text alignment: 1
  233. -- font id: 0
  234. -- text size: 12
  235. -- style flags: 0
  236. -- line height: 16
  237. -- part name: Left
  238. ----- HyperTalk script -----
  239. on mouseUp
  240.   doArticleLeftButton
  241. end mouseUp
  242.  
  243.  
  244.  
  245. -- part 23 (field)
  246. -- low flags: 81
  247. -- high flags: 0002
  248. -- rect: left=0 top=172 right=232 bottom=165
  249. -- title width / last selected line: 0
  250. -- icon id / first selected line: 0 / 0
  251. -- text alignment: 0
  252. -- font id: 3
  253. -- text size: 10
  254. -- style flags: 0
  255. -- line height: 13
  256. -- part name: Popup
  257.  
  258.  
  259. -- part 24 (field)
  260. -- low flags: 81
  261. -- high flags: 0002
  262. -- rect: left=0 top=0 right=18 bottom=86
  263. -- title width / last selected line: 0
  264. -- icon id / first selected line: 0 / 0
  265. -- text alignment: 0
  266. -- font id: 3
  267. -- text size: 12
  268. -- style flags: 0
  269. -- line height: 16
  270. -- part name: Accession
  271.  
  272.  
  273. -- part 26 (field)
  274. -- low flags: 81
  275. -- high flags: 0002
  276. -- rect: left=113 top=323 right=342 bottom=171
  277. -- title width / last selected line: 0
  278. -- icon id / first selected line: 0 / 0
  279. -- text alignment: 0
  280. -- font id: 3
  281. -- text size: 9
  282. -- style flags: 0
  283. -- line height: 12
  284. -- part name: xrefAcc
  285.  
  286.  
  287. -- part 28 (field)
  288. -- low flags: 81
  289. -- high flags: 0002
  290. -- rect: left=410 top=128 right=143 bottom=512
  291. -- title width / last selected line: 0
  292. -- icon id / first selected line: 0 / 0
  293. -- text alignment: 0
  294. -- font id: 4
  295. -- text size: 9
  296. -- style flags: 0
  297. -- line height: 12
  298. -- part name: MapDest
  299.  
  300.  
  301. -- part 29 (field)
  302. -- low flags: 81
  303. -- high flags: 0002
  304. -- rect: left=410 top=272 right=287 bottom=512
  305. -- title width / last selected line: 0
  306. -- icon id / first selected line: 0 / 0
  307. -- text alignment: 0
  308. -- font id: 4
  309. -- text size: 9
  310. -- style flags: 0
  311. -- line height: 12
  312. -- part name: LeftDest
  313.  
  314.  
  315. -- part 30 (field)
  316. -- low flags: 81
  317. -- high flags: 0002
  318. -- rect: left=410 top=225 right=240 bottom=512
  319. -- title width / last selected line: 0
  320. -- icon id / first selected line: 0 / 0
  321. -- text alignment: 0
  322. -- font id: 4
  323. -- text size: 9
  324. -- style flags: 0
  325. -- line height: 12
  326. -- part name: RightDest
  327.  
  328.  
  329. -- part 31 (field)
  330. -- low flags: 81
  331. -- high flags: 0002
  332. -- rect: left=354 top=285 right=300 bottom=456
  333. -- title width / last selected line: 0
  334. -- icon id / first selected line: 0 / 0
  335. -- text alignment: 0
  336. -- font id: 4
  337. -- text size: 9
  338. -- style flags: 0
  339. -- line height: 12
  340. -- part name: UpDest
  341.  
  342.  
  343. -- part 32 (field)
  344. -- low flags: 81
  345. -- high flags: 0002
  346. -- rect: left=354 top=301 right=316 bottom=456
  347. -- title width / last selected line: 0
  348. -- icon id / first selected line: 0 / 0
  349. -- text alignment: 0
  350. -- font id: 4
  351. -- text size: 9
  352. -- style flags: 0
  353. -- line height: 12
  354. -- part name: DownDest
  355.  
  356.  
  357. -- part 33 (field)
  358. -- low flags: 81
  359. -- high flags: 0002
  360. -- rect: left=163 top=172 right=232 bottom=277
  361. -- title width / last selected line: 0
  362. -- icon id / first selected line: 0 / 0
  363. -- text alignment: 0
  364. -- font id: 3
  365. -- text size: 10
  366. -- style flags: 0
  367. -- line height: 13
  368. -- part name: PopupDest
  369.  
  370.  
  371. -- part 36 (field)
  372. -- low flags: 81
  373. -- high flags: 0002
  374. -- rect: left=0 top=306 right=324 bottom=189
  375. -- title width / last selected line: 0
  376. -- icon id / first selected line: 0 / 0
  377. -- text alignment: 0
  378. -- font id: 4
  379. -- text size: 9
  380. -- style flags: 0
  381. -- line height: 12
  382. -- part name: xrefDest
  383.  
  384.  
  385. -- part 39 (button)
  386. -- low flags: 80
  387. -- high flags: 8002
  388. -- rect: left=0 top=323 right=342 bottom=114
  389. -- title width / last selected line: 0
  390. -- icon id / first selected line: 0 / 0
  391. -- text alignment: 1
  392. -- font id: 0
  393. -- text size: 12
  394. -- style flags: 0
  395. -- line height: 16
  396. -- part name: Xref
  397. ----- HyperTalk script -----
  398. -- Xref button for Review cards
  399. on mouseUp
  400.   makeNewXref
  401. end mouseUp
  402.  
  403. function findRabbit
  404. put numtochar(217) into rabbit
  405. put fld "theReview" into cardText
  406. put findNext(rabbit, 0, cardText) into rabbitPos
  407.  
  408. -- use my XFCN findNext because HC's Find and offset() will
  409. -- return position of 'y' as lower-case version of rabbit
  410. -- findNext returns -1 if not found, or the position (zero-based)
  411. if rabbitPos = -1 then
  412.   return 0
  413. else
  414.   return rabbitPos + 1
  415. end if
  416. end findRabbit
  417.  
  418. on cancelThisXref
  419.   put findRabbit() into oldXref
  420.   if oldXref <> 0 then
  421.     delete char oldXref of fld "theReview"
  422.     put empty into fld "xrefAcc"
  423.     put empty into fld "xrefDest"
  424.   end if
  425. end cancelThisXref
  426.  
  427. function wantsXref
  428. global xrefTextPos
  429.  
  430. put true into getXrefFlag
  431.  
  432. -- check for old cross reference
  433. put findRabbit() into oldXref
  434. if oldXref <> 0 then
  435.   answer "What do you want to do with old xref?" with "Replace" or "Delete" or "Cancel"
  436.   if it is "Replace" then
  437.     delete char oldXref of fld "theReview"
  438.     put empty into fld "xrefAcc"
  439.     put true into getXrefFlag
  440.   else if it is "Delete" then
  441.     delete char oldXref of fld "theReview"
  442.     put empty into fld "xrefAcc"
  443.     put false into getXrefFlag
  444.   else if it is "Cancel" then
  445.     put false into getXrefFlag
  446.   end if
  447. end if
  448.  
  449. if getXrefFlag is true then
  450.   -- get mouse click; if it's in theReview, deal with it
  451.   wait until the mouseClick
  452.   put numtochar(217) into rabbit
  453.   put the rect of fld "theReview" into reviewR
  454.   if the clickLoc is within reviewR then
  455.     click at the clickLoc
  456.     answer "Insert cross reference here?" with "OK" or "Cancel"
  457.     if it is "OK" then
  458.       lock screen
  459.       type rabbit
  460.       put findRabbit() into xrefTextPos
  461.       delete char xrefTextPos of fld "theReview"
  462.       unlock screen
  463.     else if it is "Cancel" then
  464.       put false into getXrefFlag
  465.     end if
  466.   end if
  467. end if
  468.  
  469. return getXrefFlag
  470. end wantsXref
  471.  
  472. -- works as a message sent from Xref Tools stack after user has
  473. -- selected a cross reference.
  474. on installNewXref linkTitle, linkAcc, linkID
  475.   global xrefTextPos
  476.  
  477.   if linkAcc is empty then
  478.     put empty into fld "xrefAcc"
  479.     put empty into fld "xrefDest"
  480.   else
  481.     put linkID into fld "xrefDest"
  482.     put linkAcc into fld "xrefAcc"
  483.     put numtochar(217) && linkTitle & Space after char xrefTextPos of fld "theReview"
  484.   end if
  485. end installNewXref
  486.  
  487. -----------------------------------------------------------------------
  488. -- makeNewXref
  489. --
  490. --
  491. -----------------------------------------------------------------------
  492. on makeNewXref
  493.   global xrefStack, xrefReturn, xrefLooking
  494.  
  495.   if short name of this bg is not "Review" then exit makeNewXref
  496.  
  497.   set the hilite of target to true
  498.   put the lockText of fld "theReview" into lockState
  499.   if lockState then
  500.     set the lockText of fld "theReview" to false
  501.   end if
  502.  
  503.   put wantsXref() into xrefFlag
  504.   set the hilite of target to false
  505.   set the lockText of fld "theReview" to lockState
  506.  
  507.   if xrefFlag is true then
  508.     push card
  509.     pop card into xrefReturn
  510.     put true into xrefLooking
  511.  
  512.     put short name of this stack into theDomain
  513.     if xrefStack is empty then  -- user hasn't opened Tools stack yet
  514.       go to stack "Xref Tools"  -- user will show HC the way to Xref Tools
  515.     end if
  516.     go to card theDomain of xrefStack
  517.   end if
  518. end makeNewXref
  519.  
  520.  
  521.  
  522.  
  523.