typeof win=ObjWin;; typeof text=ObjText;; typeof this=Run;; typeof timer=Timer;; fun double(x)=if x<10 then strcat "0" itoa x else itoa x;; fun chartime(t)= let [mod t 60 t/60] -> [s x] in let [mod x 60 x/60] -> [m h] in strcatn (itoa h) :: ":" :: (double m) :: ":" :: (double s) :: nil;; fun clockevent(a,b)= _SETtext text strloc loc "TIME" (chartime _channeltime this.canalRun)::nil ;; fun _butshow(t,x)= _on this.canalRun show [];; fun _stopres(x,s,r)= if r then (_killchannel this.canalRun; _killed 0) else nil;; fun _butstop(a,b)= _DLGrflmessage _DLGMessageBox _channel win loc "STOP" loc "KILL" 2 @_stopres 0;; fun _destroyevent(x,y)=_deltimer timer;; fun iniwindow()= set this=current; _setenv _channel _removepkg _envchannel _channel; set win=_CRwindow _channel nil nil nil 250 80 WN_MENU+WN_MINBOX loc "CONTPAN"; _CBwinDestroy win @_destroyevent 0; _CRtext _channel win 5 5 240 20 ET_BORDER this.nameRun; set text=_CRtext _channel win 5 30 240 20 ET_DOWN ""; _CBbutton (_CRbutton _channel win 5 55 100 20 0 loc "SHOWCONS") @_butshow 0; _CBbutton (_CRbutton _channel win 145 55 100 20 0 loc "STOP") @_butstop 0; set timer=_rfltimer (_starttimer _channel 1000) @clockevent 1; clockevent nil nil; 0 ;;