put NewMenu ("Options","Delete this Card","New SchedulER Card", "Next Card/8", "Prior Card/9","Clear All Buttons", "(-","Set Days Off","Scheduler") into menu1
if menu1 is 0 then answer ("Unable to make menu "Beep") with "Drat"
end openBackground
on closebackground
global menu1
put deleteMenu(menu1) into menu1
end closebackground
on idle
-- personal menu setup
global menu1,lastTick
if (the ticks-lasttick)> 120 then
put the ticks into lastTick
showMenu(menu1)
end if
pass idle
end idle
on doMenu which
global menu1
if which is "New SchedulER Card" then
send "mouseUp" to bkgnd button "New Card" -- my version of new card
else if which is "Delete this Card" then
send "mouseUp" to bkgnd button "DeleteCard"
else if which is "Next Card" then
send "mouseUp" to bkgnd button "Next Card"
else if which is "Prior Card" then
send "mouseUp" to bkgnd button "Prior Card"
else if which is "Clear All Buttons" then
send "mouseUp" to bkgnd button "Clear buttons"
else if which is "set days off" then
closebackground
go to first card of bkgnd "Requests Off"
else if which is "Scheduler" then
send "mouseUp" to bkgnd button "Scheduler"
else pass doMenu
end doMenu
-- part 1 (field)
-- low flags: 00
-- high flags: 4000
-- rect: left=152 top=90 right=106 bottom=289
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 21
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Name
-- part 135 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=0 top=0 right=16 bottom=121
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Select Whole Days
----- HyperTalk script -----
on mouseUp
put 0 into it
repeat until it = "end"
ask "Which date to block off ('end'to quit)" with "End"
put it into i
if it = "end" then exit repeat
repeat with j = 0 to 3
set hilite of button (i + j*31) to true
end repeat
end repeat
end mouseUp
-- part 136 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=119 top=0 right=16 bottom=199
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Clear Buttons
----- HyperTalk script -----
on mouseUp
set cursor to 4
repeat with i = 1 to (4*31)
set hilite of button i to false
end repeat
set hilite of bkgnf button "Set Choices" to false
put "" into field "data"
end mouseUp
-- part 137 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=431 top=44 right=74 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 22308 / 22308
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next Card
----- HyperTalk script -----
on mouseUp
get id of card
put id of last card of background "requests ON" into lastcard
if it = lastcard then
go to first card of background "requests On"
else
visual effect wipe right
go to next card of bkgnd "Requests on"
end if
end mouseUp
-- part 138 (button)
-- low flags: 00
-- high flags: 8004
-- rect: left=414 top=27 right=42 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Add New Card
----- HyperTalk script -----
on mouseUp
choose browse tool
go to last card of bkgnd "requests On"
domenu Copy Card
domenu Paste Card
put "Blank" into field name
end mouseUp
-- part 140 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=430 top=74 right=108 bottom=511
-- title width / last selected line: 0
-- icon id / first selected line: 19381 / 19381
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Prior Card
----- HyperTalk script -----
on mouseUp
get id of card
put id of first card of background "requests on" into firstcard
if it = firstcard then
visual effect wipe left
go to last card of background "requests on"
else
visual effect wipe left
go to previous card of bkgnd "requests on"
end if
end mouseUp
-- part 141 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=197 top=0 right=16 bottom=263
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Scheduler
----- HyperTalk script -----
on mouseUp
closebackground
pop card
end mouseUp
-- part 144 (field)
-- low flags: 01
-- high flags: 0007
-- rect: left=186 top=249 right=266 bottom=489
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Data
-- part 145 (button)
-- low flags: 00
-- high flags: 2006
-- rect: left=158 top=248 right=267 bottom=177
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Set Choices
----- HyperTalk script -----
on mouseUp
set cursor to 4
put "" into field "Data"
put Char 1 of word 1 of field 1 & char 1 of word 2 of field 1 into name
put "" into storage
put "A B C D" into Shifts
repeat with shift = 1 to 4
repeat with index = 1 to 31
put index+((shift-1)*31) into today -- there are 124 buttons to check
if hilite of card button today = "True" then
put index & word shift of Shifts & " " after storage
-- storage looks like this ..1A 3C 12D 22B etc...
end if
end repeat
end repeat
put name & " " before storage
put storage into field "data"
set hilite of bkgnd button "Set Choices" to false
end mouseUp
-- part 146 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=275 top=0 right=16 bottom=355
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: DeleteCard
----- HyperTalk script -----
on mouseUp
set lockscreen to true
get id of card
put it into cardID
put id of first card of bkgnd "requests On" into firstcard
put id of last card of bkgnd "requests On" into lastcard
if cardID = firstcard and cardID = lastcard then
answer "Can't delete the last card"
else
answer "Are You Sure" with "Yes" or "No"
if it = "yes" then domenu "delete card"
if cardID = lastcard then go to First card of bkgnd "Requests On"