summaryrefslogtreecommitdiff
path: root/swat/style/qooxdoo/widgets/core/QxTimer.js
blob: 6d0794237afe11015d17a1055a05e88f412cfa14 (plain)
1
2
/* Copyright (c): 2002-2005 (Germany): United Internet, 1&1, GMX, Schlund+Partner, Alturo */
function QxTimer(vInterval){QxTarget.call(this);this.setEnabled(false);if(isValidNumber(vInterval)){this.setInterval(vInterval);};(new QxTimerManager).add(this);var o=this;this.__i7=function(){o._i7();};};QxTimer.extend(QxTarget,"QxTimer");QxTimer.addProperty({name:"interval",type:Number,defaultValue:1000});proto._i8=null;proto._modifyEnabled=function(_b1,_b2,_b3,_b4){if(_b2){window.clearInterval(this._i8);this._i8=null;}else if(_b1){this._i8=window.setInterval(this.__i7,this.getInterval());};return QxTarget.prototype._modifyEnabled.call(this,_b1,_b2,_b3,_b4);};proto.start=function(){this.setEnabled(true);};proto.startWith=function(vInterval){this.setInterval(vInterval);this.start();};proto.stop=function(){this.setEnabled(false);};proto.restart=function(){this.stop();this.start();};proto.restartWith=function(vInterval){this.stop();this.startWith(vInterval);};proto._i7=function(){if(this.getEnabled()&&this.hasEventListeners("interval")){this.dispatchEvent(new QxEvent("interval"),true);};};proto.dispose=function(){if(this.getDisposed()){return;};this.stop();this.__i7=null;if(this._i8r){window.clearInterval(this._i8);this._i8r=null;};return QxTarget.prototype.dispose.call(this);};