home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / hc / schedule.sit / Scheduler / background_3232.txt < prev    next >
Text File  |  1988-02-12  |  7KB  |  297 lines

  1. -- background: 3232 from stack: in
  2. -- bmap block id: 9501
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: Requests On
  6. ----- HyperTalk script -----
  7. on openBackground
  8.  
  9.   -- menu set up
  10.   show menubar
  11.  
  12.   global menu1
  13.   put NewMenu ("Options","Delete this Card","New SchedulER Card", "Next Card/8", "Prior Card/9","Clear All Buttons", "(-","Set Days Off","Scheduler") into menu1
  14.   if menu1 is 0 then answer ("Unable to make menu "Beep") with "Drat"
  15. end openBackground
  16.  
  17. on closebackground
  18.   global menu1
  19.   put deleteMenu(menu1) into menu1
  20. end closebackground
  21.  
  22. on idle
  23.  
  24.   -- personal menu setup
  25.  
  26.   global menu1,lastTick
  27.   if (the ticks-lasttick)> 120 then
  28.     put the ticks into lastTick
  29.     showMenu(menu1)
  30.   end if
  31.   pass idle
  32. end idle
  33.  
  34. on doMenu which
  35.   global menu1
  36.   if which is "New SchedulER Card" then
  37.     send "mouseUp" to bkgnd button "New Card" -- my version of new card
  38.   else if which is "Delete this Card" then
  39.     send "mouseUp" to bkgnd button "DeleteCard"
  40.   else if which is "Next Card" then
  41.     send "mouseUp" to bkgnd button "Next Card"
  42.   else if which is "Prior Card" then
  43.     send "mouseUp" to bkgnd button "Prior Card"
  44.   else if which is "Clear All Buttons" then
  45.     send "mouseUp" to bkgnd button "Clear buttons"
  46.   else if which is "set days off" then
  47.     closebackground
  48.     go to first card of bkgnd "Requests Off"
  49.   else if which is "Scheduler" then
  50.     send "mouseUp" to bkgnd button "Scheduler"
  51.   else pass doMenu
  52. end doMenu
  53.  
  54.  
  55. -- part 1 (field)
  56. -- low flags: 00
  57. -- high flags: 4000
  58. -- rect: left=152 top=90 right=106 bottom=289
  59. -- title width / last selected line: 0
  60. -- icon id / first selected line: 0 / 0
  61. -- text alignment: 0
  62. -- font id: 21
  63. -- text size: 12
  64. -- style flags: 0
  65. -- line height: 16
  66. -- part name: Name
  67.  
  68.  
  69. -- part 135 (button)
  70. -- low flags: 00
  71. -- high flags: 0000
  72. -- rect: left=0 top=0 right=16 bottom=121
  73. -- title width / last selected line: 0
  74. -- icon id / first selected line: 0 / 0
  75. -- text alignment: 1
  76. -- font id: 0
  77. -- text size: 12
  78. -- style flags: 0
  79. -- line height: 16
  80. -- part name: Select Whole Days
  81. ----- HyperTalk script -----
  82. on mouseUp
  83.   put 0 into it
  84.   repeat until it = "end"
  85.     ask "Which date to block off ('end'to quit)" with "End"
  86.     put it into i
  87.     if it = "end" then exit repeat
  88.     repeat with j = 0 to 3
  89.       set hilite of button (i + j*31) to true
  90.     end repeat
  91.  
  92.   end repeat
  93. end mouseUp
  94.  
  95.  
  96.  
  97. -- part 136 (button)
  98. -- low flags: 00
  99. -- high flags: 0000
  100. -- rect: left=119 top=0 right=16 bottom=199
  101. -- title width / last selected line: 0
  102. -- icon id / first selected line: 0 / 0
  103. -- text alignment: 1
  104. -- font id: 0
  105. -- text size: 12
  106. -- style flags: 0
  107. -- line height: 16
  108. -- part name: Clear Buttons
  109. ----- HyperTalk script -----
  110. on mouseUp
  111.   set cursor to 4
  112.   repeat with i = 1 to (4*31)
  113.     set hilite of button i to false
  114.   end repeat
  115.   set hilite of bkgnf button "Set Choices" to false
  116.   put "" into field "data"
  117. end mouseUp
  118.  
  119.  
  120.  
  121. -- part 137 (button)
  122. -- low flags: 00
  123. -- high flags: 0000
  124. -- rect: left=431 top=44 right=74 bottom=512
  125. -- title width / last selected line: 0
  126. -- icon id / first selected line: 22308 / 22308
  127. -- text alignment: 1
  128. -- font id: 0
  129. -- text size: 12
  130. -- style flags: 0
  131. -- line height: 16
  132. -- part name: Next Card
  133. ----- HyperTalk script -----
  134. on mouseUp
  135.   get id of card
  136.   put id of last card of background "requests ON" into lastcard
  137.   if it = lastcard then
  138.     go to first card of background "requests On"
  139.   else
  140.     visual effect wipe right
  141.     go to next card of bkgnd "Requests on"
  142.   end if
  143. end mouseUp
  144.  
  145.  
  146.  
  147. -- part 138 (button)
  148. -- low flags: 00
  149. -- high flags: 8004
  150. -- rect: left=414 top=27 right=42 bottom=512
  151. -- title width / last selected line: 0
  152. -- icon id / first selected line: 0 / 0
  153. -- text alignment: 1
  154. -- font id: 0
  155. -- text size: 12
  156. -- style flags: 0
  157. -- line height: 16
  158. -- part name: Add New Card
  159. ----- HyperTalk script -----
  160. on mouseUp
  161.   choose browse tool
  162.   go to last card of bkgnd "requests On"
  163.   domenu Copy Card
  164.   domenu Paste Card
  165.   put "Blank" into field name
  166. end mouseUp
  167.  
  168.  
  169.  
  170. -- part 140 (button)
  171. -- low flags: 00
  172. -- high flags: 0000
  173. -- rect: left=430 top=74 right=108 bottom=511
  174. -- title width / last selected line: 0
  175. -- icon id / first selected line: 19381 / 19381
  176. -- text alignment: 1
  177. -- font id: 0
  178. -- text size: 12
  179. -- style flags: 0
  180. -- line height: 16
  181. -- part name: Prior Card
  182. ----- HyperTalk script -----
  183. on mouseUp
  184.   get id of card
  185.   put id of first card of background "requests on" into firstcard
  186.   if it = firstcard then
  187.     visual effect wipe left
  188.     go to last card of background "requests on"
  189.   else
  190.  
  191.     visual effect wipe left
  192.     go to previous card of bkgnd "requests on"
  193.   end if
  194. end mouseUp
  195.  
  196.  
  197.  
  198. -- part 141 (button)
  199. -- low flags: 00
  200. -- high flags: 0000
  201. -- rect: left=197 top=0 right=16 bottom=263
  202. -- title width / last selected line: 0
  203. -- icon id / first selected line: 0 / 0
  204. -- text alignment: 1
  205. -- font id: 0
  206. -- text size: 12
  207. -- style flags: 0
  208. -- line height: 16
  209. -- part name: Scheduler
  210. ----- HyperTalk script -----
  211. on mouseUp
  212.   closebackground
  213.   pop card
  214. end mouseUp
  215.  
  216.  
  217.  
  218.  
  219. -- part 144 (field)
  220. -- low flags: 01
  221. -- high flags: 0007
  222. -- rect: left=186 top=249 right=266 bottom=489
  223. -- title width / last selected line: 0
  224. -- icon id / first selected line: 0 / 0
  225. -- text alignment: 0
  226. -- font id: 3
  227. -- text size: 12
  228. -- style flags: 0
  229. -- line height: 16
  230. -- part name: Data
  231.  
  232.  
  233. -- part 145 (button)
  234. -- low flags: 00
  235. -- high flags: 2006
  236. -- rect: left=158 top=248 right=267 bottom=177
  237. -- title width / last selected line: 0
  238. -- icon id / first selected line: 0 / 0
  239. -- text alignment: 1
  240. -- font id: 0
  241. -- text size: 12
  242. -- style flags: 0
  243. -- line height: 16
  244. -- part name: Set Choices
  245. ----- HyperTalk script -----
  246. on mouseUp
  247.   set cursor to 4
  248.   put "" into field "Data"
  249.   put Char 1 of word 1 of field 1 & char 1 of word 2 of field 1 into name
  250.   put "" into storage
  251.   put "A B C D" into Shifts
  252.   repeat with shift = 1 to 4
  253.     repeat with index = 1 to 31
  254.       put index+((shift-1)*31) into today -- there are 124 buttons to check
  255.       if hilite of card button today = "True" then
  256.         put index & word shift of Shifts & " " after storage
  257.         -- storage looks like this ..1A 3C 12D 22B etc...
  258.       end if
  259.     end repeat
  260.   end repeat
  261.   put name & " " before storage
  262.   put storage into field "data"
  263.   set hilite of bkgnd button "Set Choices" to false
  264. end mouseUp
  265.  
  266.  
  267.  
  268. -- part 146 (button)
  269. -- low flags: 00
  270. -- high flags: 0000
  271. -- rect: left=275 top=0 right=16 bottom=355
  272. -- title width / last selected line: 0
  273. -- icon id / first selected line: 0 / 0
  274. -- text alignment: 1
  275. -- font id: 0
  276. -- text size: 12
  277. -- style flags: 0
  278. -- line height: 16
  279. -- part name: DeleteCard
  280. ----- HyperTalk script -----
  281. on mouseUp
  282.   set lockscreen to true
  283.   get id of card
  284.   put it into cardID
  285.   put id of first card of bkgnd "requests On" into firstcard
  286.   put id of last card of bkgnd "requests On" into lastcard
  287.   if cardID = firstcard and cardID = lastcard then
  288.     answer "Can't delete the last card"
  289.   else
  290.     answer "Are You Sure" with "Yes" or "No"
  291.     if it = "yes" then domenu "delete card"
  292.     if cardID = lastcard then go to First card of bkgnd "Requests On"
  293.   end if
  294.   set lockscreen to false
  295. end mouseUp
  296.  
  297.