📄 tab.js
字号:
/* * Copyright (c) 2001-2007, TIBCO Software Inc. * Use, modification, and distribution subject to terms of license. */jsx3.require("jsx3.gui.Block");jsx3.Class.defineClass("jsx3.gui.Tab",jsx3.gui.Block,null,function(p,d){var Kc=jsx3.gui.Event;var Sb=jsx3.gui.Interactive;p.DEFAULTBEVELIMAGE=jsx3.resolveURI("jsx:///images/tab/bevel.gif");p.DEFAULTACTIVECOLOR="#e8e8f5";p.DEFAULTINACTIVECOLOR="#d8d8e5";p.DEFAULTHIGHLIGHT="#f6f6ff";p.DEFAULTSHADOW="#a6a6af";p.ACTIVEBEVEL=jsx3.resolveURI("jsx:///images/tab/on.gif");p.INACTIVEBEVEL=jsx3.resolveURI("jsx:///images/tab/off.gif");jsx3.html.loadImages(p.DEFAULTBEVELIMAGE,p.ACTIVEBEVEL,p.INACTIVEBEVEL);p.CHILDBGCOLOR="#e8e8f5";p.STATEDISABLED=0;p.STATEENABLED=1;d.init=function(i,j,g,m,l){this.jsxsuper(i,null,null,g,null,j);if(m!=null)this.setActiveColor(m);if(l!=null)this.setInactiveColor(l);var fb=new jsx3.gui.Block(i+"_content",null,null,"100%","100%");fb.setOverflow(jsx3.gui.Block.OVERFLOWSCROLL);fb.setRelativePosition(0);fb.setBackgroundColor(m==null?p.CHILDBGCOLOR:m);this.setChild(fb,jsx3.app.Model.PERSISTEMBED,null,jsx3.app.Model.FRAGMENTNS);};d.onSetParent=function(c){return jsx3.gui.TabbedPane&&c instanceof jsx3.gui.TabbedPane;};d.getBevel=function(){return this.jsxbevel;};d.setBevel=function(h){this.jsxbevel=h;return this;};d.getMaskProperties=function(){return jsx3.gui.Block.MASK_EAST_ONLY;};d.CL=function(a,l){l.style.backgroundImage="url("+p.ACTIVEBEVEL+")";if(jsx3.EventHelp.isDragging())this.Rx(a,false);};d.u2=function(j,c){c.style.backgroundImage="url("+p.INACTIVEBEVEL+")";};d.IU=function(l,a){a.focus();if(l.leftButton())this.Rx(l);};d.doClickTab=function(s,k){this.Rx(this.isOldEventProtocol(),k);};d.doShow=function(){this.Rx(false);};d.Rx=function(j,c){this.getParent().Bv(j,this);};d.getActiveColor=function(){return this.jsxactivecolor;};d.setActiveColor=function(f){this.jsxactivecolor=f;return this;};d.getInactiveColor=function(){return this.jsxinactivecolor;};d.setInactiveColor=function(m){this.jsxinactivecolor=m;return this;};d.getEnabled=function(){return this.jsxenabled==null?p.STATEENABLED:this.jsxenabled;};d.setEnabled=function(a){this.jsxenabled=a;return this;};d.DY=function(j,c){if(this.jsxsupermix(j,c))return;var Bc=j.keyCode();var Xb=this.getChildIndex();var kb=this.getParent();if(Bc>=Kc.KEY_ARROW_LEFT&&Bc<=Kc.KEY_ARROW_DOWN){if(j.leftArrow()||j.upArrow()){var M=Xb>0?Xb-1:kb.getChildren().length-1;}else{if(j.rightArrow()||j.downArrow()){var M=Xb<kb.getChildren().length-1?Xb+1:0;}}kb.Bv(j,M,null,true);j.cancelAll();}else{if(Bc==Kc.KEY_TAB&&!j.shiftKey()){this.getContentChild().focus();j.cancelAll();}else{if(Bc==Kc.KEY_TAB){this.getParent().focus();}}}};p.s5={};p.s5[Kc.CLICK]=true;p.s5[Kc.KEYDOWN]=true;p.s5[Kc.MOUSEOVER]=true;p.s5[Kc.MOUSEOUT]=true;d.IO=function(e){return this.getParent()?this.getParent().Ru(this):{};};d.k7=function(q,a,n){this.B_(q,a,n,3);};d.T5=function(q){if(q==null||isNaN(q.parentwidth)||isNaN(q.parentheight)){q=this.getParent().IO(this);}else{if(q==null){q={};}}var Vb=this.getPadding();if(this.getWidth()!=null&&!isNaN(parseInt(this.getWidth())))q.width=this.getWidth();q.height="100%";q.tagname="span";q.boxtype="relativebox";q.padding=Vb!=null&&Vb!=""?Vb:"3 4 1 4";q.border="solid 0px;solid 2px #9898a5;solid 0px;solid 1px "+p.DEFAULTHIGHLIGHT;var u=new jsx3.gui.Painted.Box(q);var Bc={};Bc.parentwidth=u.XK();Bc.parentheight=u.P5();Bc.height="100%";if(!(this.getWidth()==null||isNaN(this.getWidth()))){Bc.width="100%";Bc.tagname="div";Bc.boxtype="inline";}else{Bc.tagname="span";Bc.boxtype="relativebox";}var Ac=new jsx3.gui.Painted.Box(Bc);u.W8(Ac);return u;};d.paint=function(){if(!(this.getParent() instanceof jsx3.gui.TabbedPane)){jsx3.util.Logger.doLog("t21","The jsx3.gui.Tab instance with the id, '"+this.getId()+"', could not be painted on-screen, because it does not belong to a jsx3.gui.TabbedPane parent.");return "";}this.applyDynamicProperties();var pc=this.getEnabled()==p.STATEENABLED?this.lM(p.s5,0):"";var L=this.renderAttributes(null,true);var B=this.RL(true);B.setAttributes("id=\""+this.getId()+"\" label=\""+this.getName()+"\" "+this.CI()+this.vH()+pc+" class=\"jsx30tab\" "+L);B.setStyles(this.f7()+this.I6()+this.UZ()+this.QP()+this.oY()+this.g0()+this.D6()+this.eQ()+this.iN());var D=B.pQ(0);D.setAttributes(" class=\"jsx30tab_text\" unselectable=\"on\" ");D.setStyles(this.eQ());return B.paint().join(D.paint().join(this.AN()));};d.setWidth=function(n,l){this.jsxsuper(n);if(l)this.repaint();};d.f7=function(){return "background-image:url("+p.INACTIVEBEVEL+");background-repeat:repeat-x;background-position:top left;";};d.I6=function(){return this.getEnabled()==p.STATEENABLED?"cursor:pointer;":"cursor:not-allowed;";};d.CI=function(){return this.jsxsuper(this.getIndex()||Number(0));};d.C3=function(){return this.getActiveColor()?this.getActiveColor():p.DEFAULTACTIVECOLOR;};d.m_=function(){return this.getInactiveColor()?this.getInactiveColor():p.DEFAULTINACTIVECOLOR;};d.UZ=function(){var Ob=this.getChildIndex()!=this.getParent().getSelectedIndex()?this.m_():this.C3();return Ob?"background-color:"+Ob+";":"";};p.getVersion=function(){return "3.0.00";};d.getContentChild=function(){return this.getChild(0);};d.vO=function(f){var wb=this.getContentChild();if(wb)wb.vO(f);this.jsxsuper(f);};});jsx3.Tab=jsx3.gui.Tab;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -