X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/desktop/Notepad.js diff --git a/examples/desktop/Notepad.js b/examples/desktop/Notepad.js new file mode 100755 index 00000000..3815bd78 --- /dev/null +++ b/examples/desktop/Notepad.js @@ -0,0 +1,63 @@ +/*! + * Ext JS Library 4.0 + * Copyright(c) 2006-2011 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license + */ + +Ext.define('MyDesktop.Notepad', { + extend: 'Ext.ux.desktop.Module', + + requires: [ + 'Ext.form.field.HtmlEditor' + //'Ext.form.field.TextArea' + ], + + id:'notepad', + + init : function(){ + this.launcher = { + text: 'Notepad', + iconCls:'notepad', + handler : this.createWindow, + scope: this + } + }, + + createWindow : function(){ + var desktop = this.app.getDesktop(); + var win = desktop.getWindow('notepad'); + if(!win){ + win = desktop.createWindow({ + id: 'notepad', + title:'Notepad', + width:600, + height:400, + iconCls: 'notepad', + animCollapse:false, + border: false, + //defaultFocus: 'notepad-editor', EXTJSIV-1300 + + // IE has a bug where it will keep the iframe's background visible when the window + // is set to visibility:hidden. Hiding the window via position offsets instead gets + // around this bug. + hideMode: 'offsets', + + layout: 'fit', + items: [ + { + xtype: 'htmleditor', + //xtype: 'textarea', + id: 'notepad-editor', + value: [ + 'Some rich text goes here
', + 'Give it a try!' + ].join('') + } + ] + }); + } + win.show(); + return win; + } +});