1 jls.loader.provide('jls.win32.EditElement'); 2 3 jls.loader.require('jls.win32.WindowElement'); 4 jls.loader.require('jls.win32.Edit'); 5 6 jls.win32.EditElement = jls.lang.Class.create(jls.win32.WindowElement, 7 { 8 initialize : function($super, parameters, parent) { 9 this._text = ''; 10 $super(parameters, parent); 11 }, 12 onCreate : function() { 13 this._window = new jls.win32.Edit(this.getText(), this.getWindowStyle(), 14 this.getX(), this.getY(), this.getW(), this.getH(), 15 this.getParentWindow(true), this.getWindowId(true), this.getWindowExStyle()); 16 }, 17 getWindowStyle : function($super) { 18 var style = $super(); 19 if (this.getStyle().getPropertyValue('border') != null) { 20 style |= jls.win32.Window.WS_BORDER; 21 } 22 // TODO Fix 23 //if (this.getStyle().getPropertyValue('overflow') == 'auto') { 24 style |= jls.win32.Edit.ES_AUTOVSCROLL | jls.win32.Edit.ES_AUTOHSCROLL; 25 //} 26 return style; 27 }, 28 replaceSelection : function(text) { 29 this._window.replaceSel(text); 30 }, 31 getText : function() { 32 if (this._window != null) { 33 this._text = this._window.getText(); 34 } 35 return this._text; 36 }, 37 setText : function(value) { 38 if (this._window != null) { 39 this._window.setText(value); 40 } 41 this._text = value; 42 return this; 43 } 44 }); 45 46