// Text of project Keys written on 5/13/95 at 11:04 PM // Beginning of text file Project Data // Copyright © 1993-94 Apple Computer, Inc. All rights reserved. // first open the resrouce file containing the picture // that I want. NOTE: you must use a full Macintosh // pathname for the file. the 'home' constant represents // your project file path. r := OpenResFileX(home&"pictures"); // now read in the picture and assign it to a variable // the second argument says not to generate a mask planet_Picture := GetPictAsBits("Planet", nil); TARDIS_Picture := GetPictAsBits("TARDIS", nil); // then close the resource file CloseResFileX(r); // End of text file Project Data // Beginning of file keyfun myBase := {title: "KeyFun", viewBounds: {top: 0, left: 0, right: 240, bottom: 336}, viewSetupFormScript: func() begin constant kMaxWidth := 240; constant kMaxHeight := 336; local b := GetAppParams(); viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop, Min(b.appAreaWidth, kMaxWidth), Min(b.appAreaHeight, kMaxHeight) ); end, debug: "myBase", _proto: @157 }; _view000 := {text: "Toggle Keyboard", buttonClickScript: func() begin // if the keyboard is not open, set the current // key view to the paragraph view (paraView). // the key view is where the strings or characters // associated with a keypress will be sent/shown if not Visible(myKeyboard) then SetKeyView(paraView, StrLen(paraView.text)); myKeyboard:Toggle(); end, viewBounds: {left: 63, top: 17, right: 165, bottom: 39}, _proto: @226 }; AddStepForm(myBase, _view000); myKeyboard := {viewBounds: {left: 3, top: 49, right: 215, bottom: 149}, debug: "myKeyboard", _proto: @187 }; AddStepForm(myBase, myKeyboard); StepDeclare(myBase, myKeyboard, 'myKeyboard); _view001 := { keyDefinitions: [[keyVUnit, keyVUnit, planet_Picture, "Gallifrey ", keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, TARDIS_Picture, "TARDIS! ", keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3], [keyVUnit, keyVUnit, ["One ", "TWO! "], ["One ", "TWO! "], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, $b, func() begin :toggleCharacter(); return $b; end; , keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3] ], viewBounds: {left: 4, top: 7, right: 204, bottom: 79}, keyArrayIndex: 0, toggleCharacter: func() begin if (self.keyArrayIndex = 0) then SetValue(self, 'keyArrayIndex, 1); else SetValue(self, 'keyArrayIndex, 0); end, viewFormat: 0, _proto: @188 }; AddStepForm(myKeyboard, _view001); // After Script for "_view001" thisView := _view001; //Set the saveBounds to the viewBounds since this is probably what you want thisView.saveBounds := Clone(thisView.viewBounds); _view002 := {_proto: @166}; AddStepForm(myKeyboard, _view002); // After Script for "myKeyboard" thisView := myKeyboard; //Set the saveBounds to the viewBounds since this is probably what you want thisView.saveBounds := Clone(thisView.viewBounds); paraView := {viewFlags: 1, viewFormat: 12625, viewLineSpacing: 20, viewFont: 18434, viewBounds: {left: 11, top: 160, right: 233, bottom: 283}, text: "", debug: "paraView", viewClass: 81 }; AddStepForm(myBase, paraView); StepDeclare(myBase, paraView, 'paraView); constant |layout_keyfun| := myBase; // End of file keyfun