home *** CD-ROM | disk | FTP | other *** search
/ The Weather Channel - Everything Weather / TheWeatherChannel-EverythingWeather-Win31.iso / twcia / calndr1 / calndr1.dxr / 00021.ls < prev    next >
Encoding:
Text File  |  1995-08-25  |  2.2 KB  |  67 lines

  1. on setCal
  2.   clearAll()
  3.   set theFont to "Times New Roman"
  4.   set fontSize to 18
  5.   set lineheight to 43
  6.   set the textSize of field "sun" to fontSize
  7.   set the textHeight of field "sun" to lineheight
  8.   set the textFont of field "sun" to theFont
  9.   set the textSize of field "mon" to fontSize
  10.   set the textHeight of field "mon" to lineheight
  11.   set the textFont of field "mon" to theFont
  12.   set the textSize of field "tue" to fontSize
  13.   set the textHeight of field "tue" to lineheight
  14.   set the textFont of field "tue" to theFont
  15.   set the textSize of field "wed" to fontSize
  16.   set the textHeight of field "wed" to lineheight
  17.   set the textFont of field "wed" to theFont
  18.   set the textSize of field "thu" to fontSize
  19.   set the textHeight of field "thu" to lineheight
  20.   set the textFont of field "thu" to theFont
  21.   set the textSize of field "fri" to fontSize
  22.   set the textHeight of field "fri" to lineheight
  23.   set the textFont of field "fri" to theFont
  24.   set the textSize of field "sat" to fontSize
  25.   set the textHeight of field "sat" to lineheight
  26.   set the textFont of field "sat" to theFont
  27. end
  28.  
  29. on minderFinder
  30.   global thisMonth, firstDayOfMonthList, spriteOffset, thisYear, firstDay, offsetX, offsetY, width, height, minderSprite, HDPath
  31.   cursor(4)
  32.   set year to string(thisYear)
  33.   set fileType to char 1 to 3 of thisMonth
  34.   set minderList to []
  35.   repeat with i = 1 to the maxinteger
  36.     set x to getNthFileNameInFolder(HDPath & "calndr1\", i)
  37.     if x = EMPTY then
  38.       exit repeat
  39.     end if
  40.     if (x contains fileType) and (x starts year) then
  41.       append(minderList, x)
  42.     end if
  43.   end repeat
  44.   if count(minderList) <> 0 then
  45.     clearMinder()
  46.     repeat with i = 1 to count(minderList)
  47.       set n to getAt(minderList, i)
  48.       if char 6 of n = "." then
  49.         set dayNumber to value(char 5 of n)
  50.       else
  51.         set dayNumber to value(char 5 to 6 of n)
  52.       end if
  53.       set location to dayNumber + firstDay - 2
  54.       set the locV of sprite minderSprite to offsetY + (location / 7 * height)
  55.       set the locH of sprite minderSprite to offsetX + (location mod 7 * width)
  56.       updateStage()
  57.     end repeat
  58.     set the locV of sprite minderSprite to -20
  59.     set the locH of sprite minderSprite to -20
  60.     updateStage()
  61.   end if
  62.   cursor(-1)
  63. end
  64.  
  65. on clearMinder
  66. end
  67.