📄 window.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 Window//// A general purpose Window class for implementing dialogs, portlets, alerts, prompts, wizards// and desktop-like windowing interfaces.// <P>// Windows can contain arbitrary SmartClient components, configured via the +link{window.items}// property. Windows may be +link{window.isModal,modal} or non-modal.// <P>// Windows provide a series of highly configurable and skinnable +link{AutoChild,autoChildren}// including a header, various header controls, footer, and corner resizer.// <P>// The more specialized +link{Dialog} subclass of Window has additional functionality targetted// at simple prompts and confirmations, such as buttons with default actions, and single-method// +link{isc.warn,shortcuts} for common application dialogs.//// @treeLocation Client Reference/Layout// @visibility external//<isc.ClassFactory.defineClass("Window", "VLayout");//> @groupDef body// Things related to the body subobject of Window// @visibility internal//<//> @groupDef header// Things related to the header subobject of Window// @visibility internal//<//> @groupDef headerLabel// Things related to the headerLabel subobject of Window// @visibility internal//<//> @groupDef footer// Things related to the foot subobject of Window// @visibility internal//<//> @groupDef windowItems// Things related to the items contained in the Window body// @title Window Items// @visibility internal//<// add standard instance propertiesisc.Window.addProperties({ // Skinning // --------------------------------------------------------------------------------------- //> @attr window.styleName (string : "windowBackground" : IRW) // Default style for the Window background // @group appearance, header //< styleName:"windowBackground", //> @attr window.skinImgDir (URL : "images/Window/" : IRWA) // Where do 'skin' images (those provided with the class) live? // This is local to the Page.skinDir // @group appearance, images //< skinImgDir:"images/Window/", //> @attr window.backgroundColor (string : "#DDDDDD" : IRW) // background color, picked up in Header, Footer, etc. // @group appearance, header //< backgroundColor:"#DDDDDD", layoutMargin:2, membersMargin:2, // Dragging // --------------------------------------------------------------------------------------- dragStartDistance:1, //> @attr window.canDragReposition (boolean : true : IRW) // if true, this Window may be moved around by the user by dragging on the Window header. // Note that if the header is not showing, the Window can't be drag-repositioned regardless // of this setting. // @see window.showHeader // @group dragging // @visibility external //< canDragReposition:true, //> @attr window.keepInParentRect (boolean or rect: null : IRWA) // If +link{window.canDragReposition} or +link{window.canDragResize} is true, should the // windows size and position be constrained such that it remains within the viewport of // its parent element (or for top level windows, within the viewport of the browser window)? // <br> // Can also be set to an array denoting an arbitrary rect [Left,Top,Width,Height] beyond // which the window cannot be moved. // <p> // Note: keepInParentRect affects only user drag interactions, not programmatic moves. // // @see window.canDragReposition // @group dragdrop // @visibility external //< //> @attr window.dragAppearance (DragAppearance : isc.EventHandler.OUTLINE : IRW) // When the Window is being moved, move the whole thing. // @group dragging //< dragAppearance : isc.EventHandler.OUTLINE, // Drag Resizing // --------------------------------------------------------------------------------------- //> @attr window.canDragResize (boolean : false : IRW) // Can the window be drag-resized? If true the window may be drag resized from its edges, // and if showing, via the resiszer icon in the footer. // @see window.showResizer // @group dragging, resizing // @visibility external //< canDragResize:false, //> @attr window.resizeFrom (array : ["R","B","BR"] : IRWA) // which parts of the window can be clicked and // dragged to resize it? // @group resizing //< resizeFrom:["R","B","BR"], // quick fix for odd drawing behaviors when window is too small minWidth:100, minHeight:100, // Internal // --------------------------------------------------------------------------------------- useBackMask: isc.Browser.isIE && isc.Browser.minorVersion >= 5.5, // Modality // --------------------------------------------------------------------------------------- //> @attr window.isModal (boolean : false : [IRW]) // If true, when shown this Window will intercept and block events to all other existing // components on the page. // <P> // Use +link{showModalMask} to darken all other elements on the screen when a modal dialog // is showing. // <P> // Chained modal windows - that is, modal windows that launch other modal windows - are // allowed. You can accomplish this by simply creating a second modal Window while a modal // Window is showing. // <P> // Note only top-level Windows (Windows without parents) can be modal. // // @group modal // @visibility external // @example modality //< isModal : false, //> @attr window.modalMask (AutoChild : null : R) // A ScreenSpan instance used to darken the rest of a page when a modal window is // active. To use, set +link{window.showModalMask} to true, add a CSS style // "modalMask" to the active skin (generally with background-color set), // and adjust +link{window.modalMaskOpacity}. // @group modal, appearance // @visibility external //< //> @attr window.showModalMask (boolean : null : IR) // If true, displays a translucent mask over the rest of the page when a modal window // is displayed. // @group modal, appearance // @see window.modalMask // @visibility external //< //> @attr window.modalMaskOpacity (number : 50 : IR) // Controls the opacity of the modal mask displayed behind modal windows. // @group modal, appearance // @see window.modalMask // @visibility external //< modalMaskOpacity: 50, //> @attr window.modalMaskStyle (string : "modalMask" : IR) // Specifies the CSS style for the modal mask. // @group modal, appearance // @see window.modalMask // @visibility external //< modalMaskStyle: "modalMask", modalMaskConstructor: "ScreenSpan", //> @attr window.autoCenter (boolean : autoCenter : [IRW]) // If true, this Window widget will automatically be centered on the page when shown. // If false, it will show up in the last position it was placed (either programatically, // or by user interaction). // @group appearance, location // @visibility external //< //autoCenter : false, // Dismissal // --------------------------------------------------------------------------------------- //> @attr window.dismissOnOutsideClick (boolean : false : [IRW]) // If true, a click outside the bounds of the Window will have the same effect as // pressing its cancel button.<br> // <b>Note:</b> Applies only to modal windows. // @visibility external // @group modal // @see isModal //< dismissOnOutsideClick:false, //> @attr window.dismissOnEscape (boolean : null : [IRW]) // Should this window be dismissed (same effect as pressing the "Cancel" button) when the // user presses the "Escape" key?<br> // If unset default behavior depends on whether a close / cancel button is visible for // this item. // @visibility external // @see window.shouldDismissOnEscape() //< //dismissOnEscape:null, // Body // ---------------------------------------------------------------------------------------- //> @attr window.body (AutoChild : null : R) // Body of the Window, where +link{items,contained components} or +link{src,loaded content} // is shown. // @visibility external //< //> @attr window.showBody (boolean : true : IRWA) // If true, draw the body contents when this Window is drawn. // @visibility external // @group appearance, body //< showBody:true, //> @attr window.bodyStyle (string : "windowBody" : [IRW]) // Style of the Window body. // @visibility external // @group appearance, body //< bodyStyle:"windowBody", //> @attr window.bodyColor (string : "#FFFFFF" : [IRW]) // Color of the Window body. Overrides the background color specified in the style. // @visibility external // @group appearance, body // @see flash() //< bodyColor:"#FFFFFF", //> @attr window.hiliteBodyColor (string : "#EEEEEE" : [IRW]) // Highlight color for the Window body (shown when the body is flashed). // @visibility external // @group appearance, body // @see flash() //< hiliteBodyColor:"#EEEEEE", //> @attr window.items (Array of Canvas, Canvas or String : null : [IR]) // The contents of the Window body. Can be specified three different ways: // <ul><li>an Array of Canvases that will become the children of the Window's body when it // is initialized; the canvases in this array should be created, but not drawn (autodraw: // false). // <li>a single canvas that will become a child of the Window body. // <li>a string that will be set as the body's contents.</ul> // @see body // @visibility external // @group appearance, body //< //> @attr window.src (string : null : [IRW]) // A URL to load as content for the Window's body. If specified, this // attribute will take precedence over the items attribute. // <P> // Note that setting window.src is essentially a shortcut for setting +link{window.items} // to a single HTMLflow with a specified +link{htmlFlow.contentsURL,contentsURL}. // // @see window.contentsType // @group appearance, body // @visibility external //< //> @attr window.contentsType (string : "page" : IR) // If this window has +link{window.src} specified, this property can be used to indicate // whether the source is a standalone HTML page or an HTML fragment. // <P> // This is similar to the +link{htmlFlow.contentsType} property - be sure to read the // HTMLFlow documentation to understand circumstances where contentsType:"page" is // <b>unsafe and not recommended</b>. // // @see window.src // @visibility external // @group appearance, body //< contentsType:"page", //> @attr window.bodyConstructor (string : null : IRWA) // The name of the widget class (as a string) to use for the body. If unset the appropriate // constructor type will be determined as follows:<br> // - if +link{window.items} is defined as an array of widgets, and +link{window.contentLayout} // is not set to <code>"none"</code>, bodyConstructor defaults to a +link{class:VLayout}<br> // - if +link{window.src} is set, bodyConstructor defaults to an +link{class:HTMLFlow}<br> // - otherwise bodyConstructor will default to a simple +link{class:Canvas}<br> // Note that if this property is overridden for some window, the specified constructor // should be a subclass of one of these defaults to ensure the window renders out as // expected. // // @group appearance, body // @visibility external //< //> @attr window.bodyDefaults (object : ... : IRWA) // Default properties for the body of the Window<br> // You can change the class-level bodyDefaults for all Windows by changing this item // or set instance.body to be another object of properties to override for your instance only // @group appearance, body // @visibility external //< bodyDefaults:{ layoutMargin:0 }, // Layout // ---------------------------------------------------------------------------------------------- //> @attr window.contentLayout (string : "vertical" : [IRWA]) // The layout policy that should be used for widgets within the Window body. // <P> // Valid values are "vertical", "horizontal", "none". If the body is a Layout, this // controls +link{layout.orientation}. See +link{bodyConstructor} for details. // // @visibility external // @group appearance //< contentLayout:"vertical",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -