home *** CD-ROM | disk | FTP | other *** search
- /**************************************************/
- /* CALENDAR GENIE FOR PROFESSIONAL PAGE */
- /* by John White */
- /* NOVEMBER 5, 1993 */
- /**************************************************/
-
- /*------------- CHECK AND MAKE SURE A PAGE HAS BEEN CREATED ---*/
- fpage = ppm_DocFirstPage()
- if fpage = 0
- then choiceint = ppm_Inform(2,"You must create a page first!","CREATE","CANCEL")
- if choiceint = 1 then exit
- else
- newpage = ppm_CreatePage(ppm_CurrentPage() + 1,1,0,0,0)
- endif
- endif
- call ppm_SetMagMode(50)
-
- /* -----------CREATING MONTH AT TOP OF PAGE-----------*/
- call ppm_SetBoxOutlines(0)
- call AutoUpdate(0)
- FontSize = SetSize(58)
- cr = '0a'x
- Monthtitle = DATE('Month')
- year= word(DATE(),3)
- call SafeEndEdit.rexx()
- form = "Month:"monthtitle||cr"Year:"year
- form = ppm_GetForm("Spell out month...",10,form)
- If form = "" then exit
- parse var form monthtitle '0a'x year
- monthtitle = UPPER(monthtitle)
-
- /* ---------- PICK OUT YOUR FAVORITE TYPE FACE --------- */
- facelist = ppm_GetTypeFaceList()
- facelist = substr(facelist, pos('0a'x, facelist) +1)
- face = ppm_SelectFromList("Select Typeface",32,18,0,facelist)
- If face = "" then face = "(CG)Times"
- call ppm_SetFont(face)
-
- /*------------ PUT THE MONTH AND YEAR AT TOP OF CALENDAR ----*/
- boxid = CreateBox(.25,.25,7.75,1.3,0,monthbox)
- Boxid = SetEdit(monthbox)
- call ppm_SetJustification(2)
- Success = InsertText(monthtitle||" "||year)
- call SafeEndEdit.rexx()
-
- /* -----------CREATING BOXES FOR DAYS OF THE WEEK-----*/
- call ppm_SetLineWeight(1)
- t=0
- do i = 0 to 6
- boxid = DrawRect((t+.3),1,(t+1.4),1.3,daybox||(i))
- t=t+1.1
- end
-
- /* ------------NOW PUTTING IN DAYS OF WEEK-----*/
- FontSize = SetSize(20)
- tick =0
- d=0
- do i = 0 to 6
- tick = i+1
- day = WORD("SUN MON TUE WED THU FRI SAT",tick)
- boxid = CreateBox((d+.5),1.05,.75,.5,0,day)
- Boxid = SetEdit(day)
- Success = InsertText(day)
- d=d+1.1
- call SafeEndEdit.rexx()
- end
-
- /* ------------SETTING UP CALENDAR-----*/
- call ppm_ShowStatus("Drawing calendar... hold on!")
- If monthtitle = "JANUARY" then month = "01 31"
- If monthtitle = "FEBRUARY" then month = "02 28"
- If monthtitle = "MARCH" then month = "03 31"
- If monthtitle = "APRIL" then month = "04 30"
- If monthtitle = "MAY" then month = "05 31"
- If monthtitle = "JUNE" then month = "06 30"
- If monthtitle = "JULY" then month = "07 31"
- If monthtitle = "AUGUST" then month = "08 31"
- If monthtitle = "SEPTEMBER" then month ="09 30"
- If monthtitle = "OCTOBER" then month = "10 31"
- If monthtitle = "NOVEMBER" then month = "11 30"
- If monthtitle = "DECEMBER" then month = "12 31"
-
- /* -----------FIGURING OUT FIRST DAY OF MONTH-----*/
- amonth = WORD(month,1)
- tab = year||amonth||"01"
- firstday = DATE('w',(tab),'S')
- If firstday = "Sunday" then firstday = 1
- If firstday = "Monday" then firstday = 2
- If firstday = "Tuesday" then firstday = 3
- If firstday = "Wednesday" then firstday = 4
- If firstday = "Thursday" then firstday = 5
- If firstday = "Friday" then firstday = 6
- If firstday = "Saturday" then firstday = 7
-
- /* ----------DRAWING BOXES FOR DAYS-----*/
- days = WORD(month,2)
- d=0
- count = 1
- t=(firstday-1)*1.1
- days = days+firstday-1
- do w = firstday to days
- If w = 8 then d = 1.7
- If w = 15 then d = 3.4
- If w = 22 then d = 5.1
- If w = 29 then d = 6.8
- boxid=DrawRect((t+.3),(d+1.5),(t+1.4),(d+3.2),weekbox||(count))
- t =t+1.1
- if t = 7.7 then t=0
- count = count +1
- end
- call ppm_ClearStatus()
-
- /*------------PUTTING IN THE DATES-----*/
- FontSize = SetSize(24)
- e=0
- d=0
- count = 1
- /*click =0*/
- d=(firstday-1)*1.09
- do i = firstday to days
- If i = 8 then e = 1.7
- If i = 15 then e =3.4
- If i = 22 then e = 5.1
- If i = 29 then e = 6.8
- boxid = CreateBox((d+.4),(e+1.56),.75,.5,0,dayx||(count))
- Boxid = SetEdit(dayx||(count))
- call ppm_SetJustification(0)
- Success = InsertText(count)
- count = count +1
- d=d+1.09
- if d =7.63 then d =0
- call SafeEndEdit.rexx()
- end
-
- /* ----------NOW LET'S PUT IN SOME IMPORTANT DATES---*/
- i=0
- call ppm_SetFont("(CG)Times")
- call ppm_SetJustification(0)
- FontSize = SetSize(10)
-
- choiceint = Inform(2,"Add an important note...?","NO","YES")
- If choiceint = 0
- then exit
- else
- Do forever
- whichbox = ClickOnBox("Click on the day...")
- if whichbox = 0 then leave
- where = getBoxPosition(whichbox)
- bname = GetBoxName(whichbox)
- bname = substr(bname,8)
- monthtitle = substr(monthtitle,1,3)
- where1 = WORD(where,1)
- where2 = WORD(where,2)
- form = "Note:"
- form = ppm_GetForm("Date picked: "||(monthtitle)||". "||(bname),24,form)
- parse var form note
- boxid = CreateBox(where1+.1,where2+.45,.85,1.25,0,datebox||(i))
- boxid = SetEdit(datebox||(i))
- success = InsertText(note)
- call SafeEndEdit.rexx()
- i=i+1
- end
- endif
-
-
-