// Copyright © 1993-94 Apple Computer, Inc. All rights reserved. constant kAppSymbol := '|Keys:PIEDTS|; // 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 Project Data ---- // ---- 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, _proto: protoApp, debug: "myBase" }; _view000 := /* child of myBase */ {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: protoTextButton }; myKeyboard := /* child of myBase */ {viewBounds: {left: 3, top: 49, right: 215, bottom: 149}, _proto: protoKeyboard, debug: "myKeyboard" }; // View myKeyboard is declared to myBase _view001 := /* child of myKeyboard */ { 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: protoKeypad }; // 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 := /* child of myKeyboard */ {_proto: protoClosebox}; // 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 := /* child of myBase */ {viewFlags: 1, viewFormat: 12625, viewlinespacing: 20, viewFont: 18434, viewBounds: {left: 11, top: 160, right: 233, bottom: 283}, text: "", viewclass: 81, debug: "paraView" }; // View paraView is declared to myBase // ---- Beginning of section for non used Layout files ---- // End of output