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

📄 gui1.js

📁 ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.
💻 JS
📖 第 1 页 / 共 5 页
字号:
/* * Bindows 1.5 * http://www.bindows.net/ * Copyright (c) 2003-2005 MB Technologies * * Bindows(tm) belongs to MB Technologies (Georgia, USA). All rights reserved. * You are not allowed to copy or modify this code. Commercial use requires * license. */function BiCommand()
{if(_biInPrototype)return;BiEventTarget.call(this);if(application&&application.getWindow&&application.getWindow())
application.getWindow().addCommand(this);}
_p=_biExtend(BiCommand,BiEventTarget,"BiCommand");_p._enabled=true;_p._checked=false;_p._userValue=null;_p._shortcut=null;_p._keyCode=null;_p._ownerWindow=null;BiCommand.prototype.getEnabled=function(){return this._enabled;};BiCommand.prototype.getChecked=function(){return this._checked;};BiCommand.prototype.getUserValue=function(){return this._userValue;};BiCommand.prototype.getShortcut=function(){return this._shortcut;};BiCommand.prototype.getKeyCode=function(){return this._keyCode;};BiCommand.prototype.setKeyCode=function(v){this._keyCode=v;};BiCommand.prototype.getOwnerWindow=function(){return this._ownerWindow;};_p.execute=function()
{return this.dispatchEvent(new BiEvent("execute"));};_p.setEnabled=function(b)
{if(this._enabled!=b)
{this._enabled=b;this.dispatchEvent(new BiEvent("enabledchanged"));}};_p.setChecked=function(b)
{if(this._checked!=b)
{this._checked=b;this.dispatchEvent(new BiEvent("checkedchanged"));}};_p.setUserValue=function(v)
{if(this._userValue!=v)
{this._userValue=v;this.dispatchEvent(new BiEvent("uservaluechanged"));}};_p.setShortcut=function(s)
{if(this._shortcut!=s)
{this._shortcut=s;if(s!=null)
{var a=String(s).toLowerCase().split(/[-+\s]+/);this._shortcutParts={};for(var i=0;i<a.length;i++)
this._shortcutParts[a[i]]=true;}
else this._shortcutParts=null;this.dispatchEvent(new BiEvent("shortcutchanged"));}};_p.matchesKeyboardEvent=function(e)
{if(!this._shortcut||this._shortcutParts.shift&&!e.getShiftKey()||this._shortcutParts.ctrl&&!e.getCtrlKey()||this._shortcutParts.alt&&!e.getAltKey())
{return false;}
var kc=e.getKeyCode();if(this._keyCode!=null&&kc==this._keyCode)
return true;var c=String.fromCharCode(kc).toLowerCase();if(this._shortcutParts[c])
return true;if(this._keyCode==null)
{for(var n in this._shortcutParts)
{if(n!="ctrl"&&n!="shift"&&n!="alt"&&n!="control"&&kc==BiKeyboardEvent[n.toUpperCase()])
{return true;}}}
return false;};_p.dispose=function()
{if(this.getDisposed())return;this._ownerWindow=null;BiEventTarget.prototype.dispose.call(this);};function BiButton(sText){if(_biInPrototype)return;BiLabel.call(this,sText);this.setTabIndex(1);this.addEventListener("click",this._onclick);this.setCanSelect(true);this.setCssClassName("bi-button");this.setAppearance("button");}
_p=_biExtend(BiButton,BiLabel,"BiButton");_p._tagName="BUTTON";_p._acceptsEnter=true;_p._minimumWidth=67;_p._minimumHeight=23;_p._onclick=function(){if(this.getIsEnabled())
{this.dispatchEvent(new BiEvent("action"));if(this._command)
this._command.execute();}};_p.getPreferredWidth=function()
{if(this._preferredWidth!=null)
return this._preferredWidth;if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.moz&&BiBrowserCheck.version<"1.7"&&this._tagName=="BUTTON")
{return this._element.scrollWidth;}
else {return BiLabel.prototype.getPreferredWidth.call(this);}};_p.getPreferredHeight=function()
{if(this._preferredHeight!=null)
return this._preferredHeight;if(!this._created)
throw new Error("Visual property on non created component");if(BiBrowserCheck.moz&&BiBrowserCheck.version<"1.7"&&this._tagName=="BUTTON")
{return this._element.scrollHeight;}
else {return BiLabel.prototype.getPreferredHeight.call(this);}};function BiRepeatButton(sText)
{if(_biInPrototype)return;BiButton.call(this,sText);this._timer=new BiTimer;this._timer.setInterval(this._interval);this._timer.addEventListener("tick",this._onTick,this);this.addEventListener("mousedown",this._onMouseDown);this.addEventListener("mouseup",this._onMouseUp);this.addEventListener("mouseover",this._onMouseOver);this.addEventListener("mouseout",this._onMouseOut);}
_p=_biExtend(BiRepeatButton,BiButton,"BiRepeatButton");_p._interval=100;_p._firstInterval=500;_p._firedAction=false;BiRepeatButton.prototype.getInterval=function(){return this._interval;};_p.setInterval=function(n)
{if(this._interval!=n)
{this._interval=n;this._timer.setInterval(n);}};BiRepeatButton.prototype.getFirstInterval=function(){return this._firstInterval;};BiRepeatButton.prototype.setFirstInterval=function(v){this._firstInterval=v;};_p._onMouseDown=function(e)
{if(e.getButton()!=BiMouseEvent.LEFT)
return;this._timer.setInterval(this._firstInterval);this._timer.start();};_p._onMouseOver=function(e)
{var tm=new BiThemeManager;var state=tm.getCurrentState(this);if(state.active){this._timer.setInterval(this._firstInterval);this._timer.start();}};_p._onMouseUp=function(e)
{this._timer.stop();if(!this._firedAction)
{this.dispatchEvent(new BiEvent("action"));if(this._command)
this._command.execute();}
this._firedAction=false;};_p._onMouseOut=function(e)
{};_p._onTick=function(e)
{var tm=new BiThemeManager;var state=tm.getCurrentState(this);if(!state.active)
{this._timer.stop();return;}
var bx=this.getClientLeft();var by=this.getClientTop();var ex=BiMouseEvent.getClientX();var ey=BiMouseEvent.getClientY();if(ex<bx||ex>bx+this.getWidth()||ey<by||ey>by+this.getHeight())
{tm.removeState(this,"hover");tm.removeState(this,"active");tm.applyAppearance(this);return;}
tm.addState(this,"hover");tm.applyAppearance(this);this._timer.stop();this._timer.setInterval(this._interval);this.dispatchEvent(new BiEvent("action"));if(this._command)
this._command.execute();this._firedAction=true;this._timer.start();};_p._onclick=function(e)
{if(e.getButton()!=BiMouseEvent.LEFT)
BiButton.prototype._onclick.call(this,e);};function BiCheckBox(sText,bChecked){if(_biInPrototype)return;BiLabel.call(this,sText);this._checkBoxId=this.getHtmlProperty("id")+"-check-box";this._checked=Boolean(bChecked);this.setHtmlProperty("htmlFor",this._checkBoxId);this.setTabIndex(1);this.addEventListener("click",this._onclick);this.addEventListener("keydown",this._onkeydown);this.addEventListener("keyup",this._onkeyup);}
_p=_biExtend(BiCheckBox,BiLabel,"BiCheckBox");_p._drawIcon=true;_p._iconTextGap=5;_p._acceptsEnter=true;_p._userValue=null;BiCheckBox.prototype.getUserValue=function(){return this._userValue;};_p.setUserValue=function(v)
{if(this._userValue!=v)
{this._userValue=v;if(this._command)
this._command.setUserValue(v);}};_p._getIconHtml=function()
{var marginSide,blockStyle="";switch(this._iconPosition)
{case"right":marginSide="left";break;case"top":marginSide="bottom";blockStyle="display:block;"
break;case"bottom":marginSide="top";blockStyle="display:block;"
break;default:marginSide="right";break;}
var bHasText=!(this._html==""||this._text=="")
var iconTextGap=bHasText?this._iconTextGap:0;return"<input type=\"checkbox\" class=\"bi-check-box-input\" tabIndex=\"-1\""+(this._checked?" checked=\"true\"":"")+(!this._enabled?" disabled=\"true\"":"")+" id=\""+this._checkBoxId+"\""+" style=\""+blockStyle+"margin-"+marginSide+":"+iconTextGap+"px;"+(BiBrowserCheck.moz?"position:relative;top:-1px;":"")+"\">";};_p.setLabelFor=_p.getLabelFor=_p.setIcon=_p.getIcon=function(){throw new Error("Not supported by BiCheckBox");};_p.setChecked=function(bChecked){if(this._checked!=bChecked){this._checked=bChecked;if(this._input){this._input.checked=bChecked;this._input.defaultChecked=bChecked;}
this.dispatchEvent(new BiEvent("change"));if(this._command)
this._command.setChecked(this.getChecked());}};_p.getChecked=function(bChecked){return this._checked;};_p.setValue=_p.setChecked;_p.getValue=_p.getChecked;_p._setHtml=function(){BiLabel.prototype._setHtml.call(this);if(this._created){this._input=this._element.getElementsByTagName("INPUT")[0];if(BiBrowserCheck.ie)
{this._element.onclick=BiComponent.__oninlineevent;}}};_p.dispose=function()
{if(this._disposed)return;BiLabel.prototype.dispose.call(this);if(this._input)
{this._input._biComponent=null;this._input.onclick=null;}
this._input=null;};_p._onclick=function(e)
{if(this.getIsEnabled())
{var be=e._event;var el=be.target||be.srcElement;if(el==this._input)
{this.setChecked(this._input.checked);this._dispatchAction();}
else if(BiBrowserCheck.moz)
{this.setChecked(!this._input.checked);this._dispatchAction();}}};_p._onkeydown=function(e)
{if(e.getKeyCode()==BiKeyboardEvent.ENTER&&!e.getAltKey())
{this.setChecked(!this._input.checked);this._dispatchAction();}};_p._onkeyup=function(e)
{if(e.getKeyCode()==BiKeyboardEvent.SPACE)
{var be=e._event;var el=be.target||be.srcElement;if(el==this._input)
return;this.setChecked(!this._input.checked);this._dispatchAction();}};_p._oninlineevent=function(e)
{if(BiBrowserCheck.ie)
{e=this._document.parentWindow.event;if(e.type=="click")
e.cancelBubble=e.srcElement!=this._input;else BiComponent.prototype._oninlineevent.call(this,e);}
else BiComponent.prototype._oninlineevent.call(this,e);};_p._dispatchAction=function()
{this.dispatchEvent(new BiEvent("action"));if(this._command)
this._command.execute();};_p._syncWithCommmand=function()
{if(this._command)

⌨️ 快捷键说明

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