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

📄 gui2.moz.js

📁 ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.
💻 JS
📖 第 1 页 / 共 5 页
字号:
this._windowsMenu.dispose();this._windowsMenu=null;}};BiWindowManager.prototype.getStringBundle=function(){return this._stringBundle;};BiWindowManager.prototype.setStringBundle=function(v){this._stringBundle=v;};BiStringBundle._stringBundleMacro(_p,_p._updateStrings);application.getStringBundle().appendBundle("en",{WindowManagerCascade:"Cascade",WindowManagerCascadeMnemonic:"s",WindowManagerTileHorizontally:"Tile Horizontally",WindowManagerTileHorizontallyMnemonic:"h",WindowManagerTileVertically:"Tile Vertically",WindowManagerTileVerticallyMnemonic:"v",WindowManagerCloseAll:"Close All",WindowManagerCloseAllMnemonic:"a"});function BiDesktopPane(){if(_biInPrototype)return;BiComponent.call(this);this.setBackColor("AppWorkspace");this._windowManager=new BiWindowManager(this);}
_p=_biExtend(BiDesktopPane,BiComponent,"BiDesktopPane");BiDesktopPane.prototype.getWindowManager=function(){return this._windowManager;};_p.add=function(oChild,oBefore){BiComponent.prototype.add.call(this,oChild,oBefore);if(oChild instanceof BiWindow)
this._windowManager.add(oChild);};_p.remove=function(oChild){BiComponent.prototype.remove.call(this,oChild);if(oChild instanceof BiWindow)
this._windowManager.remove(oChild);return oChild;};_p.getWindows=function(){return this._windowManager.getWindows();};_p.dispose=function(){if(this._disposed)return;BiComponent.prototype.dispose.call(this);this._windowManager.dispose();this._windowManager=null;};function BiOptionPane(oMessage,sMessageType,sOptionType,oImage,oOptions,oInitialValue){if(_biInPrototype)return;BiComponent.call(this);this.setSize(250,100);this._message=oMessage;this._messageComponent=BiOptionPane.getComponentFromObject(this._message);this._messageType=sMessageType||"plain";this._optionType=sOptionType||"default";this._image=oImage||BiOptionPane.getImageFromOptionType(this._messageType);this._options=oOptions;this._optionComponents=this._getOptionComponents();this.setInitialValue(oInitialValue);this._addComponents();this._fixedLayout();}
_p=_biExtend(BiOptionPane,BiComponent,"BiOptionPane");BiOptionPane.BUTTONS_GAP=6;BiOptionPane.IMAGE_MESSAGE_GAP=18;BiOptionPane.MESSAGE_INPUT_GAP=10;BiOptionPane.MESSAGE_BUTTONS_GAP=18;BiOptionPane.PADDING_LEFT=11;BiOptionPane.PADDING_RIGHT=11;BiOptionPane.PADDING_TOP=11;BiOptionPane.PADDING_BOTTOM=11;_p._message=null;_p._messageType="plain";_p._optionType="default";_p._options=null;_p._inputComponent=null;_p._acceptButton=null;_p._cancelButton=null;_p._dialog=null;_p._value=null;BiOptionPane.getComponentFromObject=function(o){if(o instanceof BiComponent)
return o;var l=new BiLabel(String(o));l.setWrap(true);return l;};BiOptionPane.getImageFromOptionType=function(sOptionType){if(sOptionType=="plain")
return null;var srcId;switch(sOptionType){case"error":srcId="error-image";break;case"information":srcId="information-image";break;case"warning":srcId="warning-image";break;case"question":srcId="question-image";break;}
return new BiImage(application.getTheme().getAppearanceProperty("option-pane",srcId),32,32);};BiOptionPane.prototype.getMessage=function(){return this._message;};BiOptionPane.prototype.getMessageType=function(){return this._messageType;};BiOptionPane.prototype.getOptions=function(){return this._options;};BiOptionPane.prototype.getOptionType=function(){return this._optionType;};BiOptionPane.prototype.getImage=function(){return this._image;};BiOptionPane.prototype.getInitialValue=function(){return this._initialValue;};_p.setInitialValue=function(oInitialValue){this._initialValue=oInitialValue;if(oInitialValue!=null){var idx=this._options.indexOf(this._initialValue);this._acceptButton=this._optionComponents[idx];}
this._value=oInitialValue;};BiOptionPane.prototype.getAcceptButton=function(){return this._acceptButton;};BiOptionPane.prototype.setAcceptButton=function(v){this._acceptButton=v;};BiOptionPane.prototype.getCancelButton=function(){return this._cancelButton;};BiOptionPane.prototype.setCancelButton=function(v){this._cancelButton=v;};BiOptionPane.prototype.getDialog=function(){return this._dialog;};BiOptionPane.prototype.getValue=function(){return this._value;};BiOptionPane.prototype.setValue=function(v){this._value=v;};BiOptionPane.prototype.getInputComponent=function(){return this._inputComponent;};_p.setInputComponent=function(oComponent){if(this._inputComponent!=oComponent){if(this._inputComponent)
this.remove(this._inputComponent);this._inputComponent=oComponent;if(this._inputComponent)
this.add(this._inputComponent,this._optionComponents[0]);this._fixedLayout();if(this.getCreated())
this._layoutInputComponent();}};_p._getOptionComponents=function(){var res=[];var i;if(this._options!=null){for(i=0;i<this._options.length;i++)
res[i]=this._getOptionButton(this._options[i],this._options[i])}
else{if(this._optionType=="default"||this._optionType=="okcancel")
res.push(this._getOptionButton(this._getString("OptionPaneOK"),"ok"));if(this._optionType=="yesno"||this._optionType=="yesnocancel"){res.push(this._getOptionButton(this._getString("OptionPaneYes"),"yes"));res.push(this._getOptionButton(this._getString("OptionPaneNo"),"no"));}
if(this._optionType=="okcancel"||this._optionType=="yesnocancel")
res.push(this._getOptionButton(this._getString("OptionPaneCancel"),"cancel"));}
for(i=0;i<res.length;i++)
res[i].setWidth(75);return res;};_p._getOptionButton=function(oText,oDialogResult){var b;if(oText instanceof BiComponent)
b=oText;else b=new BiButton(String(oText));b.addEventListener("action",function(e){this._onOptionAction(e,oDialogResult);},this);return b;};_p._addComponents=function(){if(this._image)
this.add(this._image);this.add(this._messageComponent);if(this._inputComponent)
this.add(this._inputComponent);for(var i=0;i<this._optionComponents.length;i++)
this.add(this._optionComponents[i]);};_p.layoutAllChildren=function(){BiComponent.prototype.layoutAllChildren.call(this);this._layoutOptionComponents();this._layoutInputComponent();};_p._fixedLayout=function(){var messageLeft;if(this._image){this._image.setLocation(BiOptionPane.PADDING_LEFT,BiOptionPane.PADDING_TOP);messageLeft=BiOptionPane.PADDING_LEFT+this._image.getWidth()+BiOptionPane.IMAGE_MESSAGE_GAP;}
else{messageLeft=BiOptionPane.PADDING_LEFT;}
this._messageComponent.setLocation(messageLeft,BiOptionPane.PADDING_TOP);this._messageComponent.setRight(BiOptionPane.PADDING_RIGHT);if(this._inputComponent){this._inputComponent.setLeft(messageLeft);this._inputComponent.setRight(BiOptionPane.PADDING_RIGHT);}};_p._getOptionComponentsWidth=function(){var w=0;for(var i=0;i<this._optionComponents.length;i++)
w+=this._optionComponents[i].getWidth()+BiOptionPane.BUTTONS_GAP;w-=BiOptionPane.BUTTONS_GAP;return w;};_p._getOptionComponentsHeight=function(){var h=0;for(var i=0;i<this._optionComponents.length;i++)
h=Math.max(h,this._optionComponents[i].getHeight());return h;};_p._layoutOptionComponents=function()
{var cw=this.getClientWidth()-BiOptionPane.PADDING_LEFT-BiOptionPane.PADDING_RIGHT;var bw=this._getOptionComponentsWidth();var x=BiOptionPane.PADDING_LEFT+(cw-bw)/2;for(var i=0;i<this._optionComponents.length;i++)
{this._optionComponents[i].setLeft(x);x+=this._optionComponents[i].getWidth()+BiOptionPane.BUTTONS_GAP;}
var maxHeight=this._getOptionComponentsHeight();for(i=0;i<this._optionComponents.length;i++)
{this._optionComponents[i].setBottom(BiOptionPane.PADDING_BOTTOM+(maxHeight-this._optionComponents[i].getHeight())/2);}};_p._layoutInputComponent=function()
{if(this._inputComponent){this._inputComponent.setTop(BiOptionPane.PADDING_TOP+this._messageComponent.getHeight()+BiOptionPane.MESSAGE_INPUT_GAP);}};_p.getPreferredWidth=function(){var w=(this._image?this._image.getWidth()+BiOptionPane.IMAGE_MESSAGE_GAP:0)+Math.max(this._messageComponent.getPreferredWidth(),(this._inputComponent?this._inputComponent.getPreferredWidth():0));return BiOptionPane.PADDING_LEFT+BiOptionPane.PADDING_RIGHT+Math.max(w,this._getOptionComponentsWidth());};_p.getPreferredHeight=function(){var h=Math.max(this._image?this._image.getHeight():0,this._messageComponent.getPreferredHeight()+(this._inputComponent?this._inputComponent.getPreferredHeight()+BiOptionPane.MESSAGE_INPUT_GAP:0));return BiOptionPane.PADDING_TOP+h+BiOptionPane.MESSAGE_BUTTONS_GAP+this._getOptionComponentsHeight()+BiOptionPane.PADDING_BOTTOM;};_p.createDialog=function(sCaption){var d=new BiDialog(sCaption);d.setResizable(true);d.setMinimumWidth(250);d.setMinimumHeight(123);var cp=d.getContentPane();d.setContentPane(this);cp.dispose();var aw=application.getWindow();aw.add(d);this.layoutAllChildren();var pw=Math.max(d.getPreferredWidth(),d.getMinimumWidth());var ph=Math.max(d.getPreferredHeight(),d.getMinimumHeight());pw=Math.min(aw.getClientWidth(),pw);d.setSize(pw,ph);d.setResizable(false);if(!this._acceptButton&&!this._options)
this._acceptButton=this._optionComponents[0];if(!this._cancelButton&&!this._options)
this._cancelButton=this._optionComponents[this._optionComponents.length-1];d.setAcceptButton(this._acceptButton);d.setCancelButton(this._cancelButton);this._dialog=d;return d;};_p._onOptionAction=function(e,oDialogResult){if(this._inputComponent){if(oDialogResult=="cancel")
this.setValue(null);else if(typeof this._inputComponent.getValue=="function")
this.setValue(this._inputComponent.getValue());else if(typeof this._inputComponent.getText=="function")
this.setValue(this._inputComponent.getText());else this.setValue(String(this._inputComponent));}
else this.setValue(oDialogResult);if(this._dialog){this._dialog.setDialogResult(this.getValue());this._dialog.close();}};BiOptionPane.createMessageDialog=function(oMessage,sCaption,sMessageType,oImage)
{var op=new BiOptionPane(oMessage,sMessageType||"information","default",oImage);return op.createDialog(sCaption||op._getString("OptionPaneMessage"));};BiOptionPane.createOptionDialog=function(oMessage,sCaption,sMessageType,sOptionType,oImage,oOptions,oInitialValue)
{var op=new BiOptionPane(oMessage,sMessageType,sOptionType,oImage,oOptions,oInitialValue);return op.createDialog(sCaption);};BiOptionPane.createConfirmDialog=function(oMessage,sCaption,sMessageType,sOptionType,oImage)
{var op=new BiOptionPane(oMessage,sMessageType||"question",sOptionType||"yesnocancel",oImage);return op.createDialog(sCaption||op._getString("OptionPaneSelectAnOption"));};BiOptionPane.createInputDialog=function(oMessage,sCaption,sMessageType,oImage,sDefaultValue)
{var op=new BiOptionPane(oMessage,sMessageType||"question","okcancel",oImage);op.setInputComponent(new BiTextField(sDefaultValue));var d=op.createDialog(sCaption||op._getString("OptionPaneInput"));d.setDefaultFocusedComponent(op.getInputComponent());return d;};BiOptionPane.prototype.getStringBundle=function(){return this._stringBundle;};BiOptionPane.prototype.setStringBundle=function(v){this._stringBundle=v;};BiStringBundle._stringBundleMacro(_p);application.getStringBundle().appendBundle("en",{OptionPaneYes:"Yes",OptionPaneNo:"No",OptionPaneOK:"OK",OptionPaneCancel:"Cancel",OptionPaneMessage:"Message",OptionPaneSelectAnOption:"Select an Option",OptionPaneInput:"Input"});function BiDialog(sCaption){if(_biInPrototype)return;BiWindow.call(this,sCaption);this.setSize(200,100);this.setShowMinimize(false);this.setShowMaximize(false);this.setShowIcon(false);this.setShowClose(false);this.setResizable(false);this.setCanMinimize(false);BiWindow.prototype.setVisible.call(this,false);}
_p=_biExtend(BiDialog,BiWindow,"BiDialog");_p._dialogResult=null;_p._defaultFocusedComponent=null;_p._centered=true;BiDialog.prototype.getDialogResult=function(){return this._dialogResult;};BiDialog.prototype.setDialogResult=function(v){this._dialogResult=v;};BiDialog.prototype.getDefaultFocusedComponent=function(){return this._defaultFocusedComponent;};BiDialog.prototype.setDefaultFocusedComponent=function(v){this._defaultFocusedComponent=v;};BiDialog.prototype.getCentered=function(){return this._centered;};BiDialog.prototype.setCentered=function(v){this._centered=v;};_p.centerDialog=function()
{var p=this.getParent();if(!p)
return;var cw=p.getClientWidth();var ch=p.getClientHeight();var w=this.getWidth();var h=this.getHeight();this.setLocation((cw-w)/2,(ch-h)/2);};_p.setVisible=function(b)
{if(this._visible!=b)
{if(b&&this._parent==null)
application.getWindow().add(this);if(b&&this._centered)
this.centerDialog();BiWindow.prototype.setVisible.call(this,b);if(b)
this.setActive(b);application.getWindow().updateGlassPane(this,b);var dfc=this.getDefaultFocusedComponent();if(b&&dfc)
{dfc.setFocused(true);if(dfc instanceof BiTextField)
dfc.selectAll();}
else if(b&&this.getAcceptButton()&&this.getAcceptButton().getCanFocus())
this.getAcceptButton().setFocused(true);if(!b)
this.dispatchEvent(new BiEvent("dialogresult"));}};_p.close=function()
{this.setVisible(false);BiWindow.prototype.close.call(this);};BiDialog.createMessageDialog=function(oMessage,sCaption,sMessageType,oImage)
{return BiOptionPane.createMessageDialog.apply(this,arguments);};BiDialog.createOptionDialog=function(oMessage,sCaption,sMessageType,sOptionType,oImage,oOptions,oInitialValue)
{return BiOptionPane.createOptionDialog.apply(this,arguments);};BiDialog.createConfirmDialog=function(oMessage,sCaption,sMessageType,sOptionType,oImage)
{return BiOptionPane.createConfirmDialog.apply(this,arguments);};BiDialog.createInputDialog=function(oMessage,sCaption,sMessageType,oImage,sDefaultValue)
{return BiOptionPane.createInputDialog.apply(this,arguments);};function BiColorPicker(){if(_biInPrototype)return;BiDialog.call(this);var cp=this.getContentPane();var l=this._colors.length;this._items=new Array(l);var item,i=0;for(var y=0;y<6;y++){for(var x=0;x<8;x++){item=new BiComponent;item.setBackColor(this._colors[i]);item.setAppearance("color-picker-box");item.setBounds(5+x*(this._itemWidth+this._itemGap),5+y*(this._itemHeight+this._itemGap),this._itemWidth,this._itemHeight);cp.add(item);this._items[i]=item;i++;}}
this._colorBox=new BiComponent;this._colorBox.setAppearance("color-picker-box");this._colorBox.setBounds(150,230,50,25);this._colorBox.setBackColor("red");cp.add(this._colorBox);this._colorLabel=new BiLabel;this._colorLabel.setAlign("right");this._colorLabel.setBounds(5,235,140,15);cp.add(this._colorLabel);this.setSize(518,322);var gridWidth=8*(this._itemWidth+this._itemGap)-5;this._hueBack=new BiComponent;this._hueBack.setAppearance("color-picker-box");this._hueBack.setBackColor("#000");this._hueBack.setSize(250,250);this._hueBack.setLocation(gridWidth+15,5);cp.add(this._hueBack);this._hueImage=new BiImage(BiColorPicker.HUE_SATURATION_IMAGE_URI,246,246);this._hueImage.setLocation(gridWidth+15+2,5+2);cp.add(this._hueImage);this._hueHandle=new BiImage(application.getTheme().getAppearanceProperty("color-picker","hue-saturation-handle-image"),11,11);this._hueHandle.setLocation(gridWidth+15+2-6,5+2-6);cp.add(this._hueHandle);this._brightnessImage=new BiImage(BiColorPicker.BRIGHTNESS_IMAGE_URI,19,246);this._brightnessImage.setAppearance("color-picker-box");this._brightnessImage.setLocation(gridWidth+280,5);cp.add(this._brightnessImage);this._brightnessHandle=new BiImage(application.getTheme().getAppearanceProperty("color-picker","brightness-handle-image"),35,11);this._brightnessHandle.setLocation(gridWidth+274,0);cp.add(this._brightnessHandle);this.addEventListener("mouseup",this._onClick);this._hueImage.addEventListener("mousedown",this._onHueDown,this);this._hueHandle.addEventListener("mousedown",this._onHueDown,this);this._brightnessImage.addEventListener("mousedown",this._onBrightnessDown,this);this._brightnessHandle.ad

⌨️ 快捷键说明

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