home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / drgryrct.bin / draggrayrect.bin / background_3044.txt < prev    next >
Text File  |  1989-05-16  |  7KB  |  318 lines

  1. -- background: 3044 from stack: in.bin
  2. -- bmap block id: 3708
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: bg1
  6. ----- HyperTalk script -----
  7. DESCRIPTION:
  8.  
  9. `                           ----------
  10. SYNTAX:
  11.  
  12. `                           ----------
  13. RETURN:
  14.  
  15. `                           ----------
  16. NOTE:
  17.  
  18. on NewCard
  19.   put script of me into temp
  20.   put strxlate(char 1 to (offset("on NewCard",temp)-1)of temp,"`","") into temp
  21.   put temp after fld "description"
  22.   select after char 1 of fld "Name"
  23. end NewCard
  24.  
  25. on who
  26.   send who to fld "Author"
  27. end who
  28.  
  29. on byMe
  30.   put "     " into space5
  31.   put space5 &"Wing Eng"&return& space5 &"Cornell University"&return& space5 &"Ithaca,NY 14853"&return& space5 &"ygxj@cornella.bitnet"&return& space5 &"ygxj@vax5.cit.cornell.edu"&return& space5 &"3/21/89" into fld "Author"
  32.   show fld "Author"
  33. end byMe
  34.  
  35. on by
  36.   show fld "Author"
  37. end by
  38.  
  39.  
  40.  
  41. -- part 4 (field)
  42. -- low flags: 00
  43. -- high flags: 2007
  44. -- rect: left=11 top=57 right=280 bottom=237
  45. -- title width / last selected line: 0
  46. -- icon id / first selected line: 0 / 0
  47. -- text alignment: 0
  48. -- font id: 3
  49. -- text size: 9
  50. -- style flags: 0
  51. -- line height: 12
  52. -- part name: Description
  53. ----- HyperTalk script -----
  54. on mouseUp
  55.   global SelectionLinks
  56.  
  57.   if SelectionLinks then
  58.     set lockText of me to false
  59.     click at the clickLoc
  60.     click at the clickLoc
  61.  
  62.     if the selection is not empty then
  63.       put the selection into temp
  64.       visual zoom out
  65.       go card temp
  66.       if the result is not empty then
  67.         Answer "Couldn't find card named ""e&temp"e
  68.       end if
  69.     end if
  70.  
  71.     set lockText of me to true
  72.   end if
  73. end mouseUp
  74.  
  75.  
  76.  
  77. -- part 14 (button)
  78. -- low flags: 00
  79. -- high flags: 0002
  80. -- rect: left=236 top=57 right=280 bottom=444
  81. -- title width / last selected line: 0
  82. -- icon id / first selected line: 0 / 0
  83. -- text alignment: 1
  84. -- font id: 0
  85. -- text size: 12
  86. -- style flags: 0
  87. -- line height: 16
  88. -- part name: DemoArea
  89. ----- HyperTalk script -----
  90. --
  91. -- So that Groups will work on this DemoArea
  92. --
  93. on mouseDown
  94.   send mouseDown to this card
  95. end mouseDown
  96.  
  97.  
  98.  
  99.  
  100. -- part 17 (field)
  101. -- low flags: 80
  102. -- high flags: 0007
  103. -- rect: left=11 top=179 right=281 bottom=199
  104. -- title width / last selected line: 0
  105. -- icon id / first selected line: 0 / 0
  106. -- text alignment: 0
  107. -- font id: 3
  108. -- text size: 9
  109. -- style flags: 0
  110. -- line height: 12
  111. -- part name: install list
  112. ----- HyperTalk script -----
  113. --
  114. -- This field contains the list of item
  115. -- for installation.
  116. --
  117. on mouseUp
  118.   hide me
  119. end mouseUp
  120.  
  121.  
  122.  
  123. -- part 25 (field)
  124. -- low flags: 80
  125. -- high flags: 0002
  126. -- rect: left=20 top=254 right=287 bottom=201
  127. -- title width / last selected line: 0
  128. -- icon id / first selected line: 0 / 0
  129. -- text alignment: 0
  130. -- font id: 3
  131. -- text size: 12
  132. -- style flags: 0
  133. -- line height: 16
  134. -- part name: SeeAlso
  135. ----- HyperTalk script -----
  136. on mouseUp
  137.   --ΓÇó Delete name from the list
  138.   put lineLoc() into N
  139.   if N > 0 then
  140.     select line N of me
  141.     answer "Delete"&&line N of me &&"from See Also?" with "yes" or "no"
  142.     if it is "yes" then
  143.       delete line N of me
  144.       put StrTrim(me)&return into me
  145.       if the number of lines in me < 1
  146.       then hide bg btn "See Also"
  147.     end if
  148.   end if
  149.   hide me
  150. end mouseUp
  151.  
  152. --
  153. -- Displays a list of cards in the stack
  154. -- and returns the item that you clicked on.
  155. --
  156. on ShowIndexList
  157.   global saveContents
  158.  
  159.   put target into saveContents
  160.   put cd fld "index" of cd "firstCard" into me
  161.   set style of me to scrolling
  162.   send pop to me
  163.  
  164.   put rect of me into scrollRect
  165.   put left of me - 15 into item 1 of scrollRect
  166.   repeat forever
  167.     if the mouse is down then
  168.       --ΓÇó allow scrolling of field
  169.       if the mouseLoc is not within scrollRect
  170.       then exit repeat
  171.     end if
  172.   end repeat
  173.  
  174.   wait until the mouse is down
  175.   put empty into rStr
  176.   put the mouseH&","&the mouseV into pt
  177.   if pt is within rect of me then
  178.     --ΓÇó Add name to the list
  179.     put lineLoc(name of me,item 2 of pt) into N
  180.     if N > 0 then
  181.       select line N of me
  182.       put line N of me into rStr
  183.     end if
  184.   end if
  185.   hide me
  186.   put saveContents into me
  187.   put empty into saveContents
  188.   set style of me to rectangle
  189.   return rStr
  190. end ShowIndexList
  191.  
  192. --
  193. -- pop up this field.
  194. -- Make the height equal to the number of lines in
  195. -- the field * lineHeight.
  196. --
  197. on pop
  198.   Lock Screen
  199.   put textHeight of me into height
  200.   put number of lines in me into N
  201.   put bottom of me into bottom
  202.   put rect of me into r
  203.   put bottom - (height * N + 1) into top
  204.   if top < 20 then put 20 into top
  205.   put top into item 2 of r
  206.   set rect of me to r
  207.   show me
  208.   UnLock Screen
  209. end pop
  210.  
  211. on unpop
  212.   hide me
  213. end unpop
  214.  
  215. on selectItem
  216.   set style of me to rectangle
  217.   send pop to me
  218.   put TrackField() into N
  219.   send unpop to me
  220.   return N
  221. end selectItem
  222.  
  223.  
  224.  
  225. -- part 28 (field)
  226. -- low flags: 83
  227. -- high flags: 0007
  228. -- rect: left=4 top=53 right=311 bottom=236
  229. -- title width / last selected line: 0
  230. -- icon id / first selected line: 0 / 0
  231. -- text alignment: 0
  232. -- font id: 3
  233. -- text size: 12
  234. -- style flags: 0
  235. -- line height: 16
  236. -- part name: index list
  237. ----- HyperTalk script -----
  238. on mouseUp
  239.   global insertWhere
  240.  
  241.   put lineLoc() into N
  242.   put line N of me into cName
  243.   if N > 1 and insertWhere <> empty and cName <> empty then
  244.     select line N of me
  245.     answer "Add" && cName && "to" && insertWhere with "yes" or "no"
  246.     if it is "yes" then
  247.       do "put" && insertWhere && " into temp"
  248.       put return & cName after temp
  249.       put ShellSort(temp,return) into temp
  250.       put StrTrim(temp)&return into temp
  251.       do "put uniqueLines(temp) into" && insertWhere
  252.     end if
  253.   end if
  254.   if fld "SeeAlso" <> empty then show bg btn "See Also"
  255.   hide me
  256.   put empty into insertWhere
  257.   put empty into me
  258. end mouseUp
  259.  
  260. --
  261. -- Displays a list of cards in the stack
  262. -- and returns the item that you clicked on.
  263. --
  264. on pop
  265.   set scroll of me to 0
  266.   put cd fld "index" of cd "firstCard" into me
  267.   put "┬░┬░┬░┬░┬░┬░┬░┬░┬░┬░┬░┬░┬░ Cancel ┬░┬░┬░┬░┬░┬░┬░┬░┬░┬░┬░┬░┬░" & return before me
  268.   show me
  269. end pop
  270.  
  271.  
  272.  
  273. -- part 32 (field)
  274. -- low flags: 81
  275. -- high flags: 2004
  276. -- rect: left=22 top=77 right=189 bottom=235
  277. -- title width / last selected line: 0
  278. -- icon id / first selected line: 0 / 0
  279. -- text alignment: 0
  280. -- font id: 2
  281. -- text size: 12
  282. -- style flags: 0
  283. -- line height: 16
  284. -- part name: Author
  285. ----- HyperTalk script -----
  286. on mouseUp
  287.   hide me
  288. end mouseUp
  289.  
  290. --
  291. -- show the name of the author
  292. --
  293. on who
  294.   Lock Screen
  295.   put textHeight of me into height
  296.   put number of lines in me into N
  297.   if N > 0 then
  298.     put top of me into top
  299.     put rect of me into r
  300.     put top + (height * (N + 1)) into bottom
  301.     if bottom > 300 then
  302.       put 300 into top
  303.       set style of me to scrolling
  304.     end if
  305.     put bottom into item 4 of r
  306.     set rect of me to r
  307.     UnLock Screen
  308.     show me
  309.   else
  310.     answer "Unknown Author."
  311.   end if
  312. end who
  313.  
  314. on mouseUp
  315.   hide me
  316. end mouseUp
  317.  
  318.