/* * Scol Voyager * * Author : The Scol Team : http://www.scolring.org/ * * This file is a part of the Scol Voyager * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA, or go to * http://www.gnu.org/copyleft/lesser.txt * * For others informations, please contact us from http://www.scolring.org/ * */ 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 ;;