home *** CD-ROM | disk | FTP | other *** search
/ The Electronic Whole Earth Catalog / ElectronicWholeEarthCatalog.img / CRAFT / background_23900.txt < prev    next >
Text File  |  1989-02-07  |  12KB  |  502 lines

  1. -- background: 23900 from stack: in
  2. -- bmap block id: 54544
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: Item Map
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 01
  10. -- high flags: 0000
  11. -- rect: left=44 top=43 right=65 bottom=331
  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: 14
  17. -- style flags: 256
  18. -- line height: 18
  19. -- part name: theTitle
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: 0000
  25. -- rect: left=482 top=184 right=230 bottom=507
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Right
  34. ----- HyperTalk script -----
  35. on mouseUp
  36.   doItemRightButton
  37. end mouseUp
  38.  
  39.  
  40.  
  41. -- part 3 (button)
  42. -- low flags: 00
  43. -- high flags: 0000
  44. -- rect: left=463 top=232 right=275 bottom=488
  45. -- title width / last selected line: 0
  46. -- icon id / first selected line: 0 / 0
  47. -- text alignment: 1
  48. -- font id: 0
  49. -- text size: 12
  50. -- style flags: 0
  51. -- line height: 16
  52. -- part name: Left
  53. ----- HyperTalk script -----
  54. on mouseUp
  55.   doItemLeftButton
  56. end mouseUp
  57.  
  58.  
  59.  
  60. -- part 4 (button)
  61. -- low flags: 00
  62. -- high flags: 0000
  63. -- rect: left=463 top=88 right=130 bottom=507
  64. -- title width / last selected line: 0
  65. -- icon id / first selected line: 0 / 0
  66. -- text alignment: 1
  67. -- font id: 0
  68. -- text size: 12
  69. -- style flags: 0
  70. -- line height: 16
  71. -- part name: Earth
  72. ----- HyperTalk script -----
  73. on mouseUp
  74.   goWholeEarth
  75. end mouseUp
  76.  
  77.  
  78.  
  79. -- part 5 (button)
  80. -- low flags: 00
  81. -- high flags: 0000
  82. -- rect: left=463 top=139 right=173 bottom=508
  83. -- title width / last selected line: 0
  84. -- icon id / first selected line: 0 / 0
  85. -- text alignment: 1
  86. -- font id: 0
  87. -- text size: 12
  88. -- style flags: 0
  89. -- line height: 16
  90. -- part name: Map
  91. ----- HyperTalk script -----
  92. on mouseUp
  93.   doItemMapButton
  94. end mouseUp
  95.  
  96.  
  97. -- part 6 (field)
  98. -- low flags: 81
  99. -- high flags: 0002
  100. -- rect: left=255 top=0 right=18 bottom=396
  101. -- title width / last selected line: 0
  102. -- icon id / first selected line: 0 / 0
  103. -- text alignment: 0
  104. -- font id: 3
  105. -- text size: 12
  106. -- style flags: 0
  107. -- line height: 16
  108. -- part name: theIdent
  109.  
  110.  
  111. -- part 7 (field)
  112. -- low flags: 81
  113. -- high flags: 0002
  114. -- rect: left=0 top=0 right=18 bottom=86
  115. -- title width / last selected line: 0
  116. -- icon id / first selected line: 0 / 0
  117. -- text alignment: 0
  118. -- font id: 3
  119. -- text size: 12
  120. -- style flags: 0
  121. -- line height: 16
  122. -- part name: Accession
  123.  
  124.  
  125. -- part 9 (field)
  126. -- low flags: 81
  127. -- high flags: 0004
  128. -- rect: left=46 top=268 right=324 bottom=249
  129. -- title width / last selected line: 0
  130. -- icon id / first selected line: 0 / 0
  131. -- text alignment: 0
  132. -- font id: 3
  133. -- text size: 9
  134. -- style flags: 0
  135. -- line height: 12
  136. -- part name: xrefs
  137. ----- HyperTalk script -----
  138. on mouseup
  139.   -- go to xref card depending which line was clicked on
  140.  
  141.   -- calculate which line
  142.   -- doesn't work if word-wrap occurred
  143.   put 1 + (the clickV - the top of target) div the textHeight of target into clickedLine
  144.   if line clickedLine of target is not empty then
  145.     put line clickedLine of field "xrefAccs" into targAcc
  146.     if targAcc is not empty then
  147.       set cursor to busy
  148.       -- go there
  149.       lookup targAcc, "zoom open"
  150.     end if
  151.   end if
  152. end mouseup
  153.  
  154.  
  155.  
  156.  
  157. -- part 10 (field)
  158. -- low flags: 81
  159. -- high flags: 0002
  160. -- rect: left=0 top=268 right=324 bottom=57
  161. -- title width / last selected line: 0
  162. -- icon id / first selected line: 0 / 0
  163. -- text alignment: 0
  164. -- font id: 3
  165. -- text size: 9
  166. -- style flags: 0
  167. -- line height: 12
  168. -- part name: xrefAccs
  169.  
  170.  
  171. -- part 11 (field)
  172. -- low flags: 01
  173. -- high flags: 0002
  174. -- rect: left=345 top=22 right=41 bottom=463
  175. -- title width / last selected line: 0
  176. -- icon id / first selected line: 0 / 0
  177. -- text alignment: 1
  178. -- font id: 0
  179. -- text size: 12
  180. -- style flags: 0
  181. -- line height: 16
  182. -- part name: theHeading
  183. ----- HyperTalk script -----
  184. on mouseDown
  185.   popMenuIMap
  186. end mouseDown
  187.  
  188.  
  189.  
  190. -- part 12 (field)
  191. -- low flags: 81
  192. -- high flags: 0004
  193. -- rect: left=246 top=268 right=324 bottom=447
  194. -- title width / last selected line: 0
  195. -- icon id / first selected line: 0 / 0
  196. -- text alignment: 0
  197. -- font id: 3
  198. -- text size: 9
  199. -- style flags: 0
  200. -- line height: 12
  201. -- part name: xrefs2
  202. ----- HyperTalk script -----
  203. on mouseup
  204.   -- go to xref card depending which line was clicked on
  205.  
  206.   -- calculaate which line
  207.   -- doesn't work if word-wrap occurred
  208.   put 1 + (the clickV - the top of target) div the textHeight of target into clickedLine
  209.   if line clickedLine of target is not empty then
  210.     put line clickedLine of field "xrefAccs2" into targAcc
  211.     if targAcc is not empty then
  212.       set cursor to busy
  213.       -- go there
  214.       lookup targAcc, "zoom open"
  215.     end if
  216.   end if
  217. end mouseup
  218.  
  219.  
  220.  
  221. -- part 13 (field)
  222. -- low flags: 81
  223. -- high flags: 0002
  224. -- rect: left=446 top=268 right=324 bottom=502
  225. -- title width / last selected line: 0
  226. -- icon id / first selected line: 0 / 0
  227. -- text alignment: 0
  228. -- font id: 3
  229. -- text size: 9
  230. -- style flags: 0
  231. -- line height: 12
  232. -- part name: xrefAccs2
  233.  
  234.  
  235. -- part 14 (field)
  236. -- low flags: 81
  237. -- high flags: 0002
  238. -- rect: left=159 top=260 right=277 bottom=333
  239. -- title width / last selected line: 0
  240. -- icon id / first selected line: 0 / 0
  241. -- text alignment: 0
  242. -- font id: 3
  243. -- text size: 12
  244. -- style flags: 256
  245. -- line height: 16
  246. -- part name: xrefHeading
  247.  
  248.  
  249. -- part 16 (field)
  250. -- low flags: 81
  251. -- high flags: 0002
  252. -- rect: left=0 top=172 right=232 bottom=165
  253. -- title width / last selected line: 0
  254. -- icon id / first selected line: 0 / 0
  255. -- text alignment: 0
  256. -- font id: 3
  257. -- text size: 10
  258. -- style flags: 0
  259. -- line height: 13
  260. -- part name: popup
  261.  
  262.  
  263. -- part 17 (field)
  264. -- low flags: 81
  265. -- high flags: 0002
  266. -- rect: left=410 top=128 right=143 bottom=512
  267. -- title width / last selected line: 0
  268. -- icon id / first selected line: 0 / 0
  269. -- text alignment: 0
  270. -- font id: 4
  271. -- text size: 9
  272. -- style flags: 0
  273. -- line height: 12
  274. -- part name: MapDest
  275.  
  276.  
  277. -- part 18 (field)
  278. -- low flags: 81
  279. -- high flags: 0002
  280. -- rect: left=410 top=272 right=287 bottom=512
  281. -- title width / last selected line: 0
  282. -- icon id / first selected line: 0 / 0
  283. -- text alignment: 0
  284. -- font id: 4
  285. -- text size: 9
  286. -- style flags: 0
  287. -- line height: 12
  288. -- part name: LeftDest
  289.  
  290.  
  291. -- part 19 (field)
  292. -- low flags: 81
  293. -- high flags: 0002
  294. -- rect: left=410 top=225 right=240 bottom=512
  295. -- title width / last selected line: 0
  296. -- icon id / first selected line: 0 / 0
  297. -- text alignment: 0
  298. -- font id: 4
  299. -- text size: 9
  300. -- style flags: 0
  301. -- line height: 12
  302. -- part name: RightDest
  303.  
  304.  
  305. -- part 20 (field)
  306. -- low flags: 81
  307. -- high flags: 0002
  308. -- rect: left=163 top=172 right=232 bottom=277
  309. -- title width / last selected line: 0
  310. -- icon id / first selected line: 0 / 0
  311. -- text alignment: 0
  312. -- font id: 3
  313. -- text size: 10
  314. -- style flags: 0
  315. -- line height: 13
  316. -- part name: PopupDest
  317.  
  318.  
  319. -- part 21 (field)
  320. -- low flags: 81
  321. -- high flags: 0002
  322. -- rect: left=46 top=236 right=274 bottom=247
  323. -- title width / last selected line: 0
  324. -- icon id / first selected line: 0 / 0
  325. -- text alignment: 0
  326. -- font id: 4
  327. -- text size: 9
  328. -- style flags: 0
  329. -- line height: 12
  330. -- part name: xrefDest
  331.  
  332.  
  333. -- part 22 (field)
  334. -- low flags: 81
  335. -- high flags: 0002
  336. -- rect: left=247 top=236 right=274 bottom=447
  337. -- title width / last selected line: 0
  338. -- icon id / first selected line: 0 / 0
  339. -- text alignment: 0
  340. -- font id: 4
  341. -- text size: 9
  342. -- style flags: 0
  343. -- line height: 12
  344. -- part name: xrefDest2
  345.  
  346.  
  347. -- part 24 (button)
  348. -- low flags: 80
  349. -- high flags: 8002
  350. -- rect: left=0 top=323 right=342 bottom=114
  351. -- title width / last selected line: 0
  352. -- icon id / first selected line: 0 / 0
  353. -- text alignment: 1
  354. -- font id: 0
  355. -- text size: 12
  356. -- style flags: 0
  357. -- line height: 16
  358. -- part name: Xref
  359. ----- HyperTalk script -----
  360. -- xref button for Cluster card
  361. on mouseUp
  362.   makeNewXref
  363. end mouseUp
  364.  
  365. on hideXrefCdFields
  366.   hide cd fld "xrefs"
  367.   hide cd fld "xrefs2"
  368.   hide cd fld "xrefHeading"
  369. end hideXrefCdFields
  370.  
  371. on showXrefCdFields
  372.   show cd fld "xrefs"
  373.   show cd fld "xrefs2"
  374.   show cd fld "xrefHeading"
  375. end showXrefCdFields
  376.  
  377. on deleteXref whichXref
  378.   if whichXref >= 2 and whichXref <= 4 then
  379.     put empty into line whichXref of fld "xrefDest"
  380.     put empty into line whichXref of fld "xrefAccs"
  381.     put empty into line whichXref of fld "xrefs"
  382.     put empty into line whichXref of cd fld "xrefs"
  383.   else if whichXref >= 6 and whichXref <= 8 then
  384.     subtract 4 from whichXref
  385.     put empty into line whichXref of fld "xrefDest2"
  386.     put empty into line whichXref of fld "xrefAccs2"
  387.     put empty into line whichXref of fld "xrefs2"
  388.     put empty into line whichXref of cd fld "xrefs2"
  389.   end if
  390. end deleteXref
  391.  
  392. function isXrefOccupied whichXref
  393. if whichXref >= 2 and whichXref <= 4 then
  394.   if line whichXref of fld "xrefAccs" is empty then
  395.     put false into occupied
  396.   else
  397.     put true into occupied
  398.   end if
  399. else if whichXref >= 6 and whichXref <= 8 then
  400.   if line (whichXref - 4) of fld "xrefAccs2" is empty then
  401.     put false into occupied
  402.   else
  403.     put true into occupied
  404.   end if
  405. end if
  406.  
  407. return occupied
  408. end isXrefOccupied
  409.  
  410. function getXrefClick
  411. put the rect of cd fld "xrefs" into xrefsR
  412. put the rect of cd fld "xrefs2" into xrefs2R
  413. put the textHeight of cd fld "xrefs" into xrefTxHt
  414. put item 2 of xrefsR into xrefTop
  415. wait until the mouseClick
  416.  
  417. if the clickLoc is within xrefsR then
  418.   put 1 + ((the clickV - xrefTop) div xrefTxHt) into whichXref
  419.   if whichXref = 5 then   -- a little of line 5 shows at bottom of field
  420.     put 4 into whichXref
  421.   end if
  422. else if the clickLoc is within xrefs2R then
  423.   put 5 + ((the clickV - xrefTop) div xrefTxHt) into whichXref
  424.   if whichXref = 9 then
  425.     put 8 into whichXref
  426.   end if
  427. else
  428.   put 0  into whichXref
  429. end if
  430.  
  431. -- top lines of xrefs field not used
  432. if whichXref = 1 or whichXref = 5 then
  433.   put 0 into whichXref
  434. end if
  435.  
  436. return whichXref
  437. end getXrefClick
  438.  
  439. on installNewXref linkTitle, linkAcc, linkID
  440.   global currentXref
  441.  
  442.   showXrefCdFields
  443.   put currentXref into whichXref
  444.   if linkAcc is not empty then
  445.     if whichXref >= 2 and whichXref <= 4 then
  446.       put linkID into line whichXref of fld "xrefDest"
  447.       put linkAcc into line whichXref of fld "xrefAccs"
  448.       put linkTitle into line whichXref of fld "xrefs"
  449.       put linkTitle into line whichXref of cd fld "xrefs"
  450.     else if whichXref >= 6 and whichXref <= 8 then
  451.       subtract 4 from whichXref
  452.       put linkID into line whichXref of fld "xrefDest2"
  453.       put linkAcc into line whichXref of fld "xrefAccs2"
  454.       put linkTitle into line whichXref of fld "xrefs2"
  455.       put linkTitle into line whichXref of cd fld "xrefs2"
  456.     end if
  457.   end if
  458. end installNewXref
  459.  
  460. ----------------------- makeNewXref --------------------------------
  461. on makeNewXref
  462.   global currentXref
  463.  
  464.   set hilite of target to true
  465.   showXrefCdFields
  466.   put getXrefClick() into currentXref
  467.   set hilite of target to false
  468.   if currentXref <> 0 then
  469.     if isXrefOccupied(currentXref) is true then
  470.       answer "What do you want to do with this xref?" with "Replace" or "Delete" or "Cancel"
  471.       if it is "Cancel" then
  472.         exit makeNewXref           -- EXIT
  473.       else if it is "Delete" then
  474.         deleteXref currentXref     -- delete old entry
  475.         exit makeNewXref
  476.       else if it is "Replace" then
  477.         deleteXref currentXref     -- delete old entry
  478.         makeNewXrefAction          -- get new entry
  479.       end if
  480.     else
  481.       makeNewXrefAction
  482.     end if
  483.   end if
  484. end makeNewXref
  485.  
  486. on makeNewXrefAction
  487.   global xrefStack, xrefLooking, xrefReturn
  488.  
  489.   push card
  490.   put short name of this stack into theDomain
  491.   if xrefStack is empty then
  492.     go to stack "Xref Tools"
  493.   end if
  494.   go to card theDomain of xrefStack
  495.   pop card into xrefReturn
  496.   put true into xrefLooking
  497. end makeNewXrefAction
  498.  
  499.  
  500.  
  501.  
  502.