⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 buttonitem.js

📁 javascript 很酷的类库
💻 JS
字号:
/*
 * Isomorphic SmartClient
 * Version 6.5 (2008-04-30)
 * Copyright(c) 1998-2007 Isomorphic Software, Inc. All rights reserved.
 * "SmartClient" is a trademark of Isomorphic Software, Inc.
 *
 * licensing@smartclient.com
 *
 * http://smartclient.com/license
 */
 //>	@class	ButtonItem// FormItem for adding a Button to a form.// @visibility external//<isc.ClassFactory.defineClass("ButtonItem", "CanvasItem");isc.ButtonItem.addProperties({    // Override canFocus -- even though buttons have no data element, they can accept focus.    canFocus:true,    // avoid attempting to include this item in the form's values array    shouldSaveValue:false,    //>	@attr	buttonItem.height		(number : 20 : IRW)	//			default height of this row	//		@group	appearance	//<	height:20,    //>	@attr	buttonItem.width    (number : 100 : IRW)	//			Size buttons at 100px by default.	//		@group	appearance	//<	width:100,        //>	@attr	buttonItem.baseStyle        (CSSStyleName : null : IRW)	//  Optional <code>baseStyle</code> will be applied to the button.	//		@group	appearance    //      @visibility external	//<	//baseStyle:null,        //>	@attr	buttonItem.titleStyle       (CSSStyleName : null : IRW)	//  Optional CSS class to apply to the button title.	//		@group	appearance    //      @visibility internal	//<        titleStyle:null,    //>	@attr	buttonItem.showTitle		(boolean : false : IRW)	// Buttons do not show a title by default.	//		@group	appearance    // @visibility external	//<	showTitle:false,	//>	@attr	buttonItem.startRow		(boolean : true : IRW)	// These items are in a row by themselves by default	// @group formLayout    // @visibility external	//<	startRow:true,	//>	@attr	buttonItem.endRow			(boolean : true : IRW)	// These items are in a row by themselves by default	// @group formLayout    // @visibility external	//<	endRow:true,    //>	@attr	buttonItem.buttonConstructor      (Class : isc.AutoFitButton : IRA)	//      Constructor class for the button.    // @visibility external	//<    buttonConstructor : isc.AutoFitButton,        //>	@attr	buttonItem.buttonDefaults   (Object : { ... } : IRA)    //  Class level default properties to apply to our button item.    //  Modify 'buttonProperties' at the instance level rather than modifying this object.	//<    buttonDefaults : {        click : function () { return this.canvasItem.handleClick(); },        getTitle : function () { return this.canvasItem.getTitle(); }    },    autoDestroy: true        //>	@attr	buttonItem.buttonProperties   (Object : null : IRA)    //  Custom Properties to apply to our button item.    // @visibility external	//<    //buttonDefaults : null        // specific pass-throughs common for buttons:    //>	@attr	buttonItem.icon     (SCImgURL : null : IRA)    //  Optional icon image to display on the button for this item.	//<    //icon :  null       });isc.ButtonItem.addMethods({    //> @method buttonItem.click    // Called when a ButtonItem is clicked on.    //    // @param	form    (DynamicForm) the managing DynamicForm instance    // @param	item	(FormItem)    the form item itself (also available as "this")    // @group eventHandling    // @visibility external    //<    // NOTE: actually registered as a StringMethod on FormItem    // Override getTitleHTML to return the title as text, rather than the HTML title with     // <LABEL> tag and underlined accessKey    getTitleHTML : function () {        return this.getTitle();         },    setTitle : function (title) {        this.title = title;        if (this.canvas) this.canvas.setTitle(title);    },        // Override _createCanvas to set up a Button as this item's canvas, with appropriate     // properties.    _createCanvas : function () {        var dynamicButtonProperties = {                canFocus : this._canFocus(),                disabled : this.isDisabled(),                width:this.width,                height:this.height            };                    // Button-specific properties        if (this.icon) dynamicButtonProperties.icon = this.icon;        if (this.titleStyle) dynamicButtonProperties.titleStyle = this.titleStyle;        if (this.baseStyle) dynamicButtonProperties.baseStyle = this.baseStyle;                            // Use 'addAutoChild' - this will handle applying the various levels of defaults        this.canvas = this.createAutoChild("button", dynamicButtonProperties, this.buttonConstructor);        this.Super("_createCanvas", arguments);            }    //>EditMode    ,    _passthroughProps : {        width:true, height:true    },    propertyChanged : function (propertyName, value) {        if (this.canvas != null && this._passthroughProps[propertyName]) {            this.canvas.setProperty(propertyName, value)        }    }    //<EditMode        });

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -