// ---- End Project Data ---- // ---- File Gauge.t ---- // Before Script for "baseView" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. baseView := {title: "Gauge test", viewBounds: {top: 0, left: 0, right: 240, bottom: 336}, viewSetupFormScript: func() begin // resize to fit on all "small" newtons. local b := GetAppParams(); constant kMaxWidth := 240; constant kMaxHeight := 336; self.viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop, MIN(b.appAreaWidth, kMaxWidth), MIN(b.appAreaHeight, kMaxHeight)); end, _proto: protoApp, debug: "baseView" }; // Before Script for "theLabel" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. theLabel := /* child of baseView */ {text: "Value from Gauge:", viewBounds: {left: 18, top: 130, right: 114, bottom: 162}, _proto: protoStaticText, debug: "theLabel" }; // View theLabel is declared to baseView // Before Script for "theDisplay" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. theDisplay := /* child of baseView */ {text: "50", viewBounds: {left: 122, top: 130, right: 184, bottom: 144}, viewFormat: 592, _proto: protoStaticText, debug: "theDisplay" }; // View theDisplay is declared to baseView // Before Script for "theSlider" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. theSlider := /* child of baseView */ {viewBounds: {left: 18, top: 90, right: 194, bottom: 106}, minvalue: 0, maxvalue: 100, viewValue: 50, changedSlider: func() begin // Show the new gauge values SetValue(theDisplay, 'text, NumberStr(viewValue)); Print("Maxvalue slot = " & maxValue); end, viewSetupFormScript: // required for protoGauge workaround. func() nil;, _proto: protoSlider, debug: "theSlider" }; // View theSlider is declared to baseView // Before Script for "MaxPicker" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. MaxPicker := /* child of baseView */ {label: "Max Value:", viewBounds: {left: 18, top: 186, right: 138, bottom: 210}, labelCommands: ["100", "75", "50", "25"], textChanged: func() begin // get the number information and reprogram the gauge again // beware of the dreadful empty string you get when you erase // the old string! if NOT StrEqual(text, "") then begin // close the gauge because we want to change min/max slots theSlider:Close(); SetValue(theSlider, 'maxValue, RintToL(StringToNumber(text))); // open the slider again theSlider:Open(); end end, entryFlags: 10753, text: "100", _proto: protoLabelInputLine, debug: "MaxPicker" }; // View MaxPicker is declared to baseView // Before Script for "infoLabel" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. infoLabel := /* child of baseView */ { text: "This sample shows how to make use of protoGauges, get values and also dynamically set the min and max boundaries." , viewBounds: {left: 26, top: 26, right: 218, bottom: 66}, viewJustify: 0, _proto: protoStaticText, debug: "infoLabel" }; // ---- Beginning of section for non used Layout files ---- // End of output