⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gui1.js

📁 ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.
💻 JS
📖 第 1 页 / 共 5 页
字号:
else {if(!this._created)
throw new Error("Visual property on non created component");return this._element.selectionEnd-this._element.selectionStart;}};_p.setSelectionText=function(sText)
{if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
{var r=this._getSelectionRange();if(!this._element.contains(r.parentElement()))
return;var r2=r.duplicate();r.text=sText;r.setEndPoint("StartToStart",r2);r.select();}
else {var s=this._element.value;var selStart=this._element.selectionStart;var before=s.substr(0,selStart);var after=s.substr(this._element.selectionEnd);this._element.value=before+sText+after;this._element.selectionStart=selStart;this.setSelectionLength(sText.length);}};_p.getSelectionText=function(){if(BiBrowserCheck.ie)
{var sr=this._getSelectionRange();if(!this._element.contains(sr.parentElement()))
return"";return sr.text;}
else {if(!this._created)
throw new Error("Visual property on non created component");return this._element.value.substr(this.getSelectionStart(),this.getSelectionLength());}};_p._getRange=function(){if(!this._created)
throw new Error("Visual property on non created component");return this._element.createTextRange();};_p._getSelectionRange=function(){if(!this._created)
throw new Error("Visual property on non created component");return this._document.selection.createRange();};_p.selectAll=function(){if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.moz){this.setSelectionStart(0);this.setSelectionLength(this.getText().length);}
this._element.select();};_p._selectOnTabFocus=function(){this.selectAll();};_p._deselectOnTabBlur=function(){if(BiBrowserCheck.ie)
{var sr=this._getSelectionRange();if(!this._element.contains(sr.parentElement()))
return;sr.collapse();sr.select();}
else {}};_p._preferredWidth=143;_p._preferredHeight=22;_p.getPreferredWidth=function()
{if(this._preferredWidth!=null)
return this._preferredWidth;if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
{var r=this._getRange();var bcr=r.getBoundingClientRect();return bcr.right-bcr.left+this.getInsetLeft()+this.getPaddingLeft()+this.getInsetRight()+this.getPaddingRight();}
else {return this._element.offsetWidth;}};_p.getPreferredHeight=function()
{if(this._preferredHeight!=null)
return this._preferredHeight;if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
{var r=this._getRange();var bcr=r.getBoundingClientRect();return bcr.bottom-bcr.top+this.getInsetTop()+this.getPaddingTop()+this.getInsetBottom()+this.getPaddingBottom();}
else {return this._element.offsetHeight;}};_p._allowTab=false;BiTextField.prototype.getAllowTab=function(){return this._allowTab;};BiTextField.prototype.setAllowTab=function(v){this._allowTab=v;};_p.setPadding=function(nLeft,nRight,nTop,nBottom){if(arguments.length==1){nRight=nTop=nBottom=nLeft;}
else if(arguments.length==2){nTop=nBottom=nRight
nRight=nLeft;}
this.setPaddingLeft(nLeft);this.setPaddingRight(nRight);this.setPaddingTop(nTop);this.setPaddingBottom(nBottom);};_p.setPaddingLeft=function(nPaddingLeft){this.setStyleProperty("paddingLeft",nPaddingLeft+"px");};_p.getPaddingLeft=function(){return parseInt(this.getStyleProperty("paddingLeft"));};_p.setPaddingRight=function(nPaddingRight){this.setStyleProperty("paddingRight",nPaddingRight+"px");};_p.getPaddingRight=function(){return parseInt(this.getStyleProperty("paddingRight"));};_p.setPaddingTop=function(nPaddingTop){this.setStyleProperty("paddingTop",nPaddingTop+"px");};_p.getPaddingTop=function(){return parseInt(this.getStyleProperty("paddingTop"));};_p.setPaddingBottom=function(nPaddingBottom){this.setStyleProperty("paddingBottom",nPaddingBottom+"px");};_p.getPaddingBottom=function(){return parseInt(this.getStyleProperty("paddingBottom"));};_p.dispose=function(){if(this._disposed)return;if(this._element)
{if(BiBrowserCheck.moz)
this._element.removeEventListener("input",BiComponent.__oninlineevent,false);else this._element.onpropertychange=null;}
BiComponent.prototype.dispose.call(this);this._validator=null;this._invalidMessage=null;if(this._font)this._font.dispose();this._font=null;this._valueOnFocus=null;this._text=null;if(this._ieFirstInputTimer)
{this._ieFirstInputTimer.dispose();}
delete this._ieFirstInputTimer;delete this._ieFirstInputHack;};_p._create=function(oDocument){BiComponent.prototype._create.call(this,oDocument);if(BiBrowserCheck.moz)
this._element.addEventListener("input",BiComponent.__oninlineevent,false);else this._element.onpropertychange=BiComponent.__oninlineevent;};_p._oninlineevent=function(e)
{if(!e)
e=this._document.parentWindow.event;if(e.type=="propertychange"&&e.propertyName=="value"||e.type=="input")
{if(!this._ieFirstInputHack)
{this.dispatchEvent(new BiEvent("textchanged"));application.flushLayoutQueue();}}
else BiComponent.prototype._oninlineevent.call(this,e);};_p._onKeyPress=function(e){if(e.getKeyCode()==BiKeyboardEvent.ENTER&&!e.getAltKey())
{this.dispatchEvent(new BiEvent("action"));if(this._command)
this._command.execute();}
if(this._allowTab&&BiBrowserCheck.moz&&e.getKeyCode()==BiKeyboardEvent.TAB)
{e.preventDefault();}};_p._onKeyDown=function(e)
{if(this._allowTab&&e.getKeyCode()==BiKeyboardEvent.TAB)
{if(BiBrowserCheck.ie)
{this._getSelectionRange().text="\t";}
else {var el=this._element;var s=el.value;var selStart=el.selectionStart;var before=s.substr(0,selStart);var after=s.substr(el.selectionEnd);el.value=before+"\t"+after;el.selectionStart=el.selectionEnd=selStart+1;}
e.preventDefault();}};_p._onFocus=function(e){this._valueOnFocus=this.getText();};_p._onBlur=function(e){if(this.getText()!=this._valueOnFocus)
this.dispatchEvent(new BiEvent("change"));delete this._valueOnFocus;};_p._addHtmlElementToParent=function(oParent,oBefore,bLayout)
{BiComponent.prototype._addHtmlElementToParent.apply(this,arguments);if(BiBrowserCheck.ie&&!this._ieFirstInputHack)
{this._ieFirstInputHack=true;this._ieFirstInputTimer=new BiTimer(1);this._ieFirstInputTimer.addEventListener("tick",this._ieOnFirstInput,this);this._ieFirstInputTimer.start();}};_p._ieOnFirstInput=function(e)
{if(this._parent&&this.getCreated()&&this.getIsVisible())
{var r=this._getSelectionRange();this._element.value=this._text+".";this._element.value=this._text;if(r&&r.parentElement()==this._element)
{r.select();}
delete this._ieFirstInputHack;if(this._ieFirstInputTimer)
{this._ieFirstInputTimer.dispose();delete this._ieFirstInputTimer;}}};_p.addXmlNode=function(oNode,oXmlResourceParser)
{if(oNode.nodeType==3)
{this.setText(this.getText()+oNode.nodeValue);}
else BiComponent.prototype.addXmlNode.call(this,oNode,oXmlResourceParser);};_p.setAttribute=function(sName,sValue,oXmlResourceParser)
{switch(sName)
{case"font":if(sValue.charAt(0)=="#")
{sValue=sValue.substr(1);var f=oXmlResourceParser.getComponentById(sValue);this.setFont(f);}
else this.setFont(BiFont.fromString(sValue));break;case"padding":var parts=sValue.split(/\s+/);for(var i=0;i<parts.length;i++)
parts[i]=parseFloat(parts[i]);this.setPadding.apply(this,parts);break;default:BiComponent.prototype.setAttribute.apply(this,arguments);}};function BiPasswordField(sText)
{if(_biInPrototype)return;BiTextField.call(this,sText);this.setHtmlProperty("type","password");}
_p=_biExtend(BiPasswordField,BiTextField,"BiPasswordField");function BiTextArea(sText)
{if(_biInPrototype)return;BiTextField.call(this,sText);this.setOverflow("auto");this.removeHtmlProperty("type");this.setHeight(50);}
_p=_biExtend(BiTextArea,BiTextField,"BiTextArea");_p._tagName="TEXTAREA";_p._acceptsEnter=true;_p._acceptsEsc=false;_p._preferredWidth=182;_p._preferredHeight=38;_p.setWrap=function(bWrap){if(BiBrowserCheck.ie)
this.setHtmlProperty("wrap",bWrap?"soft":"off");else this.setStyleProperty("whiteSpace",bWrap?"normal":"nowrap");};_p.getWrap=function(){if(BiBrowserCheck.ie)
return this.setHtmlProperty("wrap")!="off";else return this.setStyleProperty("whiteSpace")=="normal";};_p._onKeyDown=function(e){if(e.getKeyCode()==BiKeyboardEvent.ESC)
e.preventDefault();BiTextField.prototype._onKeyDown.call(this,e);};_p.getSelectionStart=function()
{if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.ie)
{var r;var sr=this._getSelectionRange();if(!this._element.contains(sr.parentElement()))
return-1;r=sr.duplicate();r.moveToElementText(this._element);var r2=sr.duplicate();var backwards= -1;var l=sr.text.length;do{if(r2.compareEndPoints("StartToStart",r)==0){backwards=0;break;}
r2.moveStart("character",-1);backwards++;}while(r2.text.length==l);r.setEndPoint("EndToStart",sr);return r.text.length+backwards*2;}
else {return this._element.selectionStart;}};function BiGroupBox(sText)
{if(_biInPrototype)return;BiComponent.call(this);this.setAppearance("group-box");this._container=new BiComponent;this._container.setAppearance("group-box-container");this._container.getMinimumHeight=BiGroupBox._container_getMinimumHeight;this._headerLeft=new BiComponent;this._headerLeft.setAppearance("group-box-header-left");this._headerLeft.getPreferredHeight=BiGroupBox._header_getPreferredHeight;this._headerLeft.getMinimumWidth=BiGroupBox._header_getMinimumWidth;this._headerRight=new BiComponent;this._headerRight.setAppearance("group-box-header-right");this._headerRight.getPreferredHeight=BiGroupBox._header_getPreferredHeight;this._headerRight.getMinimumWidth=BiGroupBox._header_getMinimumWidth;BiComponent.prototype.add.call(this,this._headerLeft,null,true);BiComponent.prototype.add.call(this,this._headerRight,null,true);BiComponent.prototype.add.call(this,this._container,null,true);if(sText!=null)
this.setText(sText);}
_p=_biExtend(BiGroupBox,BiComponent,"BiGroupBox");_p._groupBoxTitle=null;_p._titlePosition="left";BiGroupBox._header_getPreferredHeight=function()
{if(this._preferredHeight!=null)
return this._preferredHeight;return application.getThemeManager().getDefaultTheme()
.getAppearanceProperty(this.getAppearance(),"preferredHeight")||2;};BiGroupBox._header_getMinimumWidth=function()
{if(this._minimumWidth!=null)
return this._minmumWidth;return application.getThemeManager().getDefaultTheme()
.getAppearanceProperty(this.getAppearance(),"minimumWidth")||7;};BiGroupBox._container_getMinimumHeight=function()
{if(this._minimumHeight!=null)
return this._minmumHeight;return application.getThemeManager().getDefaultTheme()
.getAppearanceProperty(this.getAppearance(),"minimumHeight")||2;};_p.getGroupBoxTitle=function()
{return this._groupBoxTitle;};_p.setGroupBoxTitle=function(oGroupBoxTitle)
{if(this._groupBoxTitle&&this._groupBoxTitle!=oGroupBoxTitle)
BiComponent.prototype.remove.call(this,this._groupBoxTitle);this._groupBoxTitle=oGroupBoxTitle;if(this._groupBoxTitle)
{BiComponent.prototype.add.call(this,this._groupBoxTitle,this._headerRight,true);this._groupBoxTitle.setTitlePosition(this._titlePosition);}
this.invalidateLayout();};BiGroupBox.prototype.getTitlePosition=function(){return this._titlePosition;};_p.setTitlePosition=function(s)
{if(s!=this._titlePosition)
{this._titlePosition=s;if(this._groupBoxTitle)
this._groupBoxTitle.setTitlePosition(this._titlePosition);this.invalidateLayout();}};_p.setText=function(sText)
{if(sText==null)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -