// ---- End Project Data ---- // ---- File main.t ---- myBase := {title: "Number Expando", viewBounds: {left: -1, top: 2, right: 233, bottom: 330}, _proto: protoApp, debug: "myBase" }; _view000 := /* child of myBase */ { viewSetupFormScript: func() begin self.target := self; self.lines := [{_proto: pt_myNumberExpandoItem, label: "Number 1", path: 'number1}, {_proto: pt_myNumberExpandoItem, label: "Number 2", path: 'number2}, {_proto: pt_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: protoExpandoShell }; // ---- Beginning of non-used User Protos ---- // ---- File expandoItemWithButton ---- _userproto000 := {path: nil, viewBounds: {left: 8, top: 8, right: 192, bottom: 72}, _proto: protoTextExpando }; _view001 := /* child of _userproto000 */ {text: "Bing?", buttonClickScript: func() begin :SysBeep(); end, viewBounds: {top: 13, left: -36, right: 0, bottom: 29}, viewJustify: 8388646, _proto: protoTextButton }; // ---- File myNumberExpandoItem ---- _userproto001 := {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: protoTextExpando }; // ---- End of non-used User Protos ---- // ---- Beginning of section for non used Layout files ---- // End of output