{"id":0,"registry":{"0":{"submorphs":[{"__isSmartRef__":true,"id":1}],"scripts":[],"id":"3AE2C97B-C65A-427D-B701-8D42B4C78D53","shape":{"__isSmartRef__":true,"id":44},"droppingEnabled":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":51},"showsHalos":false,"name":"TouchList","partsBinMetaInfo":{"__isSmartRef__":true,"id":52},"__SourceModuleName__":"Global.lively.morphic.Core","renderContextTable":{"__isSmartRef__":true,"id":93},"eventHandler":{"__isSmartRef__":true,"id":94},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"derivationIds":[127,"86FF1C90-3CC2-44B9-8DEE-1BC214D734AE","EEA7DF22-C343-4B58-A447-43BB95D5405F","9665449D-F0E4-4BCE-854B-48D19C73214E","8B65C997-34DC-4F70-A1BA-266488F1588C","CBDEE8B9-9E1C-44E5-85E6-6D85E0738D59","44F04EA0-0B18-48F5-82DE-1C400B2E7E66","B5BC05CD-9955-4638-A7C0-3A76AD1EE0B1","B01D7C41-6561-42C3-AF67-837DB8619D96","EBA19361-462E-4B18-80CC-D4DF92C36B05","ABDDDBA7-E05A-4447-B258-C60BD7693A6D","71BDB43E-1F93-4CED-A861-8D6975D779E3","619B385B-0252-4B72-97DF-FF5B379EC5CD","55B08748-4DB3-4AE0-BDB7-5F5FA11ABB9E","0711F98C-2086-431E-9873-9D1DF6871343","E2124A7B-87CF-476C-8EB9-DDDB517F4A94","C7631800-081F-405F-9039-9716792165BF","D355ED2D-8E27-47EB-ABA5-B32FC1F7AE73"],"priorExtent":{"__isSmartRef__":true,"id":95},"isBeingDragged":false,"layout":{"__isSmartRef__":true,"id":96},"itemList":[],"_ClipMode":"hidden","selectedMorph":null,"items":[],"selectedLineNo":-1,"selection":null,"prevScroll":[0,0],"moved":true,"_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":97},"__LivelyClassName__":"lively.morphic.Box"},"1":{"submorphs":[],"scripts":[],"id":"98AEC0B2-E3E3-482B-8C99-CA9F66F3A65D","shape":{"__isSmartRef__":true,"id":2},"droppingEnabled":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":9},"showsHalos":false,"name":"ListItemContainer","partsBinMetaInfo":{"__isSmartRef__":true,"id":10},"__SourceModuleName__":"Global.lively.morphic.Core","renderContextTable":{"__isSmartRef__":true,"id":11},"eventHandler":{"__isSmartRef__":true,"id":12},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"derivationIds":[127,"70193F55-BD62-471E-90CE-6CF2F345BFF8","C29938AD-3221-4AB2-80BA-EBF64E5C8063","F478A91E-32FA-4527-BA77-81009843E6E7","3C2C2181-A589-45A7-B023-FDED3CDFE499","45EE0951-5C82-4C8D-808E-E69D6E6AFFC8","2964BC5A-EAE3-475B-95AC-0E9D3024D1BF","74F5FD7F-E5EA-4BE8-964D-7ABBFAFCB5D5","D3CBEE5F-FB39-4E1F-A1D8-CD60CAFAF2F9","1852D238-B9F1-4250-BC2C-F43F9855457A","EEA1E0C3-5567-4B87-B2FE-DDF9A527434B","6543C5C6-6315-484B-A637-A47760C47EF2","30CF65CD-68C9-4CCF-A1B5-9510B5396635","BE5F8A57-D0B2-435D-BA65-66E7B771647F","72D13BF6-6182-43EE-A853-074DC5EF071A","99C6406E-F13F-4FDD-9BB2-B8C36653F65E","A41CEEAD-A0DE-4547-B565-E0D932E12764","BEE20607-9D99-41C6-8B76-436DB8AA593E"],"owner":{"__isSmartRef__":true,"id":0},"isBeingDragged":false,"priorExtent":{"__isSmartRef__":true,"id":13},"layout":{"__isSmartRef__":true,"id":14},"prevScroll":[0,0],"_ClipMode":"visible","_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":15},"__LivelyClassName__":"lively.morphic.Box"},"2":{"position":{"__isSmartRef__":true,"id":3},"_Extent":{"__isSmartRef__":true,"id":4},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":5},"_Fill":{"__isSmartRef__":true,"id":6},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":7},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":8},"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"3":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"4":{"x":199,"y":90,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"5":{"r":1,"g":1,"b":1,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"6":{"r":1,"g":1,"b":1,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"7":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"8":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"9":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"10":{"partsSpaceName":"PartsBin/Basic","__SourceModuleName__":"Global.lively.PartsBin","comment":"A simple box morph. A really blue one. Its amazing what you can build out of simple boxes.... Who needs stars when you got blue rectangles!","migrationLevel":2,"partName":"Rectangle","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"11":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"12":{"morph":{"__isSmartRef__":true,"id":1},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"13":{"x":199,"y":90,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"14":{"resizeWidth":true,"adjustForNewBounds":true},"15":{"onTouchStart":{"__isSmartRef__":true,"id":16},"onTouchMove":{"__isSmartRef__":true,"id":24},"onTouchEnd":{"__isSmartRef__":true,"id":28},"stayInBounds":{"__isSmartRef__":true,"id":36},"isInBounds":{"__isSmartRef__":true,"id":40}},"16":{"varMapping":{"__isSmartRef__":true,"id":17},"source":"function onTouchStart(evt) {\n    evt.stop();\n\n    var touch = evt.touches[0];\n\n    if(touch) {\n        touch.originalDragOffset = touch.clientY;\n        touch.originalMenuOffset = this.getPosition().y;\n    \n        var heightMenu = this.owner.itemList.length*43;\n        var heightContainer = this.owner.getExtent().y;\n        this.maxScroll = heightMenu - heightContainer;\n\n        this.isTouched = true;\n        this.velocity = 0;\n        touch.lastTouch = touch.clientY;\n        touch.lastUpdate = new Date().valueOf();\n    }\n    evt.stop()\n    return false;\n\n    \n}","funcProperties":{"__isSmartRef__":true,"id":22},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17":{"this":{"__isSmartRef__":true,"id":1},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18}},"18":{"$super":{"__isSmartRef__":true,"id":19}},"19":{"varMapping":{"__isSmartRef__":true,"id":20},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":21},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"20":{"obj":{"__isSmartRef__":true,"id":1},"name":"onTouchStart"},"21":{},"22":{"timestamp":{"__isSmartRef__":true,"id":23},"user":"athomschke","tags":[]},"23":{"isSerializedDate":true,"string":"Thu Feb 09 2012 11:00:14 GMT+0100 (CET)"},"24":{"varMapping":{"__isSmartRef__":true,"id":25},"source":"function onTouchMove(evt) {\n    evt.stop();\n\n    var touch = evt.touches[0];\n    \n    if(touch && touch.originalDragOffset) {\n        var delta = touch.clientY - touch.originalDragOffset;\n        this.setPosition(pt(0,touch.originalMenuOffset+delta));\n\n        if(!this.isInBounds()) {\n            var yPos = Math.min(0,Math.max(-this.maxScroll, this.getPosition().y));\n            delta = this.getPosition().y-yPos;\n            this.moveBy(pt(0,-delta/2));\n        }\n\n        var positionDelta = touch.lastTouch-touch.clientY;\n        var delta = (touch.clientY - touch.originalDragOffset)/this.owner.getScale();;\n\n        var now = new Date().valueOf();\n        var timeDelta = now - touch.lastUpdate;\n\n        touch.lastTouch = touch.clientY;\n        touch.lastUpdate = now;\n\n        this.velocity = positionDelta*(-10/timeDelta);\n        \n\n    }\n    evt.stop();\n    return false;\n\n}","funcProperties":{"__isSmartRef__":true,"id":26},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"25":{"this":{"__isSmartRef__":true,"id":1}},"26":{"timestamp":{"__isSmartRef__":true,"id":27},"user":"huberthesse","tags":[]},"27":{"isSerializedDate":true,"string":"Tue May 08 2012 10:40:13 GMT+0200 (CEST)"},"28":{"varMapping":{"__isSmartRef__":true,"id":29},"source":"function onTouchEnd(evt) {\n    var lastUpdate = new Date().valueOf();\n    this.isTouched = false;\n    var that = this;\n\n    var flickingFct = function() {\n        var now = new Date().valueOf();\n        var delta = now - lastUpdate;\n        var velo;\n        that.velocity *= Math.pow(0.99, delta);\n        that.moveBy(pt(0,that.velocity));\n        that.stayInBounds();\n        velo = that.velocity;\n        \n        lastUpdate = now;\n        if((velo*velo>0.05 || !that.isInBounds()) && !that.isTouched) {\n            window.setTimeout(flickingFct,10);\n        }\n    };\n\n    window.setTimeout(flickingFct,10);\n    evt.stop();\n\n}","funcProperties":{"__isSmartRef__":true,"id":34},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"29":{"this":{"__isSmartRef__":true,"id":1},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":30}},"30":{"$super":{"__isSmartRef__":true,"id":31}},"31":{"varMapping":{"__isSmartRef__":true,"id":32},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":33},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"32":{"obj":{"__isSmartRef__":true,"id":1},"name":"onTouchEnd"},"33":{},"34":{"timestamp":{"__isSmartRef__":true,"id":35},"user":"athomschke","tags":[]},"35":{"isSerializedDate":true,"string":"Thu Feb 09 2012 10:59:18 GMT+0100 (CET)"},"36":{"varMapping":{"__isSmartRef__":true,"id":37},"source":"function stayInBounds() {\n    var yPos = Math.min(0,Math.max(-this.maxScroll, this.getPosition().y));\n    var delta = this.getPosition().y-yPos;\n\n    if(this.velocity*delta > 0) {\n        // out of bounds and velocity is in wrong direction\n        this.velocity -= delta/15;\n    } else if(delta!=0) {\n        this.velocity = -delta/15;\n    }\n//    this.setPosition(pt(0,yPos));\n\n}","funcProperties":{"__isSmartRef__":true,"id":38},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"37":{"this":{"__isSmartRef__":true,"id":1}},"38":{"timestamp":{"__isSmartRef__":true,"id":39},"user":"sstamm","tags":[]},"39":{"isSerializedDate":true,"string":"Tue Jan 31 2012 11:38:39 GMT+0100 (CET)"},"40":{"varMapping":{"__isSmartRef__":true,"id":41},"source":"function isInBounds() {\n    var yPos = Math.min(0,Math.max(-this.maxScroll, this.getPosition().y));\n    var delta = this.getPosition().y-yPos;\n\n    return Math.abs(delta)<=0.02;\n\n}","funcProperties":{"__isSmartRef__":true,"id":42},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"41":{"this":{"__isSmartRef__":true,"id":1}},"42":{"timestamp":{"__isSmartRef__":true,"id":43},"user":"sstamm","tags":[]},"43":{"isSerializedDate":true,"string":"Tue Jan 31 2012 11:38:48 GMT+0100 (CET)"},"44":{"position":{"__isSmartRef__":true,"id":45},"_Extent":{"__isSmartRef__":true,"id":46},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":47},"_Fill":{"__isSmartRef__":true,"id":48},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":49},"_ClipMode":"hidden","_Padding":{"__isSmartRef__":true,"id":50},"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"45":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"46":{"x":199,"y":300,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"47":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"48":{"r":1,"g":1,"b":1,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"49":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"50":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"51":{"x":0,"y":0,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"52":{"partsSpaceName":"PartsBin/iPadWidgets/","__SourceModuleName__":"Global.lively.PartsBin","comment":"A morph which behaves like an IPad list. Use initialize() to clear and addItem() to ... well ... add items","migrationLevel":4,"partName":"TouchList","changes":[{"__isSmartRef__":true,"id":53},{"__isSmartRef__":true,"id":55},{"__isSmartRef__":true,"id":57},{"__isSmartRef__":true,"id":59},{"__isSmartRef__":true,"id":61},{"__isSmartRef__":true,"id":63},{"__isSmartRef__":true,"id":65},{"__isSmartRef__":true,"id":67},{"__isSmartRef__":true,"id":69},{"__isSmartRef__":true,"id":71},{"__isSmartRef__":true,"id":73},{"__isSmartRef__":true,"id":75},{"__isSmartRef__":true,"id":77},{"__isSmartRef__":true,"id":79},{"__isSmartRef__":true,"id":81},{"__isSmartRef__":true,"id":83},{"__isSmartRef__":true,"id":85},{"__isSmartRef__":true,"id":87},{"__isSmartRef__":true,"id":89},{"__isSmartRef__":true,"id":91}],"revisionOnLoad":159777,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"53":{"date":{"__isSmartRef__":true,"id":54},"author":"huberthesse","message":"Backported icons & shadow fix to TouchList","id":"601B7DAB-096A-42B1-B758-D037B5B4FCAC"},"54":{"isSerializedDate":true,"string":"Mon May 07 2012 12:41:49 GMT+0200 (CEST)"},"55":{"date":{"__isSmartRef__":true,"id":56},"author":"sstamm","message":"implemented selectAt","id":"DDEE79B8-F135-4D53-A190-915EFCCE7CEE"},"56":{"isSerializedDate":true,"string":"Fri Feb 10 2012 09:53:41 GMT+0100 (CET)"},"57":{"date":{"__isSmartRef__":true,"id":58},"author":"athomschke","message":"evt.stop implemented","id":"D49BB272-FB4C-4EF9-AB8D-5F144EBC24FD"},"58":{"isSerializedDate":true,"string":"Thu Feb 09 2012 12:47:27 GMT+0100 (CET)"},"59":{"date":{"__isSmartRef__":true,"id":60},"author":"athomschke","message":"convenience method getList()","id":"2F549176-1E83-42B8-9A12-C310581B0B4B"},"60":{"isSerializedDate":true,"string":"Tue Feb 07 2012 14:13:08 GMT+0100 (CET)"},"61":{"date":{"__isSmartRef__":true,"id":62},"author":"sstamm","message":"","id":"56852062-4668-4A1A-ACB3-BCF641C8B4F4"},"62":{"isSerializedDate":true,"string":"Tue Feb 07 2012 13:56:37 GMT+0100 (CET)"},"63":{"date":{"__isSmartRef__":true,"id":64},"author":"sstamm","message":"","id":"DFC5B2E7-2E6B-425A-B10A-52B615C3A635"},"64":{"isSerializedDate":true,"string":"Tue Feb 07 2012 12:44:21 GMT+0100 (CET)"},"65":{"date":{"__isSmartRef__":true,"id":66},"author":"sstamm","message":"we won't implement setSelection","id":"122879B0-1530-413F-A4A6-8EF04FBB4B52"},"66":{"isSerializedDate":true,"string":"Tue Feb 07 2012 12:42:39 GMT+0100 (CET)"},"67":{"date":{"__isSmartRef__":true,"id":68},"author":"sstamm","message":"added updateListMethod","id":"111B62E3-0972-481F-BECB-26B8976BE918"},"68":{"isSerializedDate":true,"string":"Tue Feb 07 2012 12:34:53 GMT+0100 (CET)"},"69":{"date":{"__isSmartRef__":true,"id":70},"author":"sstamm","message":"initial commit","id":"767E9E7C-11E5-4BEF-A4B2-3668C46D0969"},"70":{"isSerializedDate":true,"string":"Tue Jan 24 2012 19:00:20 GMT+0100 (CET)"},"71":{"date":{"__isSmartRef__":true,"id":72},"author":"sstamm","message":"fixed bug when deleting the text morph on the iPad","id":"C93A96ED-F8E8-44F7-A454-D664753C5466"},"72":{"isSerializedDate":true,"string":"Fri Jan 27 2012 10:30:26 GMT+0100 (CET)"},"73":{"date":{"__isSmartRef__":true,"id":74},"author":"sstamm","message":"","id":"A26BF7D0-A1D7-46E6-9AF1-47338619CD17"},"74":{"isSerializedDate":true,"string":"Fri Jan 27 2012 16:02:09 GMT+0100 (CET)"},"75":{"date":{"__isSmartRef__":true,"id":76},"author":"sstamm","message":"disabled halos on the text morph","id":"9EAE8CAF-9C94-41BE-B398-D3D688298B13"},"76":{"isSerializedDate":true,"string":"Fri Jan 27 2012 16:48:12 GMT+0100 (CET)"},"77":{"date":{"__isSmartRef__":true,"id":78},"author":"sstamm","message":"added caching to itemListMorph onmove","id":"441999A4-0272-48BF-B0E8-0F38B9B540AC"},"78":{"isSerializedDate":true,"string":"Tue Jan 31 2012 11:44:34 GMT+0100 (CET)"},"79":{"date":{"__isSmartRef__":true,"id":80},"author":"conradcalmez","message":"added setList convenience method","id":"6347240A-F61E-44ED-82FA-15047F8B547D"},"80":{"isSerializedDate":true,"string":"Tue Feb 07 2012 13:55:45 GMT+0100 (CET)"},"81":{"date":{"__isSmartRef__":true,"id":82},"author":"athomschke","message":"when updateList is called without a parameter, the List is reset (convenience)","id":"48CDE5D5-4D4E-47D2-A142-6DEE00CADBD2"},"82":{"isSerializedDate":true,"string":"Tue Feb 07 2012 14:09:54 GMT+0100 (CET)"},"83":{"date":{"__isSmartRef__":true,"id":84},"author":"athomschke","message":"convenience: selectAt(int)","id":"95BE3986-850B-423D-ACFA-2E7F7A0AE6B7"},"84":{"isSerializedDate":true,"string":"Tue Feb 07 2012 14:20:49 GMT+0100 (CET)"},"85":{"date":{"__isSmartRef__":true,"id":86},"author":"athomschke","message":"removed connectors","id":"2A3B787D-2040-48CB-B2BE-DCB454F131D9"},"86":{"isSerializedDate":true,"string":"Tue Feb 07 2012 14:21:24 GMT+0100 (CET)"},"87":{"date":{"__isSmartRef__":true,"id":88},"author":"athomschke","message":"disabled dragging the list items.","id":"698E98FE-85EF-47CC-9E32-6D5EC2E9B7D6"},"88":{"isSerializedDate":true,"string":"Thu Feb 09 2012 17:15:34 GMT+0100 (CET)"},"89":{"date":{"__isSmartRef__":true,"id":90},"author":"sstamm","message":"implemented find and setSelection","id":"1E9D7A9F-E565-4DAD-BBDA-D43835388881"},"90":{"isSerializedDate":true,"string":"Fri Feb 10 2012 10:06:40 GMT+0100 (CET)"},"91":{"date":{"__isSmartRef__":true,"id":92},"author":"huberthesse","message":"added Scale to scrolling in menu. Possible that getScale is not propagated corretly and have to be adjusted for use case","id":"55C2FCAB-857A-4084-B639-836696A329E0"},"92":{"isSerializedDate":true,"string":"Tue May 08 2012 10:41:03 GMT+0200 (CEST)"},"93":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"94":{"morph":{"__isSmartRef__":true,"id":0},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"95":{"x":199,"y":300,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"96":{"adjustForNewBounds":true,"resizeWidth":true,"resizeHeight":true},"97":{"onrestore":{"__isSmartRef__":true,"id":98},"initialize":{"__isSmartRef__":true,"id":106},"addItem":{"__isSmartRef__":true,"id":114},"createListItem":{"__isSmartRef__":true,"id":118},"touchstartCallback":{"__isSmartRef__":true,"id":122},"touchmoveCallback":{"__isSmartRef__":true,"id":126},"touchendCallback":{"__isSmartRef__":true,"id":130},"updateSelection":{"__isSmartRef__":true,"id":134},"updateList":{"__isSmartRef__":true,"id":138},"setSelection":{"__isSmartRef__":true,"id":142},"setList":{"__isSmartRef__":true,"id":146},"getList":{"__isSmartRef__":true,"id":150},"selectAt":{"__isSmartRef__":true,"id":154},"find":{"__isSmartRef__":true,"id":158}},"98":{"varMapping":{"__isSmartRef__":true,"id":99},"source":"function onrestore() {\n    var that = this;\n\n    //TODO: this is a race condition, because the render context is not\n    // ready in onrestore\n    window.setTimeout(function() { \n        that.shape.setClipMode(\"hidden\"); }, 100);\n}","funcProperties":{"__isSmartRef__":true,"id":104},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"99":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":100}},"100":{"$super":{"__isSmartRef__":true,"id":101}},"101":{"varMapping":{"__isSmartRef__":true,"id":102},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":103},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"102":{"obj":{"__isSmartRef__":true,"id":0},"name":"onrestore"},"103":{},"104":{"timestamp":{"__isSmartRef__":true,"id":105},"user":"sstamm","tags":[]},"105":{"isSerializedDate":true,"string":"Thu Jan 19 2012 10:24:24 GMT+0100 (CET)"},"106":{"varMapping":{"__isSmartRef__":true,"id":107},"source":"function initialize() {\n    console.log(\"in initialize\");\n    this.itemList = [];\n    this.items = [];\n    this.selection = null;\n    this.selectedLineNo = -1;\n    this.selectedMorph = null;\n    this.shape.setClipMode(\"hidden\");\n    var itemContainer = this.get(\"ListItemContainer\");\n    \n    itemContainer.setPosition(pt(0,0));\n    itemContainer.submorphs.invoke(\"remove\");\n    \n}","funcProperties":{"__isSmartRef__":true,"id":112},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"107":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":108}},"108":{"$super":{"__isSmartRef__":true,"id":109}},"109":{"varMapping":{"__isSmartRef__":true,"id":110},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":111},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"110":{"obj":{"__isSmartRef__":true,"id":0},"name":"initialize"},"111":{},"112":{"timestamp":{"__isSmartRef__":true,"id":113},"user":"sstamm","tags":[]},"113":{"isSerializedDate":true,"string":"Tue Feb 07 2012 12:32:54 GMT+0100 (CET)"},"114":{"varMapping":{"__isSmartRef__":true,"id":115},"source":"function addItem(text) {\n    var newMorph = this.createListItem(text);\n    \n    newMorph.setPosition(pt(0,this.itemList.length*43));\n    this.itemList.push(newMorph);\n    this.items.push(text);\n    this.get(\"ListItemContainer\").addMorph(newMorph);\n}","funcProperties":{"__isSmartRef__":true,"id":116},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"115":{"this":{"__isSmartRef__":true,"id":0}},"116":{"timestamp":{"__isSmartRef__":true,"id":117},"user":"sstamm","tags":[]},"117":{"isSerializedDate":true,"string":"Fri Feb 10 2012 10:01:38 GMT+0100 (CET)"},"118":{"varMapping":{"__isSmartRef__":true,"id":119},"source":"function createListItem(textString) {\n    var part = lively.PartsBin.getPart(\"Rectangle\", \"PartsBin/Basic\");\n\n    part.index = this.itemList.length;\n\n    part.setExtent(pt(this.getExtent().x,44));\n    part.applyStyle({resizeWidth: true});\n    part.setFill(new lively.morphic.LinearGradient(\n        [\n            {offset: 0, color: Color.rgb(253,253,253)},\n            {offset: 1, color: Color.rgb(238,238,238)}\n        ],\n        'northSouth'\n    ));\n    part.setBorderColor(Color.rgb(138,138,138));\n    \n\n\n    part.onTouchStart = this.touchstartCallback;\n    part.onTouchMove = this.touchmoveCallback;\n    part.onTouchEnd = this.touchendCallback;\n\n    part.disableGrabbing();\n    part.disableDragging();\n\n    part.registerForEvent(\"touchstart\", part, \"onTouchStart\", false);\n    part.registerForEvent(\"touchmove\", part, \"onTouchMove\", false);\n    part.registerForEvent(\"touchend\", part, \"onTouchEnd\", false);\n\n    var text = lively.PartsBin.getPart(\"Text\", \"PartsBin/Basic\");\n    text.setFontSize(14);\n    text.setTextColor(Color.rgb(47,47,47));\n    text.setFontFamily(\"Helvetica, Arial, sans-serif\");\n\n    text.setPosition(pt(10,10));\n    text.textString = textString;\n\n    text.emphasizeAll({fontWeight: 'bold'});\n    text.disableHalos();\n    text.ignoreEvents();\n    part.addMorph(text);\n    \n    if (item.value[1] instanceof Array ) {\n        var rect = new Rectangle(0,0, 15, 15),\n        icon = new lively.morphic.Image(rect, \"http://lively-kernel.org/repository/webwerkstatt/projects/BP2012/UI/ipadMenu/submenu.png\", false);\n    var xPos = part.getExtent().subPt(icon.getExtent().scaleBy(1.5)).x,\n        yPos = part.getExtent().subPt(icon.getExtent()).scaleBy(0.5).y;\n    \n        icon.setPosition(pt(xPos,yPos))\n        icon.disableHalos();\n        icon.disableSelection();\n        icon.ignoreEvents();\n        part.addMorph(icon)\n    }\n    return part;\n}","funcProperties":{"__isSmartRef__":true,"id":120},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"119":{"this":{"__isSmartRef__":true,"id":0}},"120":{"timestamp":{"__isSmartRef__":true,"id":121},"user":"huberthesse","tags":[]},"121":{"isSerializedDate":true,"string":"Mon May 07 2012 12:40:50 GMT+0200 (CEST)"},"122":{"varMapping":{"__isSmartRef__":true,"id":123},"source":"function touchstartCallback(evt) {\n    var touch = evt.touches[0];\n\n    this.clickPosition = pt(touch.clientX,touch.clientY);\n    this.lastClickPos = this.clickPosition;\n\n    return false;\n}","funcProperties":{"__isSmartRef__":true,"id":124},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"123":{"this":{"__isSmartRef__":true,"id":0}},"124":{"timestamp":{"__isSmartRef__":true,"id":125},"user":"sstamm","tags":[]},"125":{"isSerializedDate":true,"string":"Thu Jan 19 2012 11:37:36 GMT+0100 (CET)"},"126":{"varMapping":{"__isSmartRef__":true,"id":127},"source":"function touchmoveCallback(evt) {\n    var touch = evt.touches[0];\n    \n    this.lastClickPos = pt(touch.clientX,touch.clientY);\n\n    return false;\n    \n}","funcProperties":{"__isSmartRef__":true,"id":128},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"127":{"this":{"__isSmartRef__":true,"id":0}},"128":{"timestamp":{"__isSmartRef__":true,"id":129},"user":"sstamm","tags":[]},"129":{"isSerializedDate":true,"string":"Thu Jan 19 2012 11:34:29 GMT+0100 (CET)"},"130":{"varMapping":{"__isSmartRef__":true,"id":131},"source":"function touchendCallback(evt) {\n    var deltaPt = this.lastClickPos.subPt(this.clickPosition);\n    var delta = deltaPt.x*deltaPt.x + deltaPt.y*deltaPt.y;\n    if(delta<25) {\n        //TODO: find a better way to find the related listMorph\n        var listMorph = this.owner.owner;\n        \n        if(listMorph && listMorph.updateSelection) {\n            listMorph.updateSelection(this);\n        }\n    }\n    return false;\n}","funcProperties":{"__isSmartRef__":true,"id":132},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"131":{"this":{"__isSmartRef__":true,"id":0}},"132":{"timestamp":{"__isSmartRef__":true,"id":133},"user":"sstamm","tags":[]},"133":{"isSerializedDate":true,"string":"Fri Jan 20 2012 17:14:44 GMT+0100 (CET)"},"134":{"varMapping":{"__isSmartRef__":true,"id":135},"source":"function updateSelection(newSelectedMorph) {\n    var hasText = true;\n    if(this.selectedMorph) {\n        hasText = this.selectedMorph.submorphs[0];\n        this.selectedMorph.setFill(\n            new lively.morphic.LinearGradient(\n            [\n                {offset: 0, color: Color.rgb(253,253,253)},\n                {offset: 1, color: Color.rgb(238,238,238)}\n            ],\n            'northSouth'\n            )\n        );\n        if(hasText) {        this.selectedMorph.submorphs[0].setTextColor(Color.rgb(47,47,47));\n        }\n    }\n    hasText = newSelectedMorph.submorphs[0];\n\n    \n    if(hasText) {\n        this.selection = newSelectedMorph.submorphs[0].textString;\n    } else {\n        this.selection = \"\";\n    }\n    this.selectedLineNo = newSelectedMorph.index;\n    this.selectedMorph = newSelectedMorph;\n    \n    this.selectedMorph.setFill(\nnew lively.morphic.LinearGradient(\n        [\n            {offset: 0, color: Color.rgb(47,47,47)},\n            {offset:0.5,color: Color.rgb(21,21,21)},\n            {offset: 1, color: Color.rgb(0,0,0)}\n        ],\n        'northSouth'\n    ));\n    \n    if(hasText) {\n        this.selectedMorph.submorphs[0].setTextColor(Color.rgb(222,222,222));\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":136},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"135":{"this":{"__isSmartRef__":true,"id":0}},"136":{"timestamp":{"__isSmartRef__":true,"id":137},"user":"sstamm","tags":[]},"137":{"isSerializedDate":true,"string":"Fri Jan 27 2012 10:29:27 GMT+0100 (CET)"},"138":{"varMapping":{"__isSmartRef__":true,"id":139},"source":"function updateList(itemList) {\n    //this.items = itemsList;\n    this.initialize();\n    if (!itemList) return;\n    var that = this;\n    itemList.forEach(function (item) {\n        that.addItem(item);\n    });\n}","funcProperties":{"__isSmartRef__":true,"id":140},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"139":{"this":{"__isSmartRef__":true,"id":0}},"140":{"timestamp":{"__isSmartRef__":true,"id":141},"user":"athomschke","tags":[]},"141":{"isSerializedDate":true,"string":"Tue Feb 07 2012 14:09:24 GMT+0100 (CET)"},"142":{"varMapping":{"__isSmartRef__":true,"id":143},"source":"function setSelection(str) {\n    this.selectAt(this.find(str));\n}","funcProperties":{"__isSmartRef__":true,"id":144},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"143":{"this":{"__isSmartRef__":true,"id":0}},"144":{"timestamp":{"__isSmartRef__":true,"id":145},"user":"sstamm","tags":[]},"145":{"isSerializedDate":true,"string":"Fri Feb 10 2012 10:05:57 GMT+0100 (CET)"},"146":{"varMapping":{"__isSmartRef__":true,"id":147},"source":"function setList(itemList) {\n    return this.updateList(itemList);\n}","funcProperties":{"__isSmartRef__":true,"id":148},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"147":{"this":{"__isSmartRef__":true,"id":0}},"148":{"timestamp":{"__isSmartRef__":true,"id":149},"user":"conradcalmez","tags":[]},"149":{"isSerializedDate":true,"string":"Tue Feb 07 2012 13:55:08 GMT+0100 (CET)"},"150":{"varMapping":{"__isSmartRef__":true,"id":151},"source":"function getList() {\n    return this.itemList;\n}","funcProperties":{"__isSmartRef__":true,"id":152},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"151":{"this":{"__isSmartRef__":true,"id":0}},"152":{"timestamp":{"__isSmartRef__":true,"id":153},"user":"athomschke","tags":[]},"153":{"isSerializedDate":true,"string":"Tue Feb 07 2012 14:12:52 GMT+0100 (CET)"},"154":{"varMapping":{"__isSmartRef__":true,"id":155},"source":"function selectAt(int) {\n    var newSelectedMorph = this.itemList[int];\n    return this.updateSelection(newSelectedMorph);\n}","funcProperties":{"__isSmartRef__":true,"id":156},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"155":{"this":{"__isSmartRef__":true,"id":0}},"156":{"timestamp":{"__isSmartRef__":true,"id":157},"user":"sstamm","tags":[]},"157":{"isSerializedDate":true,"string":"Fri Feb 10 2012 09:53:05 GMT+0100 (CET)"},"158":{"varMapping":{"__isSmartRef__":true,"id":159},"source":"function find(itemString) {\n    for (var i = 0; i < this.items.length; i++) {\n        if(this.items[i] === itemString) {\n            return i;\n        }\n    }\n    \n}","funcProperties":{"__isSmartRef__":true,"id":160},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"159":{"this":{"__isSmartRef__":true,"id":0}},"160":{"timestamp":{"__isSmartRef__":true,"id":161},"user":"sstamm","tags":[]},"161":{"isSerializedDate":true,"string":"Fri Feb 10 2012 10:04:10 GMT+0100 (CET)"},"isSimplifiedRegistry":true}}