// Text of project TaxCalc written on 12/11/99 at 23:47 // 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 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 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 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, rememberLastRate: nil, lastRate: nil, }; OpenResFile(HOME & "bitmaps.rsrc"); DefConst('kAppIcon, GetPictAsBits("TaxCalc Icon", nil)); CloseResFile(); constant kVersionString := "v1.3" ,‹x,‹@; constant kMyPackageName := "TaxCalc"; constant kAboutString := kVersionString & "©1999 Brian Sulcer\n\n" & "Adds a Sales Tax panel to the Formulas roll.\n\n" & "email: bsulcer@hyprmynd.com\n" & "url: http://www.hyprmynd.com/"; SetPartFrameSlot('text, "TaxCalc"); SetPartFrameSlot('app, kAppSymbol); SetPartFrameSlot('icon, kAppIcon); SetPartFrameSlot('TapAction, func() begin GetRoot():Notify(kNotifyQAlert, kMyPackageName, kAboutString); return nil; end; ); stant kVersionString := "v1.3" // End of text file definitions.f // 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 1.3", 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: "Tax Calc", appIcon: MakePixFamily( GetResourceFromFile({filename: "Shusaku:Brian's Stuff:Projects:taxcalc:bitmaps.rsrc", resource: 129}), GetResourceFromFile({filename: ":\u201C0001\u,}@", resource: }), [ {rsrcSpec: GetResourceFromFile({filename: "Shusaku:Brian's Stuff:Projects:taxcalc:bitmaps.rsrc", resource: 129}), bitDepth: 1}, {rsrcSpec: GetResourceFromFile({filename: ":\u201C0001\u,}@", resource: }) , bitDepth: 2}, {rsrcSpec: GetResourceFromFile({filename: ":\u201C0001\u,}@", resource: }) , bitDepth: 4}, {rsrcSpec: GetResourceFromFile({filename: ":\u201C0001\u,}@", resource: }) , bitDepth: 8}]);, viewBounds: {left: 0, top: 0, right: 200, 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: 180, bottom: 125}, ourPrefsEntry: nil, viewSetupDoneScript: func() begin self.ourPrefsEntry := GetAppPrefs(kAppSymbol, kDefaultPrefs); if (ourPrefsEntry.forceTwoPlaces <> ForceTwoPlaces.viewValue) then ForceTwoPlaces:ToggleCheck(); if (ourPrefsEntry.rememberLastRate <> RememberLastRate.viewValue) then RememberLastRate:ToggleCheck(); end , viewFlags: 576, viewJustify: 16, viewQuitScript: // must return the value of inherited:?viewQuitScript(); func() begin ourPrefsEntry.forceTwoPlaces := ForceTwoPlaces.viewValue; ourPrefsEntry.rememberLastRate := RememberLastRate.viewValue; EntryChange(ourPrefsEntry); inherited:?viewQuitScript(); // this method is defined internally end , _proto: @180 /* protoFloatNGo */ }; PrefsBox_v229_0 := {title: "Sales Tax Preferences", viewBounds: {left: 0, top: 5, right: 150, bottom: 25}, viewJustify: 22, _proto: @229 /* protoTitle */ }; AddStepForm(PrefsBox, PrefsBox_v229_0); ForceTwoPlaces := {text: "Force two decimal places", viewBounds: {left: 5, top: 5, right: 155, bottom: 25}, buttonValue: true, viewValue: nil, viewJustify: 8324, _proto: @164 /* protoCheckBox */ }; AddStepForm(PrefsBox, ForceTwoPlaces); StepDeclare(PrefsBox, ForceTwoPlaces, 'ForceTwoPlaces); RememberLastRate := {text: "Remember last sales tax rate", viewBounds: {left: 5, top: 5, right: 155, bottom: 25}, buttonValue: true, viewValue: nil, viewJustify: 8324, _proto: @164 /* protoCheckBox */ }; AddStepForm(PrefsBox, RememberLastRate); StepDeclare(PrefsBox, RememberLastRate, 'RememberLastRate); 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 := {viewBounds: {left: 0, top: 0, right: 200, bottom: 200}, clearAll: func() begin // set recalc flag so no recalculation will take place until we are done clearing recalcFlag := true; // clear SubTotal SubTotal:updateText(nil); // clear TaxRate only if clear is tapped twice if clearFlag then begin clearFlag := nil; TaxRate:updateText(nil); end; else clearFlag := true; // clear TaxAmount and GrandTotal TaxAmount:updateText(nil); GrandTotal:updateText(nil); // reset recalc flag since we are done recalcFlag := nil; end , overview: "Sales Tax", recalcAll: func(changedView) begin local newValue; // set clear flag clearFlag := nil; // set recalc flag recalcFlag := true; // check for need for invalid input local count := 0; foreach field in [SubTotal, TaxRate, TaxAmount, GrandTotal] do begin if field.value = nil then count := count + 1; end; if (count < 2) and (changedView.value <> nil) then begin :Notify(kNotifyAlert, "Formulas", "You cannot change the field that was being solved." & "Tap clear then enter the new values."); recalcFlag := nil; return nil; end; // recalculate SubTotal if needed if (SubTotal.value = nil) and (changedView <> SubTotal) then begin if (TaxRate.value <> nil) and (TaxAmount.value <> nil) then newValue := Round(TaxAmount.value / (TaxRate.value / 100) * 100) / 100; else if (TaxRate.value <> nil) and (GrandTotal.value <> nil) then newValue := Round(GrandTotal.value / ( 1 + (TaxRate.value / 100)) * 100) / 100; else if (TaxAmount.value <> nil) and (GrandTotal.value <> nil) then newValue := GrandTotal.value - TaxAmount.value; else newValue := nil; SubTotal:updateText(NumberStr(newValue)); end; // recalculate TaxAmount if needed if (TaxAmount.value = nil) and (changedView <> TaxAmount) then begin if (SubTotal.value <> nil) then if (TaxRate.value <> nil) then newValue := Round(SubTotal.value * (TaxRate.value / 100) * 100) / 100; else if (GrandTotal.value <> nil) then newValue := GrandTotal.value - SubTotal.value; else newValue := nil; else newValue := nil; TaxAmount:updateText(NumberStr(newValue)); end; // recalculate TaxRate if needed if (TaxRate.value = nil) and (changedView <> TaxRate) then begin if (TaxAmount.value <> nil) and (SubTotal.value <> nil) then newValue := Round(TaxAmount.value / SubTotal.value * 100) / 100; else newValue := nil; TaxRate:updateText(NumberStr(newValue)); end; // recalculate GrandTotal if needed if (GrandTotal.value = nil) and (changedView <> GrandTotal) then begin if (TaxAmount.value <> nil) and (SubTotal.value <> nil) then newValue := TaxAmount.value + SubTotal.value; else newValue := nil; GrandTotal:updateText(NumberStr(newValue)); end; // reset recalcFlag self.recalcFlag := nil; end , recalcFlag: nil, title: "Sales Tax", clearFlag: nil, viewQuitScript: func() begin local ourPrefsEntry := GetAppPrefs(kAppSymbol, kDefaultPrefs); if ourPrefsEntry.rememberLastRate then ourPrefsEntry.lastRate := TaxRate.value; else ourPrefsEntry.lastRate := nil; EntryChange(ourPrefsEntry); inherited:?viewQuitScript(); // this method is defined internally end , viewSetupDoneScript: func() begin local ourPrefsEntry := GetAppPrefs(kAppSymbol, kDefaultPrefs); TaxRate:updateText(NumberStr(ourPrefsEntry.lastRate)); end , _proto: protoFormulasPanel }; SubTotal := {label: "Total Sale", 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 , _proto: protoFormulasInputLine }; AddStepForm(formulasPanel, SubTotal); StepDeclare(formulasPanel, SubTotal, 'SubTotal); TaxRate := {label: "Sales Tax Rate (%)", 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 , _proto: protoFormulasInputLine }; AddStepForm(formulasPanel, TaxRate); StepDeclare(formulasPanel, TaxRate, 'TaxRate); TaxAmount := {label: "Tax Amount", 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 , _proto: protoFormulasInputLine }; AddStepForm(formulasPanel, TaxAmount); StepDeclare(formulasPanel, TaxAmount, 'TaxAmount); GrandTotal := {label: "Total with 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 , _proto: protoFormulasInputLine }; AddStepForm(formulasPanel, GrandTotal); StepDeclare(formulasPanel, GrandTotal, 'GrandTotal); AboutBox := LinkedSubview(aboutBox, {viewBounds: {left: 12, top: 32, right: 188, bottom: 72}}); AddStepForm(formulasPanel, AboutBox); StepDeclare(formulasPanel, AboutBox, 'AboutBox); PrefsBox := LinkedSubview(PrefsBox, {viewBounds: {left: 12, top: 96, right: 188, bottom: 136}}); 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"), }; 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