// Text of project MonthPrint written on 12/11/99 at 22:30 // Beginning of text file definitions.f // Copyright (C) 1999 Brian Sulcer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the / ,‹x,‹@/ GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA constant kPortraitSymbol := '|portait:MonthPrint:HyprMynd|; constant kLandscapeSymbol := '|landscape:MonthPrint:HyprMynd|; constant kDefaultPrefs := '{ printEvents: true, printMeetings: true, printWeekNum: false, }; OpenResFile(home & ,‹x,‹@ "Bitmaps.rsrc"); DefConst('kDatesIcon, GetPictAsBits("Dates icon", nil)); DefConst('kAppIcon, GetPictAsBits("MonthPrint Icon", nil)); CloseResFile(); constant kMyPackageName := "Month Print"; constant kAboutString := "v2.2 ©1999 Brian Sulcer\n\n" & "Adds a month view print format to the Dates application\n\n" & "email: bsulcer@hyprmynd.com\n" & "url: http://www.hyprmynd.com/"; constant kOneDay := 1440; constant kOneWeek := kOneDay * 7; constant kVersionString := "v2.2"; SetPartFrameSlot('tex ,‹x,‹@t, "MonthPrint"); SetPartFrameSlot('app, kAppSymbol); SetPartFrameSlot('icon, kAppIcon); SetPartFrameSlot('TapAction, func() begin GetRoot():Notify(kNotifyQAlert, kMyPackageName, kAboutString); return nil; end; ); DefConst('kAppAboutViewSym, Intern("about:" & SPrintObject(kAppSymbol))); application\n\n" & "email: bsulcer@hyprmynd.com\n" & "url: http://www.hyprmynd.com/"; constant kOneDay := 1440; constant kOneWeek := kOneDay * 7; constant kVersionString := "v2.2"; SetPartFrameSlot('tex // End of text file definitions.f // Beginning of file protoAboutBox // Before Script for protoAboutBox // Copyright (C) 1999 Brian Sulcer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA protoAboutBox := {viewBounds: {left: 0, top: 0, right: 200, bottom: 180}, viewDrawScript: func() begin local localBox := :LocalBox(); local text; local bounds; local titleFont := {family: 'newYork, face: kFaceBold, size: 18}; local versionFont := {family: 'geneva, face: kFaceNormal, size: 9}; local creditFont := {family: 'newYork, face: kFaceNormal, size: 12}; local textFont := {family: 'espy, face: kFaceNormal, size: 10}; local reminderFont := {family: 'espy, face: kFaceBold, size: 10}; // app title bounds := SetBounds(40, 5, localBox.right, localBox.bottom); TextBox(appName, {font: titleFont, justification: 'left}, bounds); // app version bounds := SetBounds(42, bounds.top + FontHeight(titleFont), localBox.right, localBox.bottom); TextBox(versionString, {font: versionFont, justification: 'left}, bounds); // copyright info bounds := SetBounds(5, 45, localBox.right, localBox.bottom); TextBox(copyrightString, {font: textFont, justification: 'left}, bounds); // contact info bounds := SetBounds(5, bounds.top + (FontHeight(textFont) * 2) + 5, localBox.right, localBox.bottom); TextBox(contactString, {font: textFont, justification: 'left}, bounds); // notice bounds := SetBounds(5, bounds.top + (FontHeight(textFont) * 2) + 5, localBox.right - 5, localBox.bottom); TextBox(noticeString, {font: textFont, justification: 'left}, bounds); end , viewJustify: 80, viewEffect: 7314465, appIcon: nil, appName: "Text", creditString: "Text", versionString: "Text", copyrightString: "Text", contactString: "Text", noticeString: "Text", viewSetupDoneScript: func() begin appIconView.icon := self.appIcon; end, _proto: @179 /* protoFloater */ }; appIconView := {icon: nil, viewBounds: {left: 5, top: 5, right: 37, bottom: 37}, viewFlags: 1, viewFormat: nil, viewClass: 76 /* clPictureView */ }; AddStepForm(protoAboutBox, appIconView); StepDeclare(protoAboutBox, appIconView, 'appIconView); protoAboutBox_v166_0 := {_proto: @166 /* protoCloseBox */}; AddStepForm(protoAboutBox, protoAboutBox_v166_0); constant |layout_protoAboutBox| := protoAboutBox; // End of file protoAboutBox // Beginning of file columnHeader.t // Before Script for _v81_0 // Copyright (C) 1999 Brian Sulcer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA _v81_0 := {viewFlags: 3, viewFont: tsSimple + tsSize(12) + tsBold, viewFormat: 257, viewLineSpacing: 20, viewJustify: 16777222, viewClass: 81 /* clParagraphView */ }; constant |layout_columnHeader.t| := _v81_0; // End of file columnHeader.t // Beginning of file dayView.t // Before Script for dayView // Copyright (C) 1999 Brian Sulcer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA dayView := {viewBounds: {left: 48, top: 40, right: 176, bottom: 200}, viewFlags: 3, viewFormat: 256, viewSetupFormScript: func() begin if not values then viewFlags := viewFlags - vVisible; else if IsNumber(values) then viewFormat := viewFormat - vfFrameBlack; end , values: nil, viewClass: 74 /* clView */ }; date := {viewBounds: {left: 28, top: 3, right: -3, bottom: 20}, viewFont: tsSimple + tsSize(12) + tsBold, viewFormat: 256, viewLineSpacing: 20, viewJustify: 16777269, viewSetupFormScript: func() begin if values then if IsFrame(values) then self.text := values.date; else self.viewFlags := viewFlags - vVisible; end , viewFlags: 3, viewClass: 81 /* clParagraphView */ }; AddStepForm(dayView, date); weekNum := {viewBounds: {left: 3, top: 3, right: 28, bottom: 20}, viewFont: tsSimple + tsSize(10) + tsPlain, viewFormat: 256, viewLineSpacing: 20, viewJustify: 16777216, viewSetupFormScript: func() begin if values then if IsFrame(values) then self.text := NumberStr(values.weekNum); else self.text := NumberStr(values); end , viewFlags: 3, viewClass: 81 /* clParagraphView */ }; AddStepForm(dayView, weekNum); content := {viewBounds: {left: 3, top: 20, right: -3, bottom: -3}, viewFont: tsSimple + tsSize(9) + tsPlain, viewFormat: 256, viewLineSpacing: 10, viewJustify: 240, viewSetupFormScript: func() begin if values then if IsFrame(values) then self.text := values.content; else self.viewFlags := viewFlags - vVisible; end , viewFlags: 3, viewClass: 81 /* clParagraphView */ }; AddStepForm(dayView, content); constant |layout_dayView.t| := dayView; // End of file dayView.t // Beginning of file aboutBox.t // Before Script for aboutBox // Copyright (C) 1999 Brian Sulcer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA aboutBox := {versionString: "version 2.2", copyrightString: "copyright \u00A9\u 1999 Brian Sulcer.\nAll rights reserved.\n", contactString: "email: bsulcer@hyprmynd.com\nurl: http://www.hyprmynd.com/\n", noticeString: "This program comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are free to redistribute it under certain conditions. See the file license.txt for details." , appName: "Month Print", appIcon: MakePixFamily( GetResourceFromFile({filename: "Shusaku:Brian's Stuff:Projects:month-print:bitmaps.rsrc", resource: 129}), GetResourceFromFile({filename: ":\"\u0001\u,}@", resource: }), [ {rsrcSpec: GetResourceFromFile({filename: "Shusaku:Brian's Stuff:Projects:month-print:bitmaps.rsrc", resource: 129}), bitDepth: 1}, {rsrcSpec: GetResourceFromFile({filename: ":\"\u0001\u,}@", resource: }) , bitDepth: 2}, {rsrcSpec: GetResourceFromFile({filename: ":\"\u0001\u,}@", resource: }) , bitDepth: 4}, {rsrcSpec: GetResourceFromFile({filename: ":\"\u0001\u,}@", resource: }) , bitDepth: 8}]);, viewBounds: {left: 0, top: 0, right: 180, bottom: 200}, _proto: protoAboutBox }; constant |layout_aboutBox.t| := aboutBox; // End of file aboutBox.t // Beginning of file auxiliaryForm.t // Before Script for AuxForm // Copyright (C) 1999 Brian Sulcer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA AuxForm := {viewBounds: {left: 0, top: 0, right: 200, bottom: 125}, viewJustify: 80, viewQuitScript: // must return the value of inherited:?viewQuitScript(); func() begin local ourPrefsEntry := GetAppPrefs(kAppSymbol, kDefaultPrefs); ourPrefsEntry.printEvents := EventsToggle.viewValue; ourPrefsEntry.printMeetings := MeetingsToggle.viewValue; ourPrefsEntry.printWeekNum := weekNumToggle.viewValue; EntryChange(ourPrefsEntry); inherited:?viewQuitScript(); end , viewSetupDoneScript: func() begin local ourPrefsEntry := GetAppPrefs(kAppSymbol, kDefaultPrefs); if ourPrefsEntry.printEvents then EventsToggle:ToggleCheck(); if ourPrefsEntry.printMeetings then MeetingsToggle:ToggleCheck(); if ourPrefsEntry.printWeekNum then weekNumToggle:ToggleCheck(); end , _proto: @180 /* protoFloatNGo */ }; AuxForm_v229_0 := {title: "MonthPrint Prefs", viewBounds: {left: 0, top: 5, right: 100, bottom: 25}, _proto: @229 /* protoTitle */ }; AddStepForm(AuxForm, AuxForm_v229_0); AuxForm_v218_0 := {text: "Types of Appointments to Print:", viewBounds: {left: 5, top: 5, right: -5, bottom: 20}, viewJustify: 8240, _proto: @218 /* protoStaticText */ }; AddStepForm(AuxForm, AuxForm_v218_0); EventsToggle := {text: "Events", viewBounds: {left: 5, top: 0, right: 95, bottom: 15}, viewJustify: 8196, viewValue: nil, _proto: @164 /* protoCheckBox */ }; AddStepForm(AuxForm, EventsToggle); StepDeclare(AuxForm, EventsToggle, 'EventsToggle); MeetingsToggle := {text: "Meetings", viewBounds: {left: 5, top: 0, right: 95, bottom: 15}, viewJustify: 8196, viewValue: nil, _proto: @164 /* protoCheckBox */ }; AddStepForm(AuxForm, MeetingsToggle); StepDeclare(AuxForm, MeetingsToggle, 'MeetingsToggle); weekNumToggle := {text: "Print week numbers", viewBounds: {left: 5, top: 5, right: 150, bottom: 20}, viewJustify: 8196, viewValue: nil, viewFont: tsSize(9) + tsBold, _proto: @164 /* protoCheckBox */ }; AddStepForm(AuxForm, weekNumToggle); StepDeclare(AuxForm, weekNumToggle, 'weekNumToggle); AuxForm_v478_0 := {viewFlags: 515, viewJustify: 134, viewBounds: {left: 5, top: -16, right: 18, bottom: -3}, DoInfoAbout: func() begin GetRoot().(kAppAboutViewSym):FilterDialog(); end , _proto: @478 /* protoInfoButton */ }; AddStepForm(AuxForm, AuxForm_v478_0); constant |layout_auxiliaryForm.t| := AuxForm; // End of file auxiliaryForm.t // Beginning of file statusView.t // Before Script for _v467_0 // Copyright (C) 1999 Brian Sulcer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA _v467_0 := { vMyBarber: { name: 'vMyBarber, height: 70, kids: [ protoStatusText, protoStatusBarber, ], } , initialSetup: { name: 'vMyBarber, appSymbol: kAppSymbol, values: { icon: kDatesIcon, statusText: "Collecting Dates", gauge: 0, closeBox: nil, }, } , _proto: @467 /* protoStatusTemplate */ }; constant |layout_statusView.t| := _v467_0; // End of file statusView.t // Beginning of file printFormat.t // Before Script for monthPrintFormat // Copyright (C) 1999 Brian Sulcer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA monthPrintFormat := {printNextPageScript: func() begin nil; end, margins: {left: 30, top: 0, right: 20, bottom: 0}, SetupItem: func(item,tInfo) begin local newTarget := Clone(tInfo.target); local calendar := GetRoot().calendar; // set target info newTarget.startDate := calendar:GetSelectedDates()[0]; // save new target tInfo.target := newTarget; item.title := "Month View"; inherited:?SetupItem(item, tInfo); end , ImportDates: func(startDate, stopDate, statusView) begin local ourLocale := GetLocale(); local ourPrefsEntry := GetAppPrefs(kAppSymbol, kDefaultPrefs); local firstDay := GetUserConfig('firstDayOfWeek); local dayOfWeek, currentDate; local newText, weekNum; local i; local prefs := GetAppPrefs(kAppSymbol, kDefaultPrefs); prefs.dayTexts := []; if not firstDay then firstDay := ourLocale.firstDayOfWeek; currentDate := startDate; for i := 0 to 41 do begin dayOfWeek := (firstDay + i) MOD 7; if (dayOfWeek = firstDay) and ourPrefsEntry.printWeekNum then begin aDate := Date(currentDate); aDate.month := 0; aDate.date := 1; aDate.hour := 0; aDate.minute := 0; weekNum := (currentDate - TotalMinutes(aDate)) DIV kOneWeek + 1; end; else weekNum := nil; if ((Date(currentDate).dayOfWeek = dayOfWeek) AND (currentDate < stopDate)) then begin newText := ""; if ourPrefsEntry.printEvents then begin events := GetRoot().calendar:FindAppointment(nil, nil, [currentDate, currentDate + 1439], ['Event, 'RepeatingEvent], 5); if events <> nil then begin foreach event in events do begin if (event.mtgText exists) then newText := newText & event.mtgText & "\n"; else newText := event.repeatTemplate.mtgText & "\n" & newText; end; end; end; if ourPrefsEntry.printMeetings then begin meetings := GetRoot().calendar:FindAppointment(nil, nil, [currentDate, currentDate + 1439], ['Meeting, 'RepeatingMeeting], 5); if meetings <> nil then begin foreach meeting in meetings do begin if (meeting.mtgText exists) then newText := newText & TimeStr(meeting.mtgStartDate, ROM_dateTimeStrSpecs.shortTimeStrSpec) && meeting.mtgText & "\n"; else newText := newText & TimeStr(meeting.mtgStartDate, ROM_dateTimeStrSpecs.shortTimeStrSpec) && meeting.repeatTemplate.mtgText & "\n"; end; end; end; AddArraySlot(prefs.dayTexts, { date: NumberStr((currentDate - startDate) / kOneDay + 1), content: newText, weekNum: weekNum, } ); currentDate := currentDate + kOneDay; end; else begin if (dayOfWeek = firstDay) AND (currentDate < stopDate) then AddArraySlot(prefs.dayTexts, weekNum); else AddArraySlot(prefs.dayTexts, nil); end; statusView:UpdateIndicator({values: {gauge: 1}}); end; EntryChange(prefs); end , FormatInitScript: func(item, reserved) begin local aDate := Date(item.body.startDate); local startDate, stopDate; local statusView := BuildContext(GetLayout("statusView.t")); local ourPrefsEntry := GetAppPrefs(kAppSymbol, kDefaultPrefs); // set the start date aDate.date := 1; aDate.hour := 0; aDate.minute := 0; aDate.second := 0; startDate := TotalMinutes(aDate); // set stop date stopDate := IncrementMonth(startDate, 1); // import info from Dates ourPrefsEntry.dayTexts := nil; statusView:Open(); try :ImportDates(startDate, stopDate, statusView); onException |evt.ex| do statusView:Close(); statusView:Close(); end , CountPages: func(item, target) begin return 1; end, auxForm: GetLayout("auxiliaryForm.t");, version: 20, viewQuitScript: func() begin local prefs := GetAppPrefs(kAppSymbol, kDefaultPrefs); prefs.dayTexts := nil; EntryChange(prefs); inherited:?viewQuitScript(); // this method is defined internally end , _proto: @200 /* protoPrintFormat */ }; title := {text: "Static Text", viewJustify: 8388624, viewFont: tsSimple + tsSize(24) + tsBold, viewSetupFormScript: func() begin self.text := LongDateStr(target.startDate, ROM_dateTimeStrSpecs.yearMonthStrSpec); self.viewBounds := RelBounds(0, 0, 0, 30); TextBounds(text, viewFont, viewBounds); end , _proto: @218 /* protoStaticText */ }; AddStepForm(monthPrintFormat, title); headers := {viewBounds: {left: 0, top: 5, right: 0, bottom: 25}, viewFlags: 1, viewFormat: 0, viewJustify: 8240, tabAcross: 7, tabDown: 1, tabWidths: nil, tabHeights: nil, tabProtos: GetLayout("columnHeader.t");, tabValues: nil, tabValueSlot: nil, viewSetupChildrenScript: func() begin local box, cells; box := self:LocalBox(); viewWidth := box.right - box.left; viewHeight := box.bottom - box.top; tabWidths := viewWidth DIV tabAcross; tabHeights := viewHeight; tabValues := :GetTabValues(); tabValueSlot := 'text; self.stepChildren := self:LayoutTable(self, 0, 0); end , getTabValues: func() begin local ourLocale := GetLocale(); local firstDay := GetUserConfig('firstDayOfWeek); local labels := []; local i; if not firstDay then firstDay := ourLocale.firstDayOfWeek; for i := 0 to 6 do begin AddArraySlot(labels, ourLocale.longDateFormat.abbrDofWeek[(firstDay + i) MOD 7]); end; return labels; end , viewClass: 74 /* clView */ }; AddStepForm(monthPrintFormat, headers); days := {viewBounds: {left: 0, top: 55, right: 0, bottom: -30}, viewFlags: 1, viewFormat: 0, viewJustify: 240, tabAcross: 7, tabDown: 6, tabWidths: nil, tabHeights: nil, tabProtos: GetLayout("dayView.t");, tabValues: nil, tabValueSlot: nil, viewSetupChildrenScript: func() begin local box, cells; local prefs := GetAppPrefs(kAppSymbol, kDefaultPrefs); box := self:LocalBox(); viewWidth := box.right - box.left; viewHeight := box.bottom - box.top; tabWidths := viewWidth DIV tabAcross; tabHeights := viewHeight DIV tabDown; tabValues := prefs.dayTexts; tabValueSlot := 'values; self.stepChildren := self:LayoutTable(self, 0, 0); end , viewDrawScript: func() begin local box := self:LocalBox(); local lineWeight := 4; local i; local t, b; // draw horizontal lines // --------------------- // first row :DrawShape(MakeLine(box.left + (tabWidths * firstRowIndent), box.top, box.left + (tabWidths * 7), box.top), {penWidth: lineWeight}); :DrawShape(MakeLine(box.left + (tabWidths * firstRowIndent), box.top + tabHeights - 2, box.left + (tabWidths * 7), box.top + tabHeights - 2), {penWidth: lineWeight}); // middle rows for i := 1 to lastRow - 1 do begin :DrawShape(MakeLine(box.left, box.top + (i * tabHeights) - 2, box.left + (tabWidths * 7), box.top + (i * tabHeights) - 2), {penWidth: lineWeight}); :DrawShape(MakeLine(box.left, box.top + ((i + 1) * tabHeights) - 2, box.left + (tabWidths * 7), box.top + ((i + 1) * tabHeights) - 2), {penWidth: lineWeight}); end; // last row :DrawShape(MakeLine(box.left, box.top + (lastRow * tabHeights) - 2, lastRowOutdent * tabWidths, box.top + (lastRow * tabHeights) - 2), {penWidth: lineWeight}); :DrawShape(MakeLine(box.left, box.top + ((lastRow + 1) * tabHeights) - 2, lastRowOutdent * tabWidths, box.top + ((lastRow + 1) * tabHeights) - 2), {penWidth: lineWeight}); // draw vertical lines // ------------------- for i := 0 to 6 do begin if i < firstRowIndent then t := tabHeights; else t := 0; if i >= lastRowOutdent then b := (tabHeights * lastRow) - 2; else b := (tabHeights * (lastRow + 1)) - 2; :DrawShape(MakeLine(box.left + (i * tabWidths), box.top + t, box.left + (i * tabWidths), box.top + b), {penWidth: lineWeight}); :DrawShape(MakeLine(box.left + ((i + 1) * tabWidths), box.top + t, box.left + ((i + 1) * tabWidths), box.top + b), {penWidth: lineWeight}); end; end , viewSetupDoneScript: func() begin local i; local t, b; local prefs := GetAppPrefs(kAppSymbol, kDefaultPrefs); // calculate values needed for line drawing // ---------------------------------------- self.lastRow := 0; self.firstRowIndent := 0; self.lastRowOutdent := 0; if prefs.dayTexts[35] <> nil then self.lastRow := 5; else if prefs.dayTexts[28] <> nil then self.lastRow := 4; else self.lastRow := 3; i := 0; while (prefs.dayTexts[i] = nil) OR IsInteger(prefs.dayTexts[i]) do begin i := i + 1; end; self.firstRowIndent := i; i := 6; while NOT IsFrame(prefs.dayTexts[(lastRow * 7) + i]) do begin i := i - 1; end; self.lastRowOutdent := i + 1; prefs.dayTexts := nil; EntryChange(prefs); end , lastRow: nil, firstRowIndent: nil, lastRowOutdent: nil, viewClass: 74 /* clView */ }; AddStepForm(monthPrintFormat, days); footer := {text: "", viewBounds: {left: 0, top: -30, right: 0, bottom: -15}, viewJustify: 8388784, viewSetupFormScript: func() begin self.text := "printed" && LongDateStr(target.timestamp, ROM_dateTimeStrSpecs.longDateStrSpec) && TimeStr(target.timestamp, ROM_dateTimeStrSpecs.shortTimeStrSpec); end , viewFont: tsSize(9) + tsPlain, _proto: @218 /* protoStaticText */ }; AddStepForm(monthPrintFormat, footer); constant |layout_printFormat.t| := monthPrintFormat; // End of file printFormat.t // Beginning of text file partData.f // Copyright (C) 1999 Brian Sulcer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the / ,‹x,‹@/ GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA partData := { protoMonthPrintFmt: GetLayout("printFormat.t"), aboutView: GetLayout("aboutBox.t"), }; useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the / // End of text file partData.f // Beginning of text file install and remove.f // Copyright (C) 1999 Brian Sulcer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the / ,‹x,‹@/ GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA InstallScript := func(partFrame, removeFrame) begin local dataDefSym := EnsureInternal('calendar); GetRoot().(EnsureInternal(kAppAboutViewSym)) := BuildContext(partFrame.partData.aboutView); RegisterViewDef( { _proto: partFrame.partDa ,‹x,‹@ta.protoMonthPrintFmt, symbol: kPortraitSymbol, title: "Month View (portrait)", orientation: 'portrait, }, dataDefSym ); RegisterViewDef( { _proto: partFrame.partData.protoMonthPrintFmt, symbol: kLandscapeSymbol, title: "Month View (landscape)", orientation: 'landscape, }, dataDefSym ); end; RemoveScript := func(removeFrame) begin UnRegisterViewDef(kPortraitSymbol, 'calendar); UnRegisterViewDef(kLandscapeSymbol, 'calendar); RemoveSlot(GetRoot(), 'kAppAboutViewSym ,‹x,‹@); end MonthPrintFmt, symbol: kPortraitSymbol, title: "Month View (portrait)", orientation: 'portrait, }, dataDefSym ); RegisterViewDef( { _proto: partFrame.partData.protoMonthPrintFmt, symbol: kLandscapeSymbol, title: "Month View (landscape)", orientation: 'landscape, }, dataDefSym ); end; RemoveScript := func(removeFrame) begin UnRegisterViewDef(kPortraitSymbol, 'calendar); UnRegisterViewDef(kLandscapeSymbol, 'calendar); RemoveSlot(GetRoot(), 'kAppAboutViewSym // End of text file install and remove.f