/* digiClock plugin - February 00 - Sebastien Deneux */ /* Rev May 2000 by Vincent BEAUDENON*/ typeof plugin=S;; typeof class=S;; typeof ed = PluginEditor;; typeof win1 = ObjWin;; typeof name1= ObjText;; typeof zone1= ObjBox;; typeof type1= ObjBox;; typeof dst1on = ObjCheck;; typeof dst1off = ObjCheck;; typeof win2 = ObjWin;; typeof name2= ObjText;; typeof zone2= ObjBox;; typeof type2= ObjBox;; typeof dst2on = ObjCheck;; typeof dst2off = ObjCheck;; typeof win2b = ObjWin;; typeof en2 = ObjCheck;; fun testinst(l,c)= if l==nil then 0 else let l->[a n] in if !strcmp a.classInst c then 1 else testinst n c;; proto save=fun [ [Inst r1] ] [[S r1] [S r1] [[S r1]r1] [[S r1]r1]];; fun CRzone(l)=let atoi hd l -> i in if i>-11 then CRzone (strcat itoa i-1 " ")::l else l;; fun ADDzone(s,z)= let atoi s -> i in set z=_ADDcombo z 1000 if i>0 then strcat "+" s else s;; fun enable2(a,b,i)= _ENtext name2 i; _ENcombo zone2 i; _ENcombo type2 i; _ENcheck dst2on i; _ENcheck dst2off i;; fun openedit(win,param)= let strextr param -> l in let _GETwindowSizePosition win -> [w h x y] in ( set ed = startPluginEditor _channel win 0 0 w h WN_CHILDINSIDE|WN_NOBORDER class; set win1 = _CRwindow _channel ed.PluginEditorEditWin 0 0 w-2 h/2 WN_CHILDINSIDE/*|WN_NOBORDER*/ "Win1"; _CRtext _channel win1 5 5 110 20 ET_ALIGN_LEFT "Clock 1"; _CRtext _channel win1 5 35 110 20 ET_ALIGN_LEFT "Name :"; let getInfo l "name1" -> s in set name1 = _CReditLine _channel win1 120 35 w -125 20 ET_ALIGN_LEFT|ET_DOWN if s==nil then "PARIS" else s; set zone1 = _CRcombo _channel win1 5 65 100 500 CB_NOEDIT|CB_DOWN "0"; apply_on_list CRzone "12"::nil @ADDzone zone1; let getInfo l "zone2" -> s in _SSELcombo zone1 if s==nil then "+1" else s; set type1 = _CRcombo _channel win1 135 65 100 60 CB_NOEDIT|CB_DOWN "Normal"; _ADDcombo type1 1000 "Normal"; _ADDcombo type1 1000 "Swatch"; _SELcombo type1 if strcmpi getInfo l "type1" "SWATCH" then 0 else 1; set dst1on = _CRcheck _channel win1 265 65 120 20 /*CH_DOWN|*/CH_RADIO "DST On"; set dst1off = _CRcheck _channel win1 395 65 120 20 /*CH_DOWN|*/CH_RADIO "DST Off"; if strcmpi getInfo l "dst1" "ON" then (_SETcheck dst1on 0;_SETcheck dst1off 1) else (_SETcheck dst1on 1;_SETcheck dst1off 0); set win2 = _CRwindow _channel ed.PluginEditorEditWin 0 h/2 w-2 h/2-1 WN_CHILDINSIDE "Win1"; set win2b = _CRwindow _channel win2 0 0 w-20 30 WN_CHILDINSIDE|WN_NOBORDER "Clock2 Enabled"; set en2 = _CRcheck _channel win2b 5 5 120 20 0 "Enable Clock2"; _CBcheck en2 @enable2 nil; _CRtext _channel win2 5 35 110 20 ET_ALIGN_LEFT "Clock 2"; _CRtext _channel win2 5 65 110 20 ET_ALIGN_LEFT "Name :"; let getInfo l "name2" -> s in set name2 = _CReditLine _channel win2 120 65 w -125 20 ET_ALIGN_LEFT|ET_DOWN if s==nil then "PARIS" else s; set zone2 = _CRcombo _channel win2 5 95 100 500 CB_NOEDIT|CB_DOWN "0"; apply_on_list CRzone "12 "::nil @ADDzone zone2; let getInfo l "zone2" -> s in _SSELcombo zone2 if s==nil then "+1" else s; set type2 = _CRcombo _channel win2 135 95 100 60 CB_NOEDIT|CB_DOWN "Normal"; _ADDcombo type2 1000 "Normal"; _ADDcombo type2 1000 "Swatch"; _SELcombo type2 if strcmpi getInfo l "type2" "SWATCH" then 0 else 1; set dst2on = _CRcheck _channel win2 265 95 120 20 /*CH_DOWN|*/CH_RADIO "DST On"; set dst2off = _CRcheck _channel win2 395 95 120 20 /*CH_DOWN|*/CH_RADIO "DST Off"; if strcmpi getInfo l "dst2" "ON" then (_SETcheck dst2on 0;_SETcheck dst2off 1) else (_SETcheck dst2on 1;_SETcheck dst2off 0); if (getInfo l "type2")!=nil then (_SETcheck en2 1; enable2 nil nil 1) else (_SETcheck en2 0; enable2 nil nil 0); 0 );; fun closeedit()= strbuild ("name1"::(_GETtext name1)::nil):: ("zone1"::(let _GETcombo zone1 ->[_ s] in s)::nil):: ("type1"::(let _GETcombo type1 ->[_ s] in s)::nil):: ("dst1"::(if _GETcheck dst1on then "ON" else "OFF")::nil):: if _GETcheck en2 then ("name2"::(_GETtext name2)::nil):: ("zone2"::(let _GETcombo zone2 ->[_ s] in s)::nil):: ("type2"::(let _GETcombo type2 ->[_ s] in s)::nil):: ("dst2"::(if _GETcheck dst2on then "ON" else "OFF")::nil)::nil else nil;; /* strcat "InitURL " _GETtext InitURL;; */ fun save(l)= [ nil /* registerF */ nil /* register */ ("plugin"::plugin::nil)::nil /* supplemental Dat */ nil /* supplemental Dmi */ ];; fun IniPlug(file)= set plugin=file; set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @save nil @openedit @closeedit;;