#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" UnixCal 3" ,--Examples for calendar files: -- --LANG=C --Easter=Ostern -- --6/15 June 15 (if ambiguous, will default to month/day). --Jun. 15 June 15. #--15 June June 15. #--Thursday Every Thursday. #--June Every June 1st. #--15 * 15th of every month. -- --May Sun+2 second Sunday in May (Muttertag) --04/SunLast last Sunday in April, -- summer time in Europe --Easter Easter #--Ostern-2 Good Friday (2 days before Easter) #--Paskha Orthodox Easter on preOpenStack if the short name of this stack = "UnixCal" then loadPrefs end if end preOpenStack on shutdownRequest pass shutDownRequest end shutdownRequest on closeStack if the short name of this stack = "UnixCal" then savePrefs put empty into fld "Today" put empty into fld "ShownDate" if the environment = "development" then save this stack end if end closeStack on resume resumeStack end resume on resumeStack if the short name of this stack = "UnixCal" then put getDisplayedDate into tDate convert tDate to short English date put the seconds into tNow convert tNow to short English date if tDate <> tNow then if the number of words in fld "ShownDate" = 2 then send mouseUp to btn "This month" else send mouseUp to btn "Today" end if end if end if end resumeStack on savePrefs put specialFolderPath("Preferences") & "/UnixCal.prefs" into tPath put the width of window "UnixCal" & cr into tPrefs put the height of window "UnixCal" & cr after tPrefs put the topLeft of window "UnixCal" & cr after tPrefs if the number of words in fld "ShownDate" = 2 then put "Month" & cr after tPrefs else put "Day" & cr after tPrefs end if put the cShowButtons of me & cr after tPrefs put tPrefs into URL ("file:" & tPath) end savePrefs on loadPrefs put specialFolderPath("Preferences") & "/UnixCal.prefs" into tPath if there is not a file tPath then set the cShowButtons of me to true toggleButtonDisplay send mouseUp to btn "Today" exit loadPrefs end if put URL ("file:" & tPath) into tPrefs put line 1 of tPrefs into tW put line 2 of tPrefs into tH set the width of window "UnixCal" to tW set the height of window "UnixCal" to tH set the topleft of window "UnixCal" to line 3 of tPrefs if line 4 of tPrefs = "Month" then send mouseUp to btn "This month" else send mouseUp to btn "Today" end if set the cShowButtons of me to line 5 of tPrefs toggleButtonDisplay send "resetWindow " & tW & comma & tH to me in 5 ticks end loadPrefs on resetWindow pW, pH revChangeWindowSize pW, pH resizeStack pW, pH end resetWindow function listCalendars put the defaultFolder into oldDefault set the defaultFolder to "/usr/share/calendar/" put the files into tList filter tList with "*calendar.*" put empty into tDateList repeat for each line L in tList put URL ("file:" & L) into tDates filter tDates with "*" & tab & "?*" filter tDates with "?*" put tDates & cr after tDateList end repeat set the defaultFolder to oldDefault put empty into tNew set the itemDel to tab repeat for each line L in tDateList if L is empty then next repeat if item 1 of L is empty then put space & item 2 of L after last line of tNew else put L & cr after tNew end repeat delete last char of tNew return tNew end listCalendars function filterDate pDate, pFullMonth put listCalendars() into tList -- extract various bits of date info put pDate into tNow convert tNow from short English date to dateItems put item 1 of tNow into tYear put item 2 of tNow into tMonthNum put line tMonthNum of the monthNames into tLongMonth put line tMonthNum of the abbrev monthNames into tShortMonth if tMonthNum < 10 then put "0" before tMonthNum put item 3 of tNow into tDateNum if tDateNum < 10 then put "0" before tDateNum put item 7 of tNow into tWeekDayNum put line tWeekDayNum of the weekdayNames into tLongDay put line tWeekDayNum of the abbrev weekdayNames into tShortDay -- replace Easter related dates with real dates for the current year put calcEaster(tYear) into easterDate put easterDate & "/" & tYear into tFullEaster convert tFullEaster to dateItems put empty into tNew set the itemDel to tab repeat for each line L in tList if item 1 of L contains "Easter" then put item 1 of L into d replace "Easter" with "" in d if d is not empty then set the itemDel to comma put tFullEaster into newD add d to item 3 of newD convert newD to seconds convert newD to dateItems put item 2 of newD into newM if newM < 10 then put "0" before newM put item 3 of newD into newD if newD < 10 then put "0" before newD put newM & "/" & newD into d set the itemDel to tab else put easterDate into d end if put d & tab & item 2 of L & cr after tNew else put L & cr after tNew end if end repeat delete last char of tNew put tNew into tList -- reduce list to current month only replace tShortMonth & ". " with tMonthNum & "/" in tList replace tShortMonth & space with tMonthNum & "/" in tList replace tLongMonth & "." with tMonthNum & "/" in tList filter tList with tMonthNum & "/*" -- convert weekday dates to real dates put empty into tNew repeat for each line L in tList set the itemDel to tab put item 1 of L into d set the itemDel to "/" put item 2 of d into w set the itemDel to tab -- ignore variable dates if last char of w = "*" then next repeat if w is not a number then put relativeDate(w, tMonthNum, tYear) into newDate put newDate & tab & item 2 of L & cr after tNew else put L & cr after tNew end if end repeat delete last char of tNew if pFullMonth <> true then filter tNew with tMonthNum & "/" & tDateNum & tab & "*" end if sort lines of tNew return tNew end filterDate function calcEaster pYear -- [in] wYear - 4-digit year to calculate (but not before 1583) -- [out] wMonth - month of easter sunday -- [out] wDay - day of easter sunday put 0 into wCorrection if( pYear < 1700 ) then put 4 into wCorrection else if pYear < 1800 then put 5 into wCorrection else if pYear < 1900 then put 6 into wCorrection else if pYear < 2100 then put 0 into wCorrection else if pYear < 2200 then put 1 into wCorrection else if pYear < 2300 then put 2 into wCorrection else if pYear < 2500 then put 3 into wCorrection put (19 * (pYear mod 19) + 24) mod 30 into wDay put 22 + wDay + ((2 * (pYear mod 4) + 4 * (pYear mod 7) + 6 * wDay + 5 + wCorrection) mod 7) into wDay -- jump to next month if wDay > 31 then put 4 into wMonth subtract 31 from wDay else put 3 into wMonth end if if wMonth < 10 then put "0" before wMonth if wDay < 10 then put "0" before wDay return wMonth & "/" & wDay end calcEaster -- pDate is in a format where the first 3 chars are the abbreviated day name -- the remainder is either First, Second, Third, Fourth, Last -- or +1, +2, +3, +4 for 1st, 2nd, 3rd & 4th -- function relativeDate pDate, pMonth, pYear -- extract the day name & convert to a number put char 1 to 3 of pDate into tDayName put the abbrev weekDayNames into tDayList get lineOffset(tDayName, tDayList) if it = 0 then return empty put it into tDayNum put char 4 to -1 of pDate into tSet if char 1 of tSet = "+" then delete char 1 of tSet -- find first whatever day in the month put pMonth & "/1/" & pYear into firstDate convert firstDate to dateItems put last item of firstDate into firstDayNum put tDayNum - firstDayNum into dayDiff if dayDiff < 0 then add 7 to dayDiff add dayDiff to item 3 of firstDate convert firstDate to seconds convert firstDate to dateItems -- add weeks as necessary switch tSet case "First" case "1" break case "Second" case "2" add 7 to item 3 of firstDate break case "Third" case "3" add 14 to item 3 of firstDate break case "Fourth" case "4" add 21 to item 3 of firstDate break case "Fifth" case "5" add 28 to item 3 of firstDate break case "Last" -- try week 5 and if that doesn't work, use week 4 put firstDate into testDate add 28 to item 3 of testDate convert testDate to seconds convert testDate to dateItems if item 2 of testDate = pMonth then put testDate into firstDate else add 21 to item 3 of firstDate end if break end switch convert firstDate to seconds convert firstDate to dateItems put item 2 of firstDate into newM put item 3 of firstDate into newD if newM < 10 then put "0" before newM if newD < 10 then put "0" before newD return newM & "/" & newD end relativeDate on showDisplayedDate pDate, pIsMonth if pIsMonth = true then convert pDate from short English date to dateItems put item 2 of pDate into monthNum put line monthNum of the system monthNames & space & item 1 of pDate into fld "ShownDate" else convert pDate from short English date to long system date put pDate into fld "ShownDate" end if set the hilitedLine of fld "Today" to empty end showDisplayedDate function getDisplayedDate put fld "ShownDate" into tDate if the number of words in tDate = 2 then -- showing month & year only put word 1 of tDate into monthName put lineOffset(monthName, the system monthNames) into monthNumber put word 2 of tDate & comma & monthNumber & comma & "1,0,0,0,0" into newDate convert newDate from dateItems to short system date convert newDate from short system date to dateItems return newDate else -- showing long system date convert tDate from long system date to dateItems return tDate end if end getDisplayedDate on resizeStack newW, newH, oldW, oldH set the width of fld "ShownDate" to newW - 32 set the topLeft of fld "ShownDate" to "16,28" if the cShowButtons of me = true then put 118 into tBase else put 50 into tBase set the width of fld "Today" to newW - 32 set the height of fld "Today" to newH - tBase set the topLeft of fld "Today" to "16,58" if the cShowButtons of me = false then exit resizeStack set the loc of btn "Previous Day" to "76," & newH - 38 set the loc of btn "Previous Month" to "76," & newH - 4 set the loc of btn "Today" to (newW div 2 & comma & newH - 38) set the loc of btn "This month" to (newW div 2 & comma & newH - 4) set the loc of btn "Next Day" to (newW - 76 & comma & newH - 38) set the loc of btn "Next Month" to (newW -76 & comma & newH - 4) end resizeStack on toggleButtonDisplay lock screen if the cShowButtons of me = true then show grp "Buttons" put "Hide buttons/B" into line 9 of btn "File" else hide grp "Buttons" put "Show buttons/B" into line 9 of btn "File" end if resizeStack the width of this stack, the height of this stack if the cShowButtons of me = true then unlock screen with visual effect wipe up very fast else unlock screen with visual effect wipe down very fast end if end toggleButtonDisplay on clearAll put empty into fld "ShownDate" put empty into fld "Today" end clearAll 聁 q cShowButtons false Unix Calendar U Verdana U Verdana W Verdana W Verdana U Lucida Grande ucMenubar cREVGeometryCache stackID 1018 cREVGeneral scriptChecksum f ۛqd9R$ debugObjects handlerList preOpenStack shutdownRequest closeStack resume resumeStack savePrefs loadPrefs resetWindow listCalendars filterDate calcEaster relativeDate showDisplayedDate getDisplayedDate resizeStack toggleButtonDisplay clearAllbreakPoints scriptSelection char 4914 to 4913 bookmarks prevHandler filterDatetempScript script }
--Examples for calendar files:
--
--LANG=C
--Easter=Ostern
--
--6/15 June 15 (if ambiguous, will default to month/day).
--Jun. 15 June 15.
#--15 June June 15.
#--Thursday Every Thursday.
#--June Every June 1st.
#--15 * 15th of every month.
--
--May Sun+2 second Sunday in May (Muttertag)
--04/SunLast last Sunday in April,
-- summer time in Europe
--Easter Easter
#--Ostern-2 Good Friday (2 days before Easter)
#--Paskha Orthodox Easter
on preOpenStack
if the short name of this stack = "UnixCal" then
loadPrefs
end if
end preOpenStack
on shutdownRequest
pass shutDownRequest
end shutdownRequest
on closeStack
if the short name of this stack = "UnixCal" then
savePrefs
put empty into fld "Today"
put empty into fld "ShownDate"
if the environment = "development" then save this stack
end if
end closeStack
on resume
resumeStack
end resume
on resumeStack
if the short name of this stack = "UnixCal" then
put getDisplayedDate into tDate
convert tDate to short English date
put the seconds into tNow
convert tNow to short English date
if tDate <> tNow then
if the number of words in fld "ShownDate" = 2 then
send mouseUp to btn "This month"
else
send mouseUp to btn "Today"
end if
end if
end if
end resumeStack
on savePrefs
put specialFolderPath("Preferences") & "/UnixCal.prefs" into tPath
put the width of window "UnixCal" & cr into tPrefs
put the height of window "UnixCal" & cr after tPrefs
put the topLeft of window "UnixCal" & cr after tPrefs
if the number of words in fld "ShownDate" = 2 then
put "Month" & cr after tPrefs
else
put "Day" & cr after tPrefs
end if
put the cShowButtons of me & cr after tPrefs
put tPrefs into URL ("file:" & tPath)
end savePrefs
on loadPrefs
put specialFolderPath("Preferences") & "/UnixCal.prefs" into tPath
if there is not a file tPath then
set the cShowButtons of me to true
toggleButtonDisplay
send mouseUp to btn "Today"
exit loadPrefs
end if
put URL ("file:" & tPath) into tPrefs
put line 1 of tPrefs into tW
put line 2 of tPrefs into tH
set the width of window "UnixCal" to tW
set the height of window "UnixCal" to tH
set the topleft of window "UnixCal" to line 3 of tPrefs
if line 4 of tPrefs = "Month" then
send mouseUp to btn "This month"
else
send mouseUp to btn "Today"
end if
set the cShowButtons of me to line 5 of tPrefs
toggleButtonDisplay
send "resetWindow " & tW & comma & tH to me in 5 ticks
end loadPrefs
on resetWindow pW, pH
revChangeWindowSize pW, pH
resizeStack pW, pH
end resetWindow
function listCalendars
put the defaultFolder into oldDefault
set the defaultFolder to "/usr/share/calendar/"
put the files into tList
filter tList with "*calendar.*"
put empty into tDateList
repeat for each line L in tList
put URL ("file:" & L) into tDates
filter tDates with "*" & tab & "?*"
filter tDates with "?*"
put tDates & cr after tDateList
end repeat
set the defaultFolder to oldDefault
put empty into tNew
set the itemDel to tab
repeat for each line L in tDateList
if L is empty then next repeat
if item 1 of L is empty then put space & item 2 of L after last line of tNew
else put L & cr after tNew
end repeat
delete last char of tNew
return tNew
end listCalendars
function filterDate pDate, pFullMonth
put listCalendars() into tList
-- extract various bits of date info
put pDate into tNow
convert tNow from short English date to dateItems
put item 1 of tNow into tYear
put item 2 of tNow into tMonthNum
put line tMonthNum of the monthNames into tLongMonth
put line tMonthNum of the abbrev monthNames into tShortMonth
if tMonthNum < 10 then put "0" before tMonthNum
put item 3 of tNow into tDateNum
if tDateNum < 10 then put "0" before tDateNum
put item 7 of tNow into tWeekDayNum
put line tWeekDayNum of the weekdayNames into tLongDay
put line tWeekDayNum of the abbrev weekdayNames into tShortDay
-- replace Easter related dates with real dates for the current year
put calcEaster(tYear) into easterDate
put easterDate & "/" & tYear into tFullEaster
convert tFullEaster to dateItems
put empty into tNew
set the itemDel to tab
repeat for each line L in tList
if item 1 of L contains "Easter" then
put item 1 of L into d
replace "Easter" with "" in d
if d is not empty then
set the itemDel to comma
put tFullEaster into newD
add d to item 3 of newD
convert newD to seconds
convert newD to dateItems
put item 2 of newD into newM
if newM < 10 then put "0" before newM
put item 3 of newD into newD
if newD < 10 then put "0" before newD
put newM & "/" & newD into d
set the itemDel to tab
else
put easterDate into d
end if
put d & tab & item 2 of L & cr after tNew
else
put L & cr after tNew
end if
end repeat
delete last char of tNew
put tNew into tList
-- reduce list to current month only
replace tShortMonth & ". " with tMonthNum & "/" in tList
replace tShortMonth & space with tMonthNum & "/" in tList
replace tLongMonth & "." with tMonthNum & "/" in tList
filter tList with tMonthNum & "/*"
-- convert weekday dates to real dates
put empty into tNew
repeat for each line L in tList
set the itemDel to tab
put item 1 of L into d
set the itemDel to "/"
put item 2 of d into w
set the itemDel to tab
-- ignore variable dates
if last char of w = "*" then next repeat
if w is not a number then
put relativeDate(w, tMonthNum, tYear) into newDate
put newDate & tab & item 2 of L & cr after tNew
else
put L & cr after tNew
end if
end repeat
delete last char of tNew
if pFullMonth <> true then
filter tNew with tMonthNum & "/" & tDateNum & tab & "*"
end if
sort lines of tNew
return tNew
end filterDate
function calcEaster pYear
-- [in] wYear - 4-digit year to calculate (but not before 1583)
-- [out] wMonth - month of easter sunday
-- [out] wDay - day of easter sunday
put 0 into wCorrection
if( pYear < 1700 ) then put 4 into wCorrection
else if pYear < 1800 then put 5 into wCorrection
else if pYear < 1900 then put 6 into wCorrection
else if pYear < 2100 then put 0 into wCorrection
else if pYear < 2200 then put 1 into wCorrection
else if pYear < 2300 then put 2 into wCorrection
else if pYear < 2500 then put 3 into wCorrection
put (19 * (pYear mod 19) + 24) mod 30 into wDay
put 22 + wDay + ((2 * (pYear mod 4) + 4 * (pYear mod 7) + 6 * wDay + 5 + wCorrection) mod 7) into wDay
-- jump to next month
if wDay > 31 then
put 4 into wMonth
subtract 31 from wDay
else
put 3 into wMonth
end if
if wMonth < 10 then put "0" before wMonth
if wDay < 10 then put "0" before wDay
return wMonth & "/" & wDay
end calcEaster
-- pDate is in a format where the first 3 chars are the abbreviated day name
-- the remainder is either First, Second, Third, Fourth, Last
-- or +1, +2, +3, +4 for 1st, 2nd, 3rd & 4th
--
function relativeDate pDate, pMonth, pYear
-- extract the day name & convert to a number
put char 1 to 3 of pDate into tDayName
put the abbrev weekDayNames into tDayList
get lineOffset(tDayName, tDayList)
if it = 0 then return empty
put it into tDayNum
put char 4 to -1 of pDate into tSet
if char 1 of tSet = "+" then delete char 1 of tSet
-- find first whatever day in the month
put pMonth & "/1/" & pYear into firstDate
convert firstDate to dateItems
put last item of firstDate into firstDayNum
put tDayNum - firstDayNum into dayDiff
if dayDiff < 0 then add 7 to dayDiff
add dayDiff to item 3 of firstDate
convert firstDate to seconds
convert firstDate to dateItems
-- add weeks as necessary
switch tSet
case "First"
case "1"
break
case "Second"
case "2"
add 7 to item 3 of firstDate
break
case "Third"
case "3"
add 14 to item 3 of firstDate
break
case "Fourth"
case "4"
add 21 to item 3 of firstDate
break
case "Fifth"
case "5"
add 28 to item 3 of firstDate
break
case "Last"
-- try week 5 and if that doesn't work, use week 4
put firstDate into testDate
add 28 to item 3 of testDate
convert testDate to seconds
convert testDate to dateItems
if item 2 of testDate = pMonth then
put testDate into firstDate
else
add 21 to item 3 of firstDate
end if
break
end switch
convert firstDate to seconds
convert firstDate to dateItems
put item 2 of firstDate into newM
put item 3 of firstDate into newD
if newM < 10 then put "0" before newM
if newD < 10 then put "0" before newD
return newM & "/" & newD
end relativeDate
on showDisplayedDate pDate, pIsMonth
if pIsMonth = true then
convert pDate from short English date to dateItems
put item 2 of pDate into monthNum
put line monthNum of the system monthNames & space & item 1 of pDate into fld "ShownDate"
else
convert pDate from short English date to long system date
put pDate into fld "ShownDate"
end if
set the hilitedLine of fld "Today" to empty
end showDisplayedDate
function getDisplayedDate
put fld "ShownDate" into tDate
if the number of words in tDate = 2 then
-- showing month & year only
put word 1 of tDate into monthName
put lineOffset(monthName, the system monthNames) into monthNumber
put word 2 of tDate & comma & monthNumber & comma & "1,0,0,0,0" into newDate
convert newDate from dateItems to short system date
convert newDate from short system date to dateItems
return newDate
else
-- showing long system date
convert tDate from long system date to dateItems
return tDate
end if
end getDisplayedDate
on resizeStack newW, newH, oldW, oldH
set the width of fld "ShownDate" to newW - 32
set the topLeft of fld "ShownDate" to "16,28"
if the cShowButtons of me = true then put 118 into tBase
else put 50 into tBase
set the width of fld "Today" to newW - 32
set the height of fld "Today" to newH - tBase
set the topLeft of fld "Today" to "16,58"
if the cShowButtons of me = false then exit resizeStack
set the loc of btn "Previous Day" to "76," & newH - 38
set the loc of btn "Previous Month" to "76," & newH - 4
set the loc of btn "Today" to (newW div 2 & comma & newH - 38)
set the loc of btn "This month" to (newW div 2 & comma & newH - 4)
set the loc of btn "Next Day" to (newW - 76 & comma & newH - 38)
set the loc of btn "Next Month" to (newW -76 & comma & newH - 4)
end resizeStack
on toggleButtonDisplay
lock screen
if the cShowButtons of me = true then
show grp "Buttons"
put "Hide buttons/B" into line 9 of btn "File"
else
hide grp "Buttons"
put "Show buttons/B" into line 9 of btn "File"
end if
resizeStack the width of this stack, the height of this stack
if the cShowButtons of me = true then
unlock screen with visual effect wipe up very fast
else
unlock screen with visual effect wipe down very fast
end if
end toggleButtonDisplay
on clearAll
put empty into fld "ShownDate"
put empty into fld "Today"
end clearAll
@ cREVGeometryCacheIDs 1074134112295 10031074134185521 10131074134133470 10091074134133469 10081074134133471 10101074204589728 10181074134126860 10051074134126861 10061074205548252 10141074134126862 10071074205548253 10151074205548254 1017 cREVGeometrycache total 12order p 1074134112295 1074134185521 1074134126861 1074134126862 1074134133470 1074134133471 1074134126860 1074134133469 Today ` : y P cREVGeometry Master,scaleBottomObjectSide BottomMaster,movehDistance falseMaster,scaleBottomscaleBottom trueMaster,scaleRightscaleBottom trueMaster trueMaster,scaleTopObjectRef cardMaster,scaleLeftObjectRef cardMaster,scaleBottomObjectRef cardMaster,scaleBottomAbsolute falseMaster,scaleBottom falseMaster,scaleTopObjectSide TopMaster,scaleLeftObjectSide LeftMaster,expectedRect 16,34,484,216Master,scalebottomDistance -0.28Master,movevDistance falseMaster,scaleRightAbsolute falseMaster,scaleRight falseMaster,scalerightDistance -0.032Master,scaleTopAbsolute trueMaster,scaleLeftAbsolute trueMaster,scaleRightObjectSide RightMaster,scaleRightObjectRef cardMaster,scaleTop falseMaster,scaleLeft falseMaster,cardRanking 0Master,scaleleftDistance 16Master,scaletopDistance 34 cREVGeneral revUniqueID 1074134112295 ` ; h a ShownDate cREVGeometry Master,movehDistance falseMaster,scaleRightscaleBottom trueMaster trueMaster,scaleLeftObjectRef cardMaster,scaleLeftObjectSide LeftMaster,movevDistance falseMaster,scalebottomDistance Master,expectedRect 16,8,484,29Master,scaleRightAbsolute falseMaster,scaleRight falseMaster,scalerightDistance -0.032Master,scaleRightObjectRef cardMaster,scaleRightObjectSide RightMaster,scaleLeftAbsolute trueMaster,scaleLeft falseMaster,cardRanking 0Master,scaletopDistance Master,scaleleftDistance 16 cREVGeneral revUniqueID 1074134185521 bookmarks handlerList tempScript prevHandler scriptSelection char 205 to 204script ucMenubar I on mouseDown if the cShowButtons of this stack = true then put "Hide buttons/B" into line 9 of btn "File" else put "Show buttons/B" into line 9 of btn "File" end if end mouseDown N cREVGeneral scriptChecksum ڃ!X bookmarks revUniqueID 1074205548251handlerList mouseDownscriptSelection char 193 to 192prevHandler mouseDowntempScript scripton mouseDown
if the cShowButtons of this stack = true then
put "Hide buttons/B" into line 9 of btn "File"
else
put "Show buttons/B" into line 9 of btn "File"
end if
end mouseDown
File ŋU--The following menuPick handler was generated by the Menu Builder. on menuPick pWhich switch pWhich case "Today" case "Previous day" case "Next day" case "This month" case "Previous month" case "Next month" send mouseUp to btn pWhich break case "Hide buttons" set the cShowButtons of this stack to false toggleButtonDisplay break case "Show buttons" set the cShowButtons of this stack to true toggleButtonDisplay break case "Quit" quit break end switch end menuPick kToday/T Previous day/R Next day/Y - This month/M Previous month/N Next month/, - Show buttons/B (- &Quit/Q cREVGeneral scriptChecksum 0;O3o?Gm bookmarks revUniqueID 1074205548252handlerList menuPickscriptSelection char 531 to 530prevHandler menuPicktempScript script--The following menuPick handler was generated by the Menu Builder.
on menuPick pWhich
switch pWhich
case "Today"
case "Previous day"
case "Next day"
case "This month"
case "Previous month"
case "Next month"
send mouseUp to btn pWhich
break
case "Hide buttons"
set the cShowButtons of this stack to false
toggleButtonDisplay
break
case "Show buttons"
set the cShowButtons of this stack to true
toggleButtonDisplay
break
case "Quit"
quit
break
end switch
end menuPick
Help ŋU--The following menuPick handler was generated by the Menu Builder. on menuPick pWhich switch pWhich case "Help" answer information "You don't need any help." & cr & \ "Just read the text and click the buttons :-)" & cr & cr & \ "The shortcuts are arranged so " & numToChar(17) & "T is today" & cr & \ "and " & numToChar(17) & "M is this month with the keys on either" & cr & \ "side moving forwards or backwards." \ as sheet break case "About UnixCal..." answer information "This application takes data from" & cr & \ "the FreeBSD calendar utility." & cr & cr & \ "The raw data is in /usr/share/calendars/" & cr & \ "but you will need to juggle with" & cr & \ "privileges if you want to edit it." & cr & cr & \ "Sarah Reichelt