home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / xcmd / prctclxf.sit / DemoStack / background_4929.txt < prev    next >
Text File  |  1990-08-28  |  8KB  |  389 lines

  1. -- background: 4929 from stack: in
  2. -- bmap block id: 5817
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: Legal
  6. ----- HyperTalk script -----
  7. -- used to ask about saving changes to a field
  8. function fieldModified value
  9. global _fieldModified
  10. if (value Γëá empty) then put value into _fieldModified
  11. return _fieldModified
  12. end fieldModified
  13.  
  14. on openCard
  15.   set cursor to watch
  16.   get fieldModified(false)
  17.   if (debugging()) then
  18.     -- show file name field for text
  19.     show bkgnd button "Save Text To:"
  20.     show field "FileName"
  21.     -- load text from file
  22.     put buildPath(field "FileName") into fileName
  23.     putFileIntoField fileName, "Description"
  24.   else
  25.     -- hide file name field
  26.     hide bkgnd button "Save Text To:"
  27.     hide field "FileName"
  28.   end if
  29.   pass openCard
  30. end openCard
  31.  
  32. -- Append fileName to the full pathname for this stack's folder
  33. function buildPath fileName
  34. put uniqList("fileName") into templist
  35. put last word of the long name of this stack into stackPath
  36. delete first char of stackPath
  37. delete last char of stackPath
  38. get alist(new, templist)
  39. get alist(insert, templist, stackPath, ":")
  40. put alist(size, templist) into sz
  41. put alist(get, templist&"[ΓǪ"&sz-1&"]", ":") & ":" & filename into path
  42. get alist(dispose, templist)
  43. return path
  44. end buildPath
  45.  
  46. on closeCard
  47.   if (debugging() and fieldModified()) then
  48.     answer "Save changes to text?" with "Discard" or "Save"
  49.     if (it = "Save") then
  50.       putFieldIntoFile "Description", field "FileName"
  51.     end if
  52.   end if
  53.   get fieldModified(false)
  54. end closeCard
  55.  
  56.  
  57.  
  58.  
  59. -- part 1 (button)
  60. -- low flags: 00
  61. -- high flags: 2000
  62. -- rect: left=4 top=317 right=340 bottom=31
  63. -- title width / last selected line: 0
  64. -- icon id / first selected line: 30557 / 30557
  65. -- text alignment: 1
  66. -- font id: 0
  67. -- text size: 12
  68. -- style flags: 0
  69. -- line height: 16
  70. -- part name: First
  71. ----- HyperTalk script -----
  72. on mouseUp
  73.   GoFirst
  74. end mouseUp
  75.  
  76.  
  77.  
  78. -- part 2 (button)
  79. -- low flags: 00
  80. -- high flags: 2000
  81. -- rect: left=39 top=317 right=340 bottom=62
  82. -- title width / last selected line: 0
  83. -- icon id / first selected line: 20689 / 20689
  84. -- text alignment: 1
  85. -- font id: 0
  86. -- text size: 12
  87. -- style flags: 0
  88. -- line height: 16
  89. -- part name: Home
  90. ----- HyperTalk script -----
  91. on mouseUp
  92.   GoHome
  93. end mouseUp
  94.  
  95.  
  96.  
  97. -- part 3 (button)
  98. -- low flags: 00
  99. -- high flags: 2000
  100. -- rect: left=72 top=318 right=340 bottom=98
  101. -- title width / last selected line: 0
  102. -- icon id / first selected line: 26635 / 26635
  103. -- text alignment: 1
  104. -- font id: 0
  105. -- text size: 12
  106. -- style flags: 0
  107. -- line height: 16
  108. -- part name: Previous
  109. ----- HyperTalk script -----
  110. on mouseUp
  111.   GoHelp
  112. end mouseUp
  113.  
  114.  
  115.  
  116. -- part 5 (button)
  117. -- low flags: 00
  118. -- high flags: 2000
  119. -- rect: left=224 top=317 right=340 bottom=247
  120. -- title width / last selected line: 0
  121. -- icon id / first selected line: 1014 / 1014
  122. -- text alignment: 1
  123. -- font id: 0
  124. -- text size: 12
  125. -- style flags: 0
  126. -- line height: 16
  127. -- part name: Previous
  128. ----- HyperTalk script -----
  129. on mouseUp
  130.   GoPrevious
  131. end mouseUp
  132.  
  133.  
  134.  
  135. -- part 6 (button)
  136. -- low flags: 00
  137. -- high flags: 2000
  138. -- rect: left=266 top=317 right=340 bottom=289
  139. -- title width / last selected line: 0
  140. -- icon id / first selected line: 1013 / 1013
  141. -- text alignment: 1
  142. -- font id: 0
  143. -- text size: 12
  144. -- style flags: 0
  145. -- line height: 16
  146. -- part name: Next
  147. ----- HyperTalk script -----
  148. on mouseUp
  149.   GoNext
  150. end mouseUp
  151.  
  152.  
  153.  
  154. -- part 7 (button)
  155. -- low flags: 00
  156. -- high flags: 2000
  157. -- rect: left=449 top=317 right=340 bottom=476
  158. -- title width / last selected line: 0
  159. -- icon id / first selected line: 1012 / 1012
  160. -- text alignment: 1
  161. -- font id: 0
  162. -- text size: 12
  163. -- style flags: 0
  164. -- line height: 16
  165. -- part name: Back
  166. ----- HyperTalk script -----
  167. on mouseUp
  168.   GoBack
  169. end mouseUp
  170.  
  171.  
  172.  
  173. -- part 8 (button)
  174. -- low flags: 00
  175. -- high flags: 2000
  176. -- rect: left=482 top=317 right=340 bottom=510
  177. -- title width / last selected line: 0
  178. -- icon id / first selected line: 26865 / 26865
  179. -- text alignment: 1
  180. -- font id: 0
  181. -- text size: 12
  182. -- style flags: 0
  183. -- line height: 16
  184. -- part name: Last
  185. ----- HyperTalk script -----
  186. on mouseUp
  187.   GoLast
  188. end mouseUp
  189.  
  190.  
  191.  
  192. -- part 9 (field)
  193. -- low flags: 01
  194. -- high flags: 0007
  195. -- rect: left=14 top=44 right=307 bottom=496
  196. -- title width / last selected line: 0
  197. -- icon id / first selected line: 0 / 0
  198. -- text alignment: 0
  199. -- font id: 3
  200. -- text size: 10
  201. -- style flags: 0
  202. -- line height: 13
  203. -- part name: Description
  204. ----- HyperTalk script -----
  205. on closeField
  206.   get fieldModified(true)
  207. end closeField
  208.  
  209.  
  210.  
  211. -- part 10 (field)
  212. -- low flags: 01
  213. -- high flags: 0002
  214. -- rect: left=14 top=28 right=44 bottom=496
  215. -- title width / last selected line: 0
  216. -- icon id / first selected line: 0 / 0
  217. -- text alignment: 1
  218. -- font id: 3
  219. -- text size: 10
  220. -- style flags: 256
  221. -- line height: 13
  222. -- part name: 
  223.  
  224.  
  225. -- part 12 (field)
  226. -- low flags: 01
  227. -- high flags: 0000
  228. -- rect: left=0 top=0 right=20 bottom=512
  229. -- title width / last selected line: 0
  230. -- icon id / first selected line: 0 / 0
  231. -- text alignment: 1
  232. -- font id: 3
  233. -- text size: 12
  234. -- style flags: 1280
  235. -- line height: 16
  236. -- part name: HeaderRight
  237.  
  238.  
  239. -- part 13 (field)
  240. -- low flags: 01
  241. -- high flags: 0000
  242. -- rect: left=0 top=2 right=20 bottom=150
  243. -- title width / last selected line: 0
  244. -- icon id / first selected line: 0 / 0
  245. -- text alignment: 0
  246. -- font id: 3
  247. -- text size: 10
  248. -- style flags: 1280
  249. -- line height: 13
  250. -- part name: HeaderLeft
  251.  
  252.  
  253. -- part 14 (field)
  254. -- low flags: 00
  255. -- high flags: 0000
  256. -- rect: left=413 top=2 right=20 bottom=500
  257. -- title width / last selected line: 0
  258. -- icon id / first selected line: 0 / 0
  259. -- text alignment: 65535
  260. -- font id: 3
  261. -- text size: 10
  262. -- style flags: 256
  263. -- line height: 13
  264. -- part name: HeaderNumber
  265.  
  266.  
  267. -- part 15 (button)
  268. -- low flags: 00
  269. -- high flags: A004
  270. -- rect: left=107 top=319 right=339 bottom=149
  271. -- title width / last selected line: 0
  272. -- icon id / first selected line: 0 / 0
  273. -- text alignment: 1
  274. -- font id: 3
  275. -- text size: 10
  276. -- style flags: 256
  277. -- line height: 13
  278. -- part name: Index
  279. ----- HyperTalk script -----
  280. on mouseUp
  281.   GoIndex
  282. end mouseUp
  283.  
  284.  
  285.  
  286. -- part 16 (button)
  287. -- low flags: 80
  288. -- high flags: A004
  289. -- rect: left=10 top=27 right=47 bottom=94
  290. -- title width / last selected line: 0
  291. -- icon id / first selected line: 0 / 0
  292. -- text alignment: 1
  293. -- font id: 3
  294. -- text size: 10
  295. -- style flags: 256
  296. -- line height: 13
  297. -- part name: Save Text To:
  298. ----- HyperTalk script -----
  299. on mouseUp
  300.   putFieldIntoFile "Description", field "FileName"
  301. end mouseUp
  302.  
  303.  
  304.  
  305. -- part 17 (field)
  306. -- low flags: 80
  307. -- high flags: 0002
  308. -- rect: left=95 top=28 right=47 bottom=205
  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: 9
  314. -- style flags: 0
  315. -- line height: 12
  316. -- part name: FileName
  317.  
  318.  
  319. -- part 11 (field)
  320. -- low flags: 01
  321. -- high flags: 0000
  322. -- rect: left=0 top=0 right=20 bottom=512
  323. -- title width / last selected line: 0
  324. -- icon id / first selected line: 0 / 0
  325. -- text alignment: 0
  326. -- font id: 3
  327. -- text size: 12
  328. -- style flags: 0
  329. -- line height: 16
  330. -- part name: MenuHide
  331. ----- HyperTalk script -----
  332. on mouseEnter
  333.   global debugging
  334.  
  335.   if (debugging = false) then show menubar
  336. end mouseEnter
  337.  
  338. on mouseLeave
  339.   global debugging
  340.  
  341.   if (debugging = false) then hide menubar
  342. end mouseLeave
  343.  
  344.  
  345.  
  346. -- part 20 (button)
  347. -- low flags: 00
  348. -- high flags: A003
  349. -- rect: left=319 top=319 right=340 bottom=384
  350. -- title width / last selected line: 0
  351. -- icon id / first selected line: 0 / 0
  352. -- text alignment: 1
  353. -- font id: 3
  354. -- text size: 10
  355. -- style flags: 256
  356. -- line height: 13
  357. -- part name: THINK C
  358. ----- HyperTalk script -----
  359. on mouseUp
  360.   GoThinkC
  361. end mouseUp
  362.  
  363.  
  364.  
  365. -- part 21 (button)
  366. -- low flags: 00
  367. -- high flags: 2000
  368. -- rect: left=161 top=316 right=342 bottom=199
  369. -- title width / last selected line: 0
  370. -- icon id / first selected line: 32670 / 32670
  371. -- text alignment: 1
  372. -- font id: 0
  373. -- text size: 12
  374. -- style flags: 0
  375. -- line height: 16
  376. -- part name: ShowAll
  377. ----- HyperTalk script -----
  378. on mouseUp
  379.   set cursor to watch
  380.   set lockRecent to true
  381.   set lockMessages to true
  382.   if (the shiftKey is down) then  set lockScreen to true
  383.   show all cards
  384.   set lockScreen to false
  385.   set lockMessages to false
  386.   set lockRecent to false
  387. end mouseUp
  388.  
  389.