// Text of project numberExpando written on 5/14/95 at 10:29 PM // Beginning of file myNumberExpandoItem _userproto000 := {path: nil, viewBounds: {left: 3, top: 11, right: 192, bottom: 64}, textChanged: func() begin // be nice and let text expando do what it needs to do inherited:textChanged(); // now set target slot to a number local num := StringToNumber(entryLine.text); // the text could be bogus, so num may be nil // set it to a default if not num then num := 0 ; // have to work around some funny behavior where // stringtonumber will always return float... // check if decimal point in the real number if not strPos(entryLine.text, ".", 0) then num := floor(num) ; target.(path) := num ; end, Setup2: func(target) begin // this function gets called to figure out what // text to show for the value in the collapsed // state // just return a string if target then NumberStr(target.(path)); end, entryFlags: 11777, _proto: @227 }; constant |layout_myNumberExpandoItem| := _userproto000; // End of file myNumberExpandoItem // Beginning of file expandoItemWithButton _userproto001 := {path: nil, viewBounds: {left: 8, top: 8, right: 192, bottom: 72}, _proto: @227 }; _view000 := {text: "Bing?", buttonClickScript: func() begin :SysBeep(); end, viewBounds: {top: 13, left: -36, right: 0, bottom: 29}, viewJustify: 8388646, _proto: @226 }; AddStepForm(_userproto001, _view000); constant |layout_expandoItemWithButton| := _userproto001; // End of file expandoItemWithButton // Beginning of file numberExpando.t myBase := {title: "Number Expando", viewBounds: {left: -1, top: 2, right: 233, bottom: 330}, debug: "myBase", _proto: @157 }; _view001 := { viewSetupFormScript: func() begin self.target := self; self.lines := [{_proto: GetLayout("myNumberExpandoItem"), label: "Number 1", path: 'number1}, {_proto: GetLayout("myNumberExpandoItem"), label: "Number 2", path: 'number2}, {_proto: GetLayout("expandoItemWithButton"), label: "Button Thing", path: 'deleteThis} ]; numLines := length(lines); //call this after setting up the lines array inherited:?viewSetupFormScript() end, FlushEdits: func() begin nil end, lines: nil, numLines: 2, editWidth: 150, editHeight: 50, deleteThis: "delete", viewBounds: {left: 14, top: 25, right: 224, bottom: 290}, number1: 0, number2: 0, _proto: @175 }; AddStepForm(myBase, _view001); constant |layout_numberExpando.t| := myBase; // End of file numberExpando.t