// Text of project ExtraExtras written on 8/28/56 at 02:27 // Beginning of file protoLabelStaticLine // Before Script for protoLabelStaticText // 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 protoLabelStaticText := {viewBounds: {left: 0, top: 0, right: 0, bottom: 15}, viewFlags: 1, viewFormat: 0, viewJustify: 8240, label: nil, text: nil, updateText: func(newText) begin SetValue(self.entryLine, 'text, newText); end, viewClass: 74 /* clView */ }; labelLine := {text: "Label", viewBounds: {left: 0, top: 0, right: 55, bottom: 0}, viewJustify: 8388801, viewSetupFormScript: func() begin self.text := :Parent().label; end, viewFont: ROM_fontSystem9Bold, _proto: @218 /* protoStaticText */ }; AddStepForm(protoLabelStaticText, labelLine); StepDeclare(protoLabelStaticText, labelLine, 'labelLine); entryLine := {text: "", viewBounds: {left: 60, top: 0, right: -5, bottom: 0}, viewJustify: 240, viewSetupFormScript: func() begin self.text := :Parent().text; end, viewFont: ROM_fontSystem9, _proto: @218 /* protoStaticText */ }; AddStepForm(protoLabelStaticText, entryLine); StepDeclare(protoLabelStaticText, entryLine, 'entryLine); constant |layout_protoLabelStaticLine| := protoLabelStaticText; // End of file protoLabelStaticLine // Beginning of file packageInfoView.t // Before Script for packageInfoView // 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 packageInfoView := {viewBounds: {left: 0, top: 0, right: 225, bottom: 220}, viewFlags: 64, viewEffect: 0, viewJustify: 80, packageInfo: nil, viewSetupFormScript: func() begin local cursor := GetGlobalVar('extrasTarget); self.packageInfo := GetPkgRefInfo(cursor:Entry().package); end , viewQuitScript: // must return the value of inherited:?viewQuitScript(); func() begin self.packageInfo := nil; UnDefGlobalVar('extrasTarget); inherited:?viewQuitScript(); // this method is defined internally end , _proto: @180 /* protoFloatNGo */ }; icon := {icon: nil, viewBounds: {left: 5, top: 5, right: 55, bottom: 55}, viewFlags: 1, viewFormat: nil, viewSetupFormScript: func() begin local theIcon := packageInfo.parts[0].icon; if theIcon then begin self.icon := theIcon; end; else begin self.icon := defaultIcon; end; end , defaultIcon: GetPictAsBits("default icon", nil), viewClass: 76 /* clPictureView */ }; AddStepForm(packageInfoView, icon); title := {viewBounds: {left: 60, top: 10, right: -5, bottom: 25}, viewJustify: 16432, text: "", viewSetupFormScript: func() begin self.text := packageInfo.title; end, viewFont: tsSize(10) + tsBold, _proto: @218 /* protoStaticText */ }; AddStepForm(packageInfoView, title); id := {viewBounds: {left: 60, top: 0, right: -5, bottom: 15}, viewJustify: 8240, text: "", viewSetupFormScript: func() begin self.text := "ID: " & NumberStr(packageInfo.id); end, viewFont: tsSize(9), _proto: @218 /* protoStaticText */ }; AddStepForm(packageInfoView, id); size := {label: "Size", viewSetupDoneScript: func() begin :updateText( NumberStr(packageInfo.size) & " bytes (" & NumberStr(packageInfo.cmprsdSz) & " compressed)"); end , viewBounds: {left: 0, top: 60, right: 0, bottom: 90}, viewJustify: 48, _proto: protoLabelStaticText }; AddStepForm(packageInfoView, size); store := {label: "Where", viewSetupDoneScript: func() begin :updateText(packageInfo.store:GetName()); end, viewBounds: {left: 0, top: 0, right: 0, bottom: 15}, viewJustify: 8240, _proto: protoLabelStaticText }; AddStepForm(packageInfoView, store); creationDate := {label: "Created", viewSetupDoneScript: func() begin :updateText(DateNTime(packageInfo.creationDate)); end, viewBounds: {left: 0, top: 5, right: 0, bottom: 20}, viewJustify: 8240, _proto: protoLabelStaticText }; AddStepForm(packageInfoView, creationDate); timestamp := {label: "Modfied", viewSetupDoneScript: func() begin :updateText(DateNTime(packageInfo.timestamp)); end, viewBounds: {left: 0, top: 0, right: 0, bottom: 15}, viewJustify: 8240, _proto: protoLabelStaticText }; AddStepForm(packageInfoView, timestamp); version := {label: "Version", viewSetupDoneScript: func() begin :updateText(NumberStr(packageInfo.version)); end, viewBounds: {left: 0, top: 0, right: 0, bottom: 15}, viewJustify: 8240, _proto: protoLabelStaticText }; AddStepForm(packageInfoView, version); copyright := {label: "Copyright", viewSetupDoneScript: func() begin :updateText(packageInfo.copyright); end, viewBounds: {left: 0, top: 5, right: 0, bottom: 55}, viewJustify: 8240, _proto: protoLabelStaticText }; AddStepForm(packageInfoView, copyright); constant |layout_packageInfoView.t| := packageInfoView; // End of file packageInfoView.t // 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 OpenResFile(home & "bitmaps.rsrc"); DefConst('kSmallSnowflakeIcon, GetPictAsBits("small snowflake icon", nil)); DefConst('kSnowflakeIcon, GetPictAsBits("snowflake icon", nil)); DefConst('kDropletIcon, GetPictAsBits("droplet icon", nil)); DefCon ,‹x,‹@st('kInfoIcon, GetPictAsBits("info icon", nil)); DefConst('kDrawerIcon, GetPictAsBits("drawer icon", nil)); CloseResFile(); partFrame := { GetRouteScripts: func(targetInfo) begin local origScripts := GetRoot().extrasDrawer.routeScripts; local newScripts := Clone(GetRoot().extrasDrawer.(kAppSymbol).myRouteScripts); local routeScripts := []; for i := 0 to (Length(origScripts) - 1) do begin if not StrEqual(origScripts[i].title, "Freeze") then begin AddArraySlot(routeScripts, ori ,‹x,‹@gScripts[i]); end; end; ArrayInsert(routeScripts, newScripts[0], 1); ArrayInsert(routeScripts, newScripts[1], 2); ArrayInsert(routeScripts, newScripts[2], 3); return routeScripts; end, packageInfoView: GetLayout("packageInfoView.t"), }; s := Clone(GetRoot().extrasDrawer.(kAppSymbol).myRouteScripts); local routeScripts := []; for i := 0 to (Length(origScripts) - 1) do begin if not StrEqual(origScripts[i].title, "Freeze") then begin AddArraySlot(routeScripts, ori // End of text file definitions.f // Beginning of text file functions.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 // // kMyFreezePackageFunc // DefConst('kMyFreezePackageFunc, func(statusView) begin local cursor := GetGlobalVar('extrasTarget); local entry := cursor:Entry(); local options; local packageInfo; while entry do begin packageInfo := Ge ,‹x,‹@tPkgRefInfo(entry.package); options := { barber: true, titleText: "Freezing \"" & packageInfo.title & "\"", }; statusView:SetStatus('vBarber, options); SafeFreezePackage(entry.package); entry := cursor:Next(); end; UnDefGlobalVar('extrasTarget); end; ); // // kMyThawPackageFunc // DefConst('kMyThawPackageFunc, func(statusView) begin local cursor := GetGlobalVar('extrasTarget); local entry := cursor:Entry(); local options; local packageInfo; while entry do begin ,‹x,‹@ packageInfo := GetPkgRefInfo(entry.package); options := { barber: true, titleText: "Thawing \"" &packageInfo.title & "\"", }; statusView:SetStatus('vBarber, options); ThawPackage(entry.package); entry := cursor:Next(); end; UnDefGlobalVar('extrasTarget); end; ); ThawPackageFunc // DefConst('kMyThawPackageFunc, func(statusView) begin local cursor := GetGlobalVar('extrasTarget); local entry := cursor:Entry(); local options; local packageInfo; while entry do begin // End of text file functions.f // Beginning of text file routeScripts.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 partFrame.myRouteScripts := [ // Get Info route script { GetTitle: func(target) begin if target and not TargetIsCursor(target) then "Get Info" else nil end, icon: kInfoIcon, routeScript: func(target, targetView) begi ,‹x,‹@n DefGlobalVar('extrasTarget, GetTargetCursor(target, nil)); GetRoot().extrasDrawer.(kAppSymbol).packageInfoView:Open(); return true; end, }, // Freeze route script { GetTitle: func(target) begin if target then "Freeze" else nil end, icon: kSnowflakeIcon, routeScript: func(target, targetView) begin local options := { primary: nil, closebox: nil, barber: true, statusText: "Freezing selected icons.", titleText: "", icon: kDrawerIco ,‹x,‹@n, }; DefGlobalVar('extrasTarget, GetTargetCursor(target, nil)); DoProgress('vBarber, options, kMyFreezePackageFunc); return true; end, }, // Thaw route script { GetTitle: func(target) begin if target then "Thaw" else nil end, icon: kDropletIcon, routeScript: func(target, targetView) begin local options := { primary: nil, closebox: nil, barber: true, statusText: "Thawing selected icons.", titleText: "", icon: kDrawerIcon, } ,‹x,‹@; Print(self); DefGlobalVar('extrasTarget, GetTargetCursor(target, nil)); DoProgress('vBarber, options, kMyThawPackageFunc); return true; end, }, ]; route script { GetTitle: func(target) begin if target then "Thaw" else nil end, icon: kDropletIcon, routeScript: func(target, targetView) begin local options := { primary: nil, closebox: nil, barber: true, statusText: "Thawing selected icons.", titleText: "", icon: kDrawerIcon, } // End of text file routeScripts.f // Beginning of text file extrasIcon.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 OpenResFile(HOME & "bitmaps.rsrc"); DefConst('kAppIcon, GetPictAsBits("extras drawer icon", nil)); CloseResFile(); DefConst('kMyPackageName, "Extra Extras"); DefConst('kAboutString, "v1.3 ©1999 Brian Sulcer\n\n" & "Adds extra functionality to ,‹x,‹@ the Extras Drawer.\n\n" & "email: bsulcer@hyprmynd.com\n" & "url: http://www.hyprmynd.com/" ); SetPartFrameSlot('text, kMyPackageName); SetPartFrameSlot('app, kAppSymbol); SetPartFrameSlot('icon, kAppIcon); SetPartFrameSlot('TapAction, func() begin GetRoot():Notify(kNotifyQAlert, kMyPackageName, kAboutString); return nil; end; ); wer icon", nil)); CloseResFile(); DefConst('kMyPackageName, "Extra Extras"); DefConst('kAboutString, "v1.3 ©1999 Brian Sulcer\n\n" & "Adds extra functionality to // End of text file extrasIcon.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 local extras := GetRoot().extrasDrawer; extras.(kAppSymbol) := { myRouteScripts: EnsureInternal(partFrame.myRouteScripts), packageInfoView: BuildContext(partFrame.packageInfoView), }; ,‹x,‹@extras.GetRouteScripts := EnsureInternal(partFrame.GetRouteScripts); end; RemoveScript := func(removeFrame) begin local extras := GetRoot().extrasDrawer; RemoveSlot(extras, kAppSymbol); RemoveSlot(extras, 'GetRouteScripts); end ton, MA 02111-1307 // USA InstallScript := func(partFrame, removeFrame) begin local extras := GetRoot().extrasDrawer; extras.(kAppSymbol) := { myRouteScripts: EnsureInternal(partFrame.myRouteScripts), packageInfoView: BuildContext(partFrame.packageInfoView), }; // End of text file install & remove.f