📄 coreclasses.js
字号:
}};_p.setOverflowY = function(sOverflowY){ if (BiBrowserCheck.ie) this.setStyleProperty("overflowY", sOverflowY); else { var s; this._overflowY = sOverflowY; if (this._overflowX == "hidden" && this._overflowY == "hidden") s = "-moz-scrollbars-none"; else if (this._overflowX == this._overflowY) s = sOverflowX; else if (this._overflowX == "scroll" || this._overflowY == "scroll") s = "scroll"; else if (this._overflowX == "auto" || this._overflowY == "auto") s = "auto"; else if (this._overflowX == "hidden" && this._overflowY == "scroll") s = "-moz-scrollbars-vertical"; else s = "-moz-scrollbars-horizontal"; this.setStyleProperty("overflow", s); }};_p.getOverflowX = function(){ if (BiBrowserCheck.ie) return this.getStyleProperty("overflowX"); else { var s = this.getStyleProperty("overflow"); if (s == "-moz-scrollbars-horizontal") return "scroll"; else if (s == "-moz-scrollbars-vertical" || s == "-moz-scrollbars-none") return "hidden"; else return s; }};_p.getOverflowY = function(){ if (BiBrowserCheck.ie) return this.getStyleProperty("overflowY"); else { var s = this.getStyleProperty("overflow"); if (s == "-moz-scrollbars-vertical") return "scroll"; else if (s == "-moz-scrollbars-horizontal" || s == "-moz-scrollbars-none") return "hidden"; else return s; }};_p.setScrollLeft = function(nScrollLeft){ if (!this._created) throw new Error("Visual property on non created component"); this._element.scrollLeft = nScrollLeft;};_p.setScrollTop = function(nScrollTop){ if (!this._created) throw new Error("Visual property on non created component"); this._element.scrollTop = nScrollTop;};_p.getScrollLeft = function(){ if (!this._created) throw new Error("Visual property on non created component"); return this._element.scrollLeft;};_p.getScrollTop = function(){ if (!this._created) throw new Error("Visual property on non created component"); return this._element.scrollTop;};_p.getScrollWidth = function(){ if (!this._created) throw new Error("Visual property on non created component"); if (( new BiBrowserCheck).getIe55()) { var max = this._element.scrollWidth; var cs = this._children; var l = cs.length; for (var i = 0; i < l; i++) max = Math.max(max, cs[i].getLeft() + cs[i].getWidth()); return max; } else return this._element.scrollWidth;};_p.getScrollHeight = function(){ if (!this._created) throw new Error("Visual property on non created component"); if (( new BiBrowserCheck).getIe55()) { var max = this._element.scrollHeight; var cs = this._children; var l = cs.length; for (var i = 0; i < l; i++) max = Math.max(max, cs[i].getTop() + cs[i].getHeight()); return max; } else return this._element.scrollHeight;};_p.scrollIntoView = function(bTopLeft){ this.scrollIntoViewX(bTopLeft); this.scrollIntoViewY(bTopLeft);};_p.scrollIntoViewX = function(bLeft){ if (!this._created) { return; } var p = this._parent; if (!p) return; var l = this.getLeft(); var w = this.getWidth(); var sl = p.getScrollLeft(); var cw = p.getClientWidth(); if (bLeft) p.setScrollLeft(l); else if (bLeft == false) p.setScrollLeft(l + w - cw); else if (w > cw || l < sl) p.setScrollLeft(l); else if (l + w > sl + cw) p.setScrollLeft(l + w - cw);};_p.scrollIntoViewY = function(bTop){ if (!this._created) { return; } var p = this._parent; if (!p) return; var t = this.getTop(); var h = this.getHeight(); var st = p.getScrollTop(); var ch = p.getClientHeight(); if (bTop) p.setScrollTop(t); else if (bTop == false) p.setScrollTop(t + h - ch); else if (h > ch || t < st) p.setScrollTop(t); else if (t + h > st + ch) p.setScrollTop(t + h - ch);};_p.setTabIndex = function(nTabIndex){ this._tabIndex = nTabIndex; if (BiBrowserCheck.ie) { this.setHtmlProperty("unselectable", nTabIndex < 0 || !this._enabled); this.setHtmlProperty("tabIndex", nTabIndex < 0 ? -1 : 1); } else { this.setStyleProperty("MozUserFocus", nTabIndex < 0 ? "ignore" : "normal"); }};_p.getTabIndex = function(){ return this._tabIndex;} ;_p.setHideFocus = function(bHideFocus){ this._hideFocus = bHideFocus; if (BiBrowserCheck.ie) this.setHtmlProperty("hideFocus", bHideFocus); else { if (bHideFocus) this.setStyleProperty("MozOutline", "none"); else this.removeStyleProperty("MozOutline"); }};_p.getHideFocus = function(){ return this._hideFocus;} ;_p._focusComponent = function(){ if (BiBrowserCheck.ie) this._element.focus(); else { if (this._element.focus) { try { this._element.focus(); } catch (ex) { } } else { this.getTopLevelComponent()._eventManager._mozOnFocus(null, this, this._element); } }};_p._blurComponent = function(){ if (this.getDisposed()) return; if (BiBrowserCheck.ie) { this._element.blur(); } else { if (this._element.blur) { try { this._element.blur(); } catch (ex) { } } else { this.getTopLevelComponent()._eventManager._mozOnBlur(null, this, this._element); } }};_p.setFocused = function(bFocused){ if (bFocused && !this.getCanFocus()) throw new Error("Cannot set focus to component"); if (this._focused != bFocused) { if (bFocused) this._focusComponent(); else { this.getTopLevelComponent()._eventManager._setFocusedComponent(null); this._blurComponent(); } }};BiComponent.prototype.getFocused = function(){ return this._focused;} ;_p.getContainsFocus = function(){ var fr = this.getFocusRoot(); if (fr) return this.contains(fr.getActiveComponent()); return false;};_p.getCanFocus = function(){ return this._created && this.getTabIndex() >= 0 && this.getIsEnabled() && this.getIsVisible();} ;_p.getFocusRoot = function(){ if (this._parent) return this._parent.getFocusRoot(); return null;};_p.getActiveComponent = function(){ var fr = this.getFocusRoot(); if (fr) return fr.getActiveComponent(); return null;};_p.isFocusRoot = function(){ return false;} ;BiComponent.prototype.getFocusManager = function(){ return this._focusManager;} ;BiComponent.prototype.setFocusManager = function(v){ this._focusManager = v;} ;_p.setCanSelect = function(bCanSelect){ this._canSelect = bCanSelect; if (BiBrowserCheck.ie) { if (bCanSelect) this.removeHtmlProperty("unselectable"); else this.setHtmlProperty("unselectable", "on"); } else { if (bCanSelect) this.removeStyleProperty("MozUserSelect"); else this.setStyleProperty("MozUserSelect", "none"); }};BiComponent.prototype.getCanSelect = function(){ return this._canSelect;} ;_p.setEnabled = function(bEnabled){ if (this._enabled != bEnabled) { if (this.getTabIndex() >= 0) { if (BiBrowserCheck.ie) { if (!bEnabled || !this._canSelect) this.setHtmlProperty("unselectable", "on"); else this.removeHtmlProperty("unselectable"); } if (this.getFocused() && !bEnabled) { this.setFocused(false); } } this._enabled = bEnabled; this.setHtmlProperty("disabled", !bEnabled); if (BiBrowserCheck.moz) { if (bEnabled) this._removeHtmlAttribute("disabled"); else this._setHtmlAttribute("disabled", "true"); } this.dispatchEvent(new BiEvent("enabledchanged")); var tlc; if (bEnabled && this.getCanFocus() && (tlc = this.getTopLevelComponent()) && tlc.getActiveComponent() == this) { this.setFocused(true); } }};BiComponent.prototype.getEnabled = function(){ return this._enabled;} ;_p.getIsEnabled = function(){ if (!this.getEnabled()) return false; var p = this.getParent(); if (p) return p.getIsEnabled(); return true;};_p.setCapture = function(bCapture){ if (this._created) { this._element.onlosecapture = BiComponent.__oninlineevent; this._capture = bCapture; if (bCapture) { if (BiBrowserCheck.ie) this._element.setCapture(); this.getTopLevelComponent()._eventManager.setCaptureComponent(this); } else { if (BiBrowserCheck.ie) this._element.releaseCapture(); else this.getTopLevelComponent()._eventManager.setCaptureComponent(null); } }};BiComponent.prototype.getCapture = function(){ return this._capture;} ;_p.setAccessKey = function(sAccessKey){ this.setHtmlProperty("accessKey", sAccessKey);} ;_p.getAccessKey = function(){ return this.getHtmlProperty("accessKey");} ;BiComponent.prototype.getContextMenu = function(){ return this._contextMenu;} ;BiComponent.prototype.setContextMenu = function(v){ this._contextMenu = v;} ;BiComponent.prototype.getName = function(){ return this._name;} ;BiComponent.prototype.setName = function(v){ this._name = v;} ;BiComponent.prototype.setToolTip = function(v){ this._toolTip = v;} ;BiComponent.prototype.getToolTipText = function(){ return this._toolTipText;} ;BiComponent.prototype.setToolTipText = function(v){ this._toolTipText = v;} ;_p.getToolTip = function(){ if (this._toolTip != null) return this._toolTip; if (this._toolTipText != null) return BiToolTip.getTextToolTip(this._toolTipText); return null;};_p.setRightToLeft = function(b){ if (b == true) this.setStyleProperty("direction", "rtl"); else if (b == false) this.setStyleProperty("direction", "ltr"); else this.removeStyleProperty("direction");};_p.getRightToLeft = function(){ var v = this.getStyleProperty("direction"); if (v == null && this._parent) return this._parent.getRightToLeft(); return v == "rtl";};BiComponent.prototype.getCreated = function(){ return this._created;} ;BiComponent._createEvent = new BiEvent("create");_p._create = function(oDocument){ this._document = oDocument || document; var el = this._element = this._document.createElement(this._tagName); el._biComponent = this; this._setHtmlProperties(); this._setCssProperties(); if (BiBrowserCheck.ie) el.onscroll = el.onresize = BiComponent.__oninlineevent; else { this._setHtmlAttributes(); el.onscroll = el.onfocus = BiComponent.__oninlineevent; }};_p._createChildren = function(oDocument, bLayout){ var cs = this._children; var l = cs.length; for (var i = 0; i < l; i++) { cs[i]._addHtmlElementToParent(this, null, bLayout); }};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -