代码如下:
<Public: componente>
<Public: MethodName = "init" internalName = "fncreateProgressBar"/>
<Public: MethodName = "ShowProgress" internalName = "showProgress"/>
<Public: Propertyname = "Container"/>
<Public: Propertyname = "Speed"/>
<ScriptLanguage = javaScript>
varstarttime = null;
functnCreateProgressBar () {
ahora = newdate ();
starttime = now.gettime ();
ahora = nulo
OCONTAINER = Element.Container
ocontainer.innerhtml = "";
odiv = window.document.createElement ("div")
odiv.classname = "progreso"
Ocontainer.AppendChild (ODIV)
odiv.style.display = "";
elemento.bar = odiv;
}
functionPause (numberMillis) {
vardialogscript =
'Window.setTimeOut ('+
'function () {window.close ();},'+numberMillis+');';
VarResult =
ventana.showmodaldialog (
'JavaScript: Document.WriteLn ('+
'"<Script>'+DialogScript+'<'+'/script>")');
}
functionShowProgress (StatesDesc) {
ahora = newdate ();
currtime = ahora.gettime ();
ahora = nulo
if (StatesDesc! = NULL) Window.status = StatesDesc+"当前耗时:"+(Currtime-starttime)+"毫秒!";
element.bar.style.width = (currtime-starttime) /element.speed;