// Text of project TipCalc written on 12/11/99 at 23:59 // 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 kDefaultPrefs := '{ forceTwoPlaces: nil, calcBeforeTax: nil, rememberTipPercent: nil, lastTipPercent: nil, }; OpenResFile(HOME & "Bitmaps.rsrc"); DefConst('kAppIcon, GetPictAsBits("TipCalc Icon", nil)); CloseResFile(); con ,‹x,‹@stant kVersionString := "v2.1"; constant kMyPackageName := "Tip Calc"; constant kAboutString := "v2.1 ©1999 Brian Sulcer\n\n" & "Adds a Restaurant Bill panel to the Formulas roll.\n\n" & "email: bsulcer@hyprmynd.com\n" & "url: http://www.hyprmynd.com/"; SetPartFrameSlot('text, "TipCalc"); SetPartFrameSlot('app, kAppSymbol); SetPartFrameSlot('icon, kAppIcon); SetPartFrameSlot('TapAction, func() begin GetRoot():Notify(kNotifyQAlert, kMyPackageName, kAboutString); return nil; end; ); e(); con // 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 protoFormulasInputLine // Before Script for protoFormulasInputLine // 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 protoFormulasInputLine := {viewFlags: 1, viewBounds: {left: 0, top: 0, right: 0, bottom: 35}, viewJustify: 8372, label: "Label", value: nil, UpdateValue: func() begin local newValue, newText; if (entryLine.text = nil) or (StrLen(entryLine.text) = 0) then begin newValue := nil; newText := nil; end; else if not IsNumber(StringToNumber(entryLine.text)) then begin :Notify(kNotifyAlert, "Formulas", "Only numbers are allowed in this field"); newValue := nil; newText := nil; end; else begin newValue := StringToNumber(entryLine.text); newText := :formatValue(newValue); end; // set update flag updateFlag := true; // assign new text SetValue(self.entryLine, 'text, newText); // reset update flag updateFlag := nil; // set new value value := newValue; end , updateText: func(newText) begin SetValue(self.entryLine, 'text, newText); end, textChanged: func() begin if not updateFlag then begin :updateValue(); if not recalcFlag then :Parent():recalcAll(self); end; end , viewSetupFormScript: func() begin inherited:?viewSetupFormScript(); entryLine.textFlags := vNoSpaces; end , updateFlag: nil, formatValue: func(value) begin return NumberStr(value); end, viewClass: 77 /* clEditView */ }; labelLine := {text: "", viewBounds: {left: 5, top: 0, right: -100, bottom: -5}, viewJustify: 248, viewSetupFormScript: func() begin inherited:?viewSetupFormScript(); self.text := :Parent().label; end , viewFont: ROM_fontSystem10Bold, _proto: @218 /* protoStaticText */ }; AddStepForm(protoFormulasInputLine, labelLine); StepDeclare(protoFormulasInputLine, labelLine, 'labelLine); entryLine := {viewBounds: {left: -100, top: 0, right: 0, bottom: 0}, viewJustify: 8388836, viewChangedScript: func(slot, view) begin :Parent():textChanged(); end, viewFlags: 10753, viewLineSpacing: 30, _proto: @185 /* protoInputLine */ }; AddStepForm(protoFormulasInputLine, entryLine); StepDeclare(protoFormulasInputLine, entryLine, 'entryLine); constant |layout_protoFormulasInputLine| := protoFormulasInputLine; // End of file protoFormulasInputLine // Beginning of file protoFormulasPickerInputLine // Before Script for protoFormulasPickerInputLine // 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 protoFormulasPickerInputLine := {viewBounds: {left: 0, top: 0, right: 0, bottom: 35}, viewJustify: 8244, value: nil, UpdateValue: func() begin local newValue, newText; if (text = nil) or (StrLen(text) = 0) then begin newValue := nil; newText := nil; end; else if not IsNumber(StringToNumber(text)) then begin :Notify(kNotifyAlert, "Formulas", "Only numbers are allowed in this field"); newValue := nil; newText := nil; end; else begin newValue := StringToNumber(text); newText := :formatValue(newValue); end; // set update flag :Parent().updateFlag := true; // assign new text SetValue(self, 'text, newText); // reset update flag :Parent().updateFlag := nil; // set new value :Parent().value := newValue; end , label: "Label", textChanged: func() begin if not updateFlag then begin :updateValue(); if not recalcFlag then :recalcAll(self); end; end , updateText: func(newText) begin SetValue(self.entryLine, 'text, newText); end, labelFont: ROM_fontSystem10Bold, labelCommands: ["picker option one", "picker option two"], curLabelCommand: 0, viewSetupFormScript: func() begin inherited:?viewSetupFormScript(); self.indent := :LocalBox().right - 100; entryLine.textFlags := vNoSpaces; end , labelActionScript: func(cmdIndex) begin :Parent():updateText(:Parent().labelCommands[cmdIndex]); return true; // return true if selection completely handled, nil otherwise end , entryFlags: 10753, updateFlag: nil, formatValue: func(value) begin return NumberStr(value); end, viewLineSpacing: 30, _proto: @189 /* protoLabelInputLine */ }; constant |layout_protoFormulasPickerInputLine| := protoFormulasPickerInputLine; // End of file protoFormulasPickerInputLine // Beginning of file protoFormulasStaticLine // Before Script for protoFormulasStaticLine // 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 protoFormulasStaticLine := {viewFlags: 1, viewBounds: {left: 0, top: 0, right: 0, bottom: 35}, label: "Label", value: nil, UpdateValue: func() begin if (entryLine.text = nil) then self.value := nil; else self.value := StringToNumber(entryLine.text); end , updateText: func(newText) begin SetValue(self.entryLine, 'text, newText); :updateValue(); end , viewJustify: 8372, viewClass: 77 /* clEditView */ }; labelLine := {text: "", viewBounds: {left: 5, top: 0, right: 110, bottom: -5}, viewJustify: 200, viewSetupFormScript: func() begin inherited:?viewSetupFormScript(); self.text := :Parent().label; end , viewFont: ROM_fontSystem10Bold, _proto: @218 /* protoStaticText */ }; AddStepForm(protoFormulasStaticLine, labelLine); StepDeclare(protoFormulasStaticLine, labelLine, 'labelLine); entryLine := {text: "", viewBounds: {left: -100, top: 0, right: 0, bottom: -5}, viewJustify: 8388840, viewFont: editFont12, _proto: @218 /* protoStaticText */ }; AddStepForm(protoFormulasStaticLine, entryLine); StepDeclare(protoFormulasStaticLine, entryLine, 'entryLine); constant |layout_protoFormulasStaticLine| := protoFormulasStaticLine; // End of file protoFormulasStaticLine // Beginning of file protoFormulasPanel // Before Script for protoFormulasPanel // 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 protoFormulasPanel := {viewBounds: {left: 0, top: 0, right: 200, bottom: 250}, title: "Formulas Panel", overview: "Formulas Panel", recalcAll: func(changedView) begin end, clearAll: func() begin end, recalcFlag: nil, _proto: @180 /* protoFloatNGo */ }; InfoButton := {viewFlags: 515, viewBounds: {left: 3, top: -16, right: 16, bottom: -3}, viewJustify: 134, DoInfoAbout: func() begin AboutBox:Open(); end, DoInfoPrefs: func() begin PrefsBox:Open(); end, _proto: @478 /* protoInfoButton */ }; AddStepForm(protoFormulasPanel, InfoButton); StepDeclare(protoFormulasPanel, InfoButton, 'InfoButton); ClearButton := {buttonClickScript: func() begin :clearAll(); end, text: "Clear", viewBounds: {left: 0, top: -16, right: 32, bottom: -3}, viewJustify: 8388758, _proto: @226 /* protoTextButton */ }; AddStepForm(protoFormulasPanel, ClearButton); protoFormulasPanel_v229_0 := {title: "Formulas Panel", viewBounds: {left: 0, top: 5, right: 200, bottom: 20}, viewSetupFormScript: func() begin self.title := Clone(title); self.title := :Parent().title; inherited:?viewSetupFormScript(); end , _proto: @229 /* protoTitle */ }; AddStepForm(protoFormulasPanel, protoFormulasPanel_v229_0); constant |layout_protoFormulasPanel| := protoFormulasPanel; // End of file protoFormulasPanel // 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.1", 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: "Tip Calc", appIcon: MakePixFamily( GetResourceFromFile({filename: "Shusaku:Brian's Stuff:Projects:tip-calc:bitmaps.rsrc", resource: 129}), GetResourceFromFile({filename: ":\u20130001\u,}@", resource: }), [ {rsrcSpec: GetResourceFromFile({filename: "Shusaku:Brian's Stuff:Projects:tip-calc:bitmaps.rsrc", resource: 129}), bitDepth: 1}, {rsrcSpec: GetResourceFromFile({filename: ":\u20130001\u,}@", resource: }) , bitDepth: 2}, {rsrcSpec: GetResourceFromFile({filename: ":\u20130001\u,}@", resource: }) , bitDepth: 4}, {rsrcSpec: GetResourceFromFile({filename: ":\u20130001\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 prefsBox.t // Before Script for prefsBox // 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 prefsBox := {viewBounds: {left: 0, top: 25, right: 185, bottom: 165}, viewJustify: 16, ourPrefsEntry: nil, viewSetupFormScript: func() begin self.ourPrefsEntry := GetAppPrefs(kAppSymbol, kDefaultPrefs); end , viewQuitScript: // must return the value of inherited:?viewQuitScript(); func() begin EntryChange(ourPrefsEntry); AddDeferredSend(:Parent().TaxAmount, 'Open, nil); AddDeferredSend(:Parent(), 'RedoChildren, nil); inherited:?viewQuitScript(); // this method is defined internally end , _proto: @180 /* protoFloatNGo */ }; prefsBox_v229_0 := {title: "Restaurant Bill Preferences", viewBounds: {left: 0, top: 10, right: 150, bottom: 30}, _proto: @229 /* protoTitle */ }; AddStepForm(prefsBox, prefsBox_v229_0); forceTwoPlaces := {text: "Force two decimal places", viewBounds: {left: 5, top: 5, right: -5, bottom: 25}, viewJustify: 8372, viewValue: nil, buttonValue: true, valueChanged: func() begin ourPrefsEntry.forceTwoPlaces := viewValue; end, viewSetupFormScript: func() begin self.viewValue := ourPrefsEntry.forceTwoPlaces; end, _proto: @164 /* protoCheckBox */ }; AddStepForm(prefsBox, forceTwoPlaces); calcBeforeTax := {text: "Calculate tip based on\ntotal before tax", viewBounds: {left: 5, top: 5, right: -5, bottom: 30}, viewJustify: 8244, buttonValue: true, viewValue: nil, valueChanged: func() begin ourPrefsEntry.calcBeforeTax := viewValue; end, viewSetupFormScript: func() begin self.viewValue := ourPrefsEntry.calcBeforeTax; end, _proto: @164 /* protoCheckBox */ }; AddStepForm(prefsBox, calcBeforeTax); rememberTipPercent := {text: "Remember last entered tip percentage", viewBounds: {left: 5, top: 5, right: -5, bottom: 30}, viewJustify: 8244, buttonValue: true, viewValue: nil, viewSetupFormScript: func() begin self.viewValue := ourPrefsEntry.rememberTipPercent; end, valueChanged: func() begin ourPrefsEntry.rememberTipPercent := viewValue; end, _proto: @164 /* protoCheckBox */ }; AddStepForm(prefsBox, rememberTipPercent); constant |layout_prefsBox.t| := prefsBox; // End of file prefsBox.t // Beginning of file formulasPanel.t // Before Script for formulasPanel // 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 formulasPanel := { recalcAll: func(changedView) begin local ourPrefs; local newValue, newString; local formatStr; // set recalc flag self.recalcFlag := true; // get application preferences ourPrefs := GetAppPrefs(kAppSymbol, kDefaultPrefs); formatStr := "%.2f"; // recalculate TipAmount if needed if ((SubTotal.value <> nil) and (TipPercent.value <> nil)) then begin newValue := Round(SubTotal.value * (TipPercent.value / 100) * 100) / 100; if ourPrefs.forceTwoPlaces then newString := FormattedNumberStr(newValue, formatStr); else newString := NumberStr(newValue); TipAmount:updateText(newString); end; else TipAmount:updateText(nil); // recalculate GrandTotal if needed if ((SubTotal.value <> nil) and (TipAmount.value <> nil)) then begin newValue := SubTotal.value + TipAmount.value; if ourPrefs.calcBeforeTax and (TaxAmount.value <> nil) then newValue := newValue + TaxAmount.value; if ourPrefs.forceTwoPlaces then newString := FormattedNumberStr(newValue, formatStr); else newString := NumberStr(newValue); GrandTotal:updateText(newString); end; else GrandTotal:updateText(nil); // recalculate IndividualTotal if needed if ((GrandTotal.value <> nil) and (WaysToSplit.value <> nil)) then begin newValue := Round(GrandTotal.value / WaysToSplit.value * 100) / 100; if ourPrefs.forceTwoPlaces then newString := FormattedNumberStr(newValue, formatStr); else newString := NumberStr(newValue); IndividualTotal:updateText(newString); end; else IndividualTotal:updateText(nil); // reset the recalc flag self.recalcFlag := nil; end , clearAll: func() begin // set recalc flag so no recalculation will take place until we are done clearing recalcFlag := true; // clear SubTotal SubTotal:updateText(nil); if TaxAmount.viewCObject then TaxAmount:updateText(nil); TipPercent:updateText(nil); WaysToSplit:updateText(nil); // reset recalc flag since we are done recalcFlag := nil; end , title: "Restaurant Bill", overview: "Restaurant Bill", recalcFlag: nil, viewBounds: {left: 0, top: 0, right: 200, bottom: 260}, viewSetupDoneScript: func() begin if GetRoot().FinanceApp exists then FinancePostButton:Open(); if prefsEntry.rememberTipPercent then TipPercent:UpdateText(NumberStr(prefsEntry.lastTipPercent)); end , viewSetupFormScript: func() begin self.prefsEntry := GetAppPrefs(kAppSymbol, kDefaultPrefs); end , prefsEntry: nil, viewQuitScript: func() begin if prefsEntry.rememberTipPercent then prefsEntry.lastTipPercent := TipPercent.value; else prefsEntry.lastTipPercent:= nil; EntryChange(prefsEntry); inherited:?viewQuitScript(); end , _proto: protoFormulasPanel }; SubTotal := {label: "Total Bill", formatValue: func(value) begin local newText; // format text according to preferences if GetAppPrefs(kAppSymbol, kDefaultPrefs).forceTwoPlaces then newText := FormattedNumberStr(value, "%.2f"); else newText := NumberStr(value); return newText; end , viewBounds: {left: 0, top: 0, right: 0, bottom: 31}, viewSetupFormScript: func() begin inherited:?viewSetupFormScript(); entryLine.textFlags := vNoSpaces; if prefsEntry.calcBeforeTax then self.label := "Sub Total"; else self.label := "Total Bill"; end , _proto: protoFormulasInputLine }; AddStepForm(formulasPanel, SubTotal); StepDeclare(formulasPanel, SubTotal, 'SubTotal); TaxAmount := {label: "Tax", formatValue: func(value) begin local newText; // format text according to preferences if GetAppPrefs(kAppSymbol, kDefaultPrefs).forceTwoPlaces then newText := FormattedNumberStr(value, "%.2f"); else newText := NumberStr(value); return newText; end , viewBounds: {left: 0, top: 0, right: 0, bottom: 31}, viewFlags: 1, viewSetupDoneScript: func() begin if not prefsEntry.calcBeforeTax then :Close(); end, _proto: protoFormulasInputLine }; AddStepForm(formulasPanel, TaxAmount); StepDeclare(formulasPanel, TaxAmount, 'TaxAmount); TipPercent := {label: "Tip Percentage", labelCommands: ["0", "5", "10", "15", "20"], viewBounds: {left: 0, top: 0, right: 0, bottom: 31}, _proto: protoFormulasPickerInputLine }; AddStepForm(formulasPanel, TipPercent); StepDeclare(formulasPanel, TipPercent, 'TipPercent); WaysToSplit := {label: "Ways to Split", labelCommands: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], viewBounds: {left: 0, top: 0, right: 0, bottom: 31}, _proto: protoFormulasPickerInputLine }; AddStepForm(formulasPanel, WaysToSplit); StepDeclare(formulasPanel, WaysToSplit, 'WaysToSplit); TipAmount := {label: "Tip Amount", viewBounds: {left: 0, top: 0, right: 0, bottom: 31}, _proto: protoFormulasStaticLine }; AddStepForm(formulasPanel, TipAmount); StepDeclare(formulasPanel, TipAmount, 'TipAmount); GrandTotal := {label: "Total with Tip", viewBounds: {left: 0, top: 0, right: 0, bottom: 31}, _proto: protoFormulasStaticLine }; AddStepForm(formulasPanel, GrandTotal); StepDeclare(formulasPanel, GrandTotal, 'GrandTotal); IndividualTotal := {label: "Total Per Person", viewBounds: {left: 0, top: 0, right: 0, bottom: 31}, _proto: protoFormulasStaticLine }; AddStepForm(formulasPanel, IndividualTotal); StepDeclare(formulasPanel, IndividualTotal, 'IndividualTotal); FinancePostButton := { buttonClickScript: func() begin if ((IndividualTotal.value <> nil) or (GrandTotal.value <> nil)) then begin local postFrame := { Date: Time(), amount: if (IndividualTotal.value <> nil) then (0 - IndividualTotal.value) else (0 - GrandTotal.value), }; local financeApp := GetRoot().FinanceApp; financeApp:OpenFinanceSlip(postFrame); end; end; , text: "$", viewBounds: {left: 23, top: -16, right: 36, bottom: -3}, viewJustify: 8388742, viewFont: ROM_fontSystem9Bold, viewFlags: 514, _proto: @226 /* protoTextButton */ }; AddStepForm(formulasPanel, FinancePostButton); StepDeclare(formulasPanel, FinancePostButton, 'FinancePostButton); AboutBox := LinkedSubview(aboutBox, {viewBounds: {left: 4, top: 48, right: 188, bottom: 80}}); AddStepForm(formulasPanel, AboutBox); StepDeclare(formulasPanel, AboutBox, 'AboutBox); PrefsBox := LinkedSubview(prefsBox, {viewBounds: {left: 4, top: 80, right: 188, bottom: 112}}); AddStepForm(formulasPanel, PrefsBox); StepDeclare(formulasPanel, PrefsBox, 'PrefsBox); constant |layout_formulasPanel.t| := formulasPanel; // End of file formulasPanel.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 := { formulasItem: GetLayout("formulasPanel.t"), }; s 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 / // End of text file partData.f // Beginning of text file install & 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 RegFormulas(kAppSymbol, partFrame.partData.formulasItem); end; RemoveScript := func(removeFrame) begin UnRegFormulas(kAppSymbol); end BILITY or FITNESS FOR A PARTICULAR PURPOSE. See the / // End of text file install & remove.f