{ "id": "roo-file-77", "name": "Pman.Dialog.BuilderSourceEdit", "parent": "", "title": "Source Code Editor", "path": "/home/alan/gitlive/Pman.Builder/Pman.Dialog.BuilderSourceEdit.bjs", "items": [ { "listeners": { "|show": "function (dlg)\n{\n _this.dialog = dlg;\n _this.dialog.layout.getRegion('south').collapse();\n \n if (!_this.help) {\n _this.dialog.layout.getRegion('south').showPanel(0);\n _this.help = _this.dialog.layout.getRegion('south').getPanel(0).el.createChild( {tag: 'iframe', src : Roo.rootURL + 'docs'});\n \n }\n if (_this.isBuilder) {\n return;\n }\n\n dlg.getLayout().beginUpdate();\n var w = Roo.lib.Dom.getViewWidth();\n var h = Roo.lib.Dom.getViewHeight();\n dlg.resizeTo( w - 70, h - 70);\n dlg.moveTo(35,35);\n var val = _this.form.findField('value');\n val.setSize(w-100, h-170);\n dlg.getLayout().endUpdate();\n this.setTitle('Callback for ' + _this.data.title);\n\n}" }, "background": true, "closable": false, "collapsible": false, "height": 500, "modal": true, "title": "Source Code Edit", "width": 400, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ { "xtype": "LayoutRegion", "*prop": "center", "titlebar": false, "listeners": {}, "|xns": "Roo" }, { "xtype": "LayoutRegion", "*prop": "south", "titlebar": true, "listeners": { "|resized": "function (_self, newSize)\n{\n var sz = _this.dialog.size;\n _this.form.findField('value').setSize(sz.width-30, sz.height- newSize - 100);\n if (_this.help && newSize > 21) {\n _this.help.setSize(sz.width-25, newSize-28);\n }\n}", "|collapsed": "function (_self)\n{\n this.fireEvent('resized', this, 20);\n}", "|expanded": "function (_self)\n{\n this.fireEvent('resized', this, this.getBox().height);\n}" }, "height": 300, "collapsible": true, "split": true, "collapsedTitle": "Help / Manual", "|xns": "Roo" }, { "xtype": "ContentPanel", "background": true, "fitToFrame": true, "region": "center", "listeners": {}, "|xns": "Roo", "items": [ { "xtype": "Form", "labelAlign": "top", "listeners": { "|rendered": "function (form)\n{\n _this.form = form;\n}" }, "|xns": "Roo.form", "items": [ { "name": "value", "fieldLabel": "Enter Code for Function or Property", "xtype": "TextArea", "width": 360, "height": 100, "listeners": { "|specialkey": "function (f, e)\n{\n \n function addStr(v) {\n var fe = f.el.dom;\n if (document.selection) { // IE\n fe.focus();\n var sel =document.selection.createRange();\n sel.text = v;\n return;\n }\n if (fe.selectionStart || fe.selectionStart == '0') {\n var startPos = fe.selectionStart;\n var endPos = fe.selectionEnd;\n var restoreTop = fe.scrollTop;\n fe.value = fe.value.substring(0, startPos) + \n v + fe.value.substring(endPos, fe.value.length);\n fe.selectionStart = startPos + v.length;\n fe.selectionEnd = startPos + v.length;\n if (restoreTop>0) {\n fe.scrollTop = restoreTop;\n }\n return;\n }\n fe.value += \" \";\n }\n \n if (e.getKey() == 9) {\n addStr(\" \");\n e.stopEvent();\n }\n if (e.getKey() == 13) {\n addStr(\"\\n \");\n e.stopEvent();\n }\n\n}" }, "style": "font-family:monospace;", "|xns": "Roo.form" } ] } ] }, { "xtype": "ContentPanel", "background": true, "fitToFrame": true, "region": "south", "listeners": {}, "title": "Help / Manual", "|xns": "Roo" }, { "xtype": "Button", "|xns": "Roo", "text": "Cancel", "listeners": { "|click": "function (_self, e)\n{\n\n _this.dialog.hide();\n}" }, "*prop": "buttons[]" }, { "listeners": { "|click": "function (_self, e)\n{\n _this.callback.call(_this, {\n value : _this.form.findField('value').getValue()\n });\n _this.dialog.hide();\n}" }, "*prop": "buttons[]", "text": "OK", "xtype": "Button", "|xns": "Roo" } ] } ], "permname": "", "modOrder": "001" }