1 jls.loader.provide('jls.win32.ButtonElement'); 2 3 jls.loader.require('jls.win32.WindowElement'); 4 jls.loader.require('jls.win32.Button'); 5 6 jls.win32.ButtonElement = 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.createWindow(jls.win32.Button, jls.win32.Button.CLASSNAME, this.getText()); 14 this._window = new jls.win32.Button(this.getText(), this.getWindowStyle(), 15 this.getX(), this.getY(), this.getW(), this.getH(), 16 this.getParentWindow(true), this.getWindowId(true), this.getWindowExStyle()); 17 }, 18 /*getWindowStyle : function($super) { 19 return jls.win32.Window.WS_CHILD | jls.win32.Window.WS_VISIBLE;// | jls.win32.Button.BS_BITMAP | jls.win32.Button.BS_ICON; 20 },*/ 21 getSelected : function() { 22 return this._window.getSelected(); 23 }, 24 setSelected : function(value) { 25 if (this._window != null) { 26 this._window.setSelected(value); 27 } 28 this._text = value; 29 return this; 30 }, 31 setIcon : function(name) { 32 var icon = jls.win32.WindowElement.getIcon(name); 33 if (icon) { 34 this._window.sendMessage(jls.win32.Button.BM_SETIMAGE, jls.win32.Image.IMAGE_ICON, icon); 35 } 36 return this; 37 }, 38 getText : function() { 39 return this._text; 40 }, 41 setText : function(value) { 42 if (this._window != null) { 43 this._window.setText(value); 44 } 45 this._text = value; 46 return this; 47 } 48 }); 49 50