📄 button.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 Button//// The Button widget class implements interactive, style-based button widgets.//// @treeLocation Client Reference/Control// @visibility external//<// In IE, uses CSS styles to draw the border// In Nav, draws the border manually with images and a table//> @groupDef buttonIcon// Control over optional icons shown in Buttons, Labels and other contexts// @title Button Icon// @visibility external//<isc.ClassFactory.defineClass("Button", "StatefulCanvas").addProperties({ // Various properties documented on StatefulCanvas that affect all buttons // NOTE: This block is included in Button, ImgButton, and StrechlImgButton. // If you make changes here, make sure you duplicate it to the other // classes. // // End of this block is marked with: END StatefulCanvas @include block // ======================================================================== // Title //------ //> @attr button.title // @include statefulCanvas.title // @visibility external // @group basics // @group i18nMessages // @example buttonStates //< title:"Untitled Button", //> @attr button.hiliteAccessKey (boolean : null : IRW) // @include statefulCanvas.hiliteAccessKey // @visibility external //< //> @method button.getTitle() (A) // @include statefulCanvas.getTitle // @visibility external //< //> @method button.setTitle() // @include statefulCanvas.setTitle // @visibility external //< // Icon //------ // set useEventParts to true so we can handle an icon click separately from a // normal button click if we want useEventParts:true, //> @attr button.icon // @include statefulCanvas.icon // @visibility external // @example buttonIcons //< //> @attr button.iconSize // @include statefulCanvas.iconSize // @visibility external //< //> @attr button.iconWidth // @include statefulCanvas.iconWidth // @visibility external //< //> @attr button.iconHeight // @include statefulCanvas.iconHeight // @visibility external //< //> @attr button.iconOrientation // @include statefulCanvas.iconOrientation // @visibility external // @example buttonIcons //< //> @attr button.iconAlign // @include statefulCanvas.iconAlign // @visibility external //< //> @attr button.iconSpacing // @include statefulCanvas.icon // @visibility external //< //> @attr button.showDisabledIcon // @include statefulCanvas.showDisabledIcon // @visibility external //< //> @attr button.showRollOverIcon // @include statefulCanvas.showRollOverIcon // @visibility external //< //> @attr button.showFocusedIcon // @include statefulCanvas.showFocusedIcon // @visibility external //< //> @attr button.showDownIcon // @include statefulCanvas.showDownIcon // @visibility external // @example buttonIcons //< //> @attr button.showSelectedIcon // @include statefulCanvas.showSelectedIcon // @visibility external //< //> @method button.setIconOrientation() // @include statefulCanvas.setIconOrientation // @visibility external //< //> @method button.setIcon() // @include statefulCanvas.setIcon // @visibility external //< // AutoFit //-------- //> @attr button.autoFit // @include statefulCanvas.autoFit // @group sizing // @visibility external // @example buttonAutoFit //< //> @method button.setAutoFit() // @include statefulCanvas.setAutoFit // @visibility external //< // baseStyle //---------- //> @attr button.baseStyle (CSSStyleName : "button" : IRW) // @include statefulCanvas.baseStyle // @visibility external //< baseStyle:"button", //> @method button.setBaseStyle() // @include statefulCanvas.setBaseStyle // @visibility external //< // selection //---------- //> @attr button.selected // @include statefulCanvas.selected // @visibility external //< //> @method button.select() // @include statefulCanvas.select // @visibility external //< //> @method button.deselect() // @include statefulCanvas.select // @visibility external //< //> @method button.isSelected() // @include statefulCanvas.isSelected // @visibility external //< //> @method button.setSelected() // @include statefulCanvas.select // @visibility external //< // radioGroup //----------- //> @attr button.radioGroup // @include statefulCanvas.radioGroup // @visibility external // @example buttonRadioToggle //< //> @method button.addToRadioGroup() // @include statefulCanvas.addToRadioGroup // @visibility external //< //> @method button.removeFromRadioGroup() // @include statefulCanvas.removeFromRadioGroup // @visibility external //< //> @attr button.actionType // @include statefulCanvas.actionType // @visibility external // @example buttonRadioToggle //< //> @method button.setActionType() // @include statefulCanvas.setActionType // @visibility external //< //> @method button.getActionType() // @include statefulCanvas.getActionType // @visibility external //< // state //------ //> @attr button.state // @include statefulCanvas.state // @visibility external //< //> @method button.setState() // @include statefulCanvas.setState // @visibility external //< //> @method button.setDisabled() // @include statefulCanvas.setDisabled // @visibility external //< //> @method button.getState() // @include statefulCanvas.getState // @visibility external //< //> @attr button.showDisabled // @include statefulCanvas.showDisabled // @visibility external // @example buttonStates //< //> @attr button.showDown // @include statefulCanvas.showDown // @visibility external // @example buttonStates //< //> @attr button.showFocused // @include statefulCanvas.showFocused // @visibility external //< showDown:true, showFocused:true, //> @attr button.showRollOver // @include statefulCanvas.showRollOver // @visibility external // @example buttonStates //< showRollOver:true, mozOutlineOffset: "0px", // alignment //---------- //> @attr button.align // @include statefulCanvas.align // @visibility external //< //> @attr button.valign // @include statefulCanvas.valign // @visibility external //< // Button.action //> @method button.action() // @include statefulCanvas.action // @visibility external //< // ================= END StatefulCanvas @include block =============== // //> @attr button.wrap (boolean : false : [IRW]) // A boolean indicating whether the button's title should word-wrap, if necessary. // @group basics // @visibility external //< wrap:false, // NOTE: by setting "height" rather than "defaultHeight", we make this into an explicit // setting which will be respected by a Layout height:20, width:100, //> @attr button.overflow (attrtype : isc.Canvas.HIDDEN : IRWA) // Clip the contents of the button if necessary //< overflow:isc.Canvas.HIDDEN, //> @attr button.redrawOnDisable (boolean : true : IRWA) // true == redraw the button when it's enabled/disabled //< redrawOnDisable:false, //> @attr button.redrawOnStateChange (boolean : true : IRWA) // true == redraw the button when it's state changes // @group state //< redrawOnStateChange:false, //> @attr button.cursor (Cursor : isc.Canvas.HAND : IRW) // Hand cursor since these items are clickable //< cursor:isc.Canvas.HAND, // Style of the button is set via baseStyle, etc. above // NOTE: the button applies its CSS style to a contained cell, not the Canvas itself. className:null, // If true, add a space to left or right-aligned titles so that they are not flush with // the edge of the widget. // NOTE: FIXME: this should really be done via CSS padding, hence not external doc'd //padTitle:false, //> @attr statefulCanvas.titleStyle (CSSStyleName : "normal" : [IR]) // For buttons with icons only, optional style to be applied to title text only. This // style should contain text-related properties only (such as font size); border, padding // and background color should be specified in the style used as the "baseStyle". // // This property applied only to icon buttons rendered with a subtable, and currently only // works if redrawOnStateChange is true. Internal for now. //< //titleStyle:"buttonTitle", canFocus:true, redrawOnResize: (isc.Browser.isIE || (isc.Browser.isMoz && !isc.Browser.isStrict && isc.Canvas.getInstanceProperty("_useMozScrollbarsNone")) ? false : null)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -