📄 core.js
字号:
{if(!bVisible&&this.getContainsFocus())
this.setFocused(false);this._visible=bVisible;this.setStyleProperty("visibility",bVisible?"inherit":"hidden");if(this._lazyCreate&&!this._created&&bVisible)
{var p=this.getParent();if(p&&p._created)
this._addHtmlElementToParent(p,this.getNextSibling(),true);}};_p.getVisible=function(){return this.getStyleProperty("visibility")!="hidden";};_p.getIsVisible=function(){if(!this.getVisible())return false;var p=this._parent;return p!=null&&p.getIsVisible();};_p.setCursor=function(sCursor){if(!sCursor){this.removeStyleProperty("cursor");}
else{this.setStyleProperty("cursor",BiBrowserCheck.ie55&&sCursor=="pointer"?"hand":sCursor);}};_p.getCursor=function(){var c=this.getStyleProperty("cursor");return c=="hand"?"pointer":(c||"");};_p.setBackgroundImage=function(oUri)
{if(oUri==null||oUri=="")
{this.removeStyleProperty("backgroundImage");}
else {var uri;if(oUri instanceof BiUri)
uri=oUri;else uri=new BiUri(application.getAdfPath(),oUri);this.setStyleProperty("backgroundImage","url("+uri+")");}};_p.getBackgroundImage=function()
{var s=this.getStyleProperty("backgroundImage");if(s==null||s==""||s=="none")
return null;return new BiUri(s.match(/^url\((.+)\)$/i)[1]);};_p.setOpacity=function(n){if(this._opacity!=n){n=Math.max(0,Math.min(1,n));this._opacity=n;if(BiBrowserCheck.ie)
{n=Math.round(n*100);if(n==100)
this.removeStyleProperty("filter");else this.setStyleProperty("filter","Alpha(Opacity="+n+")");}
else {if(n==1)
this.removeStyleProperty("MozOpacity");else this.setStyleProperty("MozOpacity",n);}}};BiComponent.prototype.getOpacity=function(){return this._opacity;};_p.setLeft=function(nLeft)
{if(this._left!=nLeft)
{this._left=nLeft;this.invalidateParentLayout("size");}};_p.setRight=function(nRight)
{if(this._right!=nRight)
{this._right=nRight;this.invalidateParentLayout("size");}};_p.setTop=function(nTop)
{if(this._top!=nTop)
{this._top=nTop;this.invalidateParentLayout("size");}};_p.setBottom=function(nBottom)
{if(this._bottom!=nBottom)
{this._bottom=nBottom;this.invalidateParentLayout("size");}};_p.setWidth=function(nWidth)
{if(this._width!=nWidth)
{this._width=nWidth;this.invalidateParentLayout("size");}};_p.setHeight=function(nHeight)
{if(this._height!=nHeight)
{this._height=nHeight;this.invalidateParentLayout("size");}};_p.setSize=function(nWidth,nHeight)
{if(this._width!=nWidth||this._height!=nHeight)
{this._width=nWidth;this._height=nHeight;this.invalidateParentLayout("size");}};_p.setLocation=function(nLeft,nTop)
{if(this._left!=nLeft||this._top!=nTop)
{this._left=nLeft;this._top=nTop;this.invalidateParentLayout("size");}};_p.setBounds=function(nLeft,nTop,nWidth,nHeight)
{if(this._left!=nLeft||this._top!=nTop||this._width!=nWidth||this._height!=nHeight)
{this._left=nLeft;this._top=nTop;this._width=nWidth;this._height=nHeight;this.invalidateParentLayout("size");}};_p.invalidateParentLayout=function(sHint)
{this._invalidBoundaries=true;var p=this._parent;if(p)
p.invalidateChild(this,sHint);};_p.invalidateLayout=function()
{this._invalidLayout=true;if(this._created)
BiComponent.enqueueLayout(this);};_p.invalidateChild=function(oChild,sHint)
{if(sHint==null||sHint=="size")
this._invalidateChild(oChild,sHint);};_p._invalidateChild=function(oChild,sHint)
{if(!oChild._invalidBoundaries)
{oChild._invalidBoundaries=true;oChild.invalidateParentLayout(sHint);}
oChild._invalidBoundaries=true;if(oChild._created)
BiComponent.enqueueLayout(oChild);};_p._invalidBoundaries=true;_p._invalidLayout=false;BiComponent._layoutQueue={};BiComponent._inFlushLayoutQueue=false;BiComponent._inFlushLayoutComponent=false;BiComponent.enqueueLayout=function(c)
{var hc=c.toHashCode();if(hc in this._layoutQueue)
return;this._layoutQueue[hc]=c;};BiComponent.flushLayoutQueue=function()
{if(this._inFlushLayoutQueue||this._inFlushLayoutComponent)
return;this._inFlushLayoutQueue=true;var c,ks,vs;while(!Object.isEmpty(this._layoutQueue))
{ks=Object.getKeys(this._layoutQueue);vs=Object.getValues(this._layoutQueue);for(var i=0;i<ks.length;i++)
{this.flushLayoutComponent(vs[i]);delete this._layoutQueue[ks[i]];}}
this._inFlushLayoutQueue=false;};BiComponent.flushLayoutComponent=function(c)
{if(this._inFlushLayoutComponent)
return;this._inFlushLayoutComponent=true;var hc;var cs=[];while(c)
{hc=c.toHashCode();if(hc in this._layoutQueue)
cs.push(c);c=c._parent;}
for(var i=cs.length-1;i>=0;i--)
{c=cs[i];hc=c.toHashCode();delete this._layoutQueue[hc];if(c.getDisposed())
continue;if(c._invalidBoundaries)
c.layoutComponent();if(c._invalidLayout)
c.layoutAllChildren();}
this._inFlushLayoutComponent=false;};_p.layoutComponent=function()
{var p;if(this._created&&(p=this._parent))
{p.layoutChild(this);}};_p.layoutChild=function(oChild)
{var sizeChanged=this._layoutChild(oChild);if(sizeChanged)
oChild.invalidateLayout();};_p.layoutChildX=function(oChild)
{};_p.layoutChildY=function(oChild)
{};_p.layoutAllChildren=function()
{var cs=this._children;var l=cs.length;for(var i=0;i<l;i++)
{cs[i].layoutComponent();}
this._invalidLayout=false;};_p.layoutAllChildrenX=function()
{};_p.layoutAllChildrenY=function()
{};_p._layoutChild=function(oChild)
{var x,y,w,h;var cw,ch;if(oChild._left!=null)
{x=oChild._left;if(oChild._right!=null)
{cw=this.getClientWidth();w=cw-oChild._left-oChild._right;}
else if(oChild._width!=null)
{w=oChild._width;}}
else if(oChild._right!=null)
{if(oChild._width!=null)
w=oChild._width;else {oChild.removeStyleProperty("width");if(BiBrowserCheck.ie&&oChild._measuredHeight==0)
{oChild._element.runtimeStyle.display="";}
w=oChild.getWidth();}
cw=this.getClientWidth();x=cw-w-oChild._right;}
else if(oChild._width!=null)
{w=oChild._width;}
if(oChild._top!=null)
{y=oChild._top;if(oChild._bottom!=null)
{ch=this.getClientHeight();h=ch-oChild._top-oChild._bottom;}
else if(oChild._height!=null)
{h=oChild._height;}}
else if(oChild._bottom!=null)
{h;if(oChild._height!=null)
h=oChild._height;else {oChild.removeStyleProperty("height");if(BiBrowserCheck.ie&&oChild._measuredHeight==0)
{oChild._element.runtimeStyle.display="";}
h=oChild.getHeight();}
ch=this.getClientHeight();y=ch-h-oChild._bottom;}
else if(oChild._height!=null)
{h=oChild._height;}
return this._layoutChild2(oChild,x,y,w,h);};if(BiBrowserCheck.ie)
{_p._layoutChild2=function(c,x,y,w,h,bInvalidate)
{if(x!=null)
c.setStyleProperty("pixelLeft",x);if(y!=null)
c.setStyleProperty("pixelTop",y);if(w!=null)
c.setStyleProperty("pixelWidth",w);if(h!=null)
c.setStyleProperty("pixelHeight",h);var wChanged=false;var hChanged=false;if(w!=null)
{wChanged=w!=c._measuredWidth;c._measuredWidth=w;}
if(h!=null)
{hChanged=h!=c._measuredHeight;if(hChanged)
c._element.runtimeStyle.display=h==0?"none":"";c._measuredHeight=h;}
c._invalidBoundaries=false;if(wChanged||hChanged)
{c.dispatchEvent(new BiEvent("resize"));if(bInvalidate)
{c.invalidateLayout();}
return true;}
return false;};}
else {_p._layoutChild2=function(c,x,y,w,h,bInvalidate)
{if(x!=null)
c.setStyleProperty("left",x+"px");if(y!=null)
c.setStyleProperty("top",y+"px");if(w!=null)
c.setStyleProperty("width",w+"px");if(h!=null)
c.setStyleProperty("height",h+"px");var wChanged=false;var hChanged=false;if(w!=null)
{wChanged=w!=c._measuredWidth;c._measuredWidth=w;}
if(h!=null)
{hChanged=h!=c._measuredHeight;c._measuredHeight=h;}
c._invalidBoundaries=false;if(wChanged||hChanged)
{c.dispatchEvent(new BiEvent("resize"));if(bInvalidate)
{c.invalidateLayout();}
return true;}
return false;};}
_p.getLeft=function()
{if(this._created)
{BiComponent.flushLayoutComponent(this);return this._element.offsetLeft;}
return this._left;};_p.getRight=function()
{if(this._created&&this._parent)
{BiComponent.flushLayoutComponent(this);return this._parent.getClientWidth()-this.getLeft()-this.getWidth();}
return this._right;};_p.getTop=function()
{if(this._created)
{BiComponent.flushLayoutComponent(this);return this._element.offsetTop;}
return this._top;};_p.getBottom=function()
{if(this._created&&this._parent)
{BiComponent.flushLayoutComponent(this);return this._parent.getClientHeight()-this.getTop()-this.getHeight();}
return this._bottom;};_p.getWidth=function()
{if(this._created)
{BiComponent.flushLayoutComponent(this);return this._element.offsetWidth;}
return this._width;};_p.getHeight=function()
{if(this._created)
{BiComponent.flushLayoutComponent(this);return this._element.offsetHeight;}
return this._height;};if(BiBrowserCheck.moz)
{_p.getWidth=function()
{if(this._created)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -