/* Control Editor - DMS - Apr 98 - by Sylvain HUET */ /* Revised Aug. '98 - by Marc BARILLEY */ /* rev May 00 - by Sebastien DENEUX */ typeof quizz=tab ObjText;; typeof editWin= ObjWin;; typeof nbEventRelay = ObjText;; typeof ShowIp = ObjCheck;; var nbElements=10;; fun getQuizz(l)= if l==nil then nil else let l->[q n] in if !strcmp hd q "control" then (hd tl q)::getQuizz n else getQuizz n;; /******************************************************************************* relay actions/events *******************************************************************************/ fun Getsupp(n) = if n == nil || n <= 0 then nil else ("actionC"::(strcat "relay." itoa n)::nil):: ("event"::(strcat "relay." itoa n)::nil)::Getsupp n-1 ;; fun getText(i)= if i==nbElements then Getsupp atoi _GETtext nbEventRelay else let _GETtext quizz.i -> t in if (t==nil) || (strlen t)==0 then getText i+1 else ("event"::(_GETtext quizz.i)::nil):: ("control"::(_GETtext quizz.i)::nil):: getText i+1;; fun setQuizz(l,i)= if l==nil || i>=nbElements then 0 else let l->[a n] in (_SETtext quizz.i a; setQuizz n i+1);; fun onequizz(i,x)= _CRtext _channel editWin 5 25+i*25 20 20 ET_ALIGN_CENTER itoa i; _CReditLine _channel editWin 30 25+i*25 280 20 ET_DOWN+ET_AHSCROLL "";; fun createQuizz()= set quizz=create_tab nbElements @onequizz 0;; fun save (s,n)= ("action"::"start"::"start"::nil):: ("action"::"destroy"::"destroy"::nil):: ("action"::"entering"::"entering"::nil):: ("action"::"register"::"register"::nil):: ("action"::"unregister"::"unregister"::nil):: ("action"::"!changeLogin"::"changeLogin"::nil):: ("event"::"shown"::"shown"::nil):: ("event"::"hidden"::"hidden"::nil):: ("zoneC"::"Control"::nil):: ("nbEventRelay"::(_GETtext nbEventRelay)::nil):: ("rule"::"2"::"Authentification"::"1"::"loginChanged"::"1"::"Control"::"0"::"!changeLogin"::nil):: ("ShowIp"::(itoa _GETcheck ShowIp)::nil):: getText 0;; fun load (l)= _SETtext nbEventRelay getInfo l "nbEventRelay"; let atoi getInfo l "ShowIp" -> tmp in _SETcheck ShowIp if tmp==nil then 1 else tmp; setQuizz getQuizz l 0; 0;; fun IniEditor (filename)= let startEditor _channel nil 0 0 315 25*nbElements+30+50+30 WN_NORMAL EDITOR_NORMAL filename "dms/admin/control/control.dmc" nil nil @load @save nil -> ed in ( set editWin = getEditWin ed; _CRtext _channel editWin 20 5 290 20 ET_ALIGN_CENTER (_locEditor "650-CONTRO-additional" nil); createQuizz; /* Configuration Event Relay. */ set ShowIp = _SETcheck _CRcheck _channel editWin 20 25*nbElements+30+10+30 200 20 0 _locEditor "SHOWIP" nil 1; let _CRtext _channel editWin 20 25*nbElements+30+10 200 20 ET_ALIGN_LEFT _locEditor "RELAY" nil -> text in set nbEventRelay = _CReditLine _channel editWin 230 25*nbElements+30+10 70 20 ET_DOWN|ET_AHSCROLL|ET_NUMBER "0"; if filename==nil then nil else openDMI ed ); 0;;