/* Stats Editor - DMS - feb 98 - by Sylvain HUET */ /* Rev. Aug. '98 - by Marc BARILLEY */ typeof editWin=ObjWin;; typeof choice=tab ObjText;; fun getChoice(l)= if l==nil then nil else let l->[q n] in if !strcmp hd q "alert" then (hd tl q)::getChoice n else getChoice n;; fun getText(i)= if i==8 then nil else let choice.i -> tx in let _GETtext tx -> s in ("action"::(strcatn "alert"::(itoa i)::"."::s::nil)::"alert"::nil):: ("event"::(strcatn "alert"::(itoa i)::"."::s::nil)::"alert"::nil):: ("alert"::s::nil)::getText i+1;; fun setChoice(l,i)= if l==nil || i>=8 then 0 else let l->[a n] in let choice.i -> tx in (_SETtext tx a; setChoice n i+1);; fun onechoice(i,x)= _CRtext _channel editWin 5 25+i*25 10 20 ET_ALIGN_CENTER itoa i; _CReditLine _channel editWin 20 25+i*25 290 20 ET_DOWN+ET_AHSCROLL "";; fun createChoice()= set choice=create_tab 8 @onechoice 0;; fun save (filename, n)= ("action"::"show"::"show"::nil):: ("action"::"hide"::"hide"::nil):: ("event"::"shown"::"shown"::nil):: ("event"::"hidden"::"hidden"::nil):: ("zone"::"Alert"::nil):: ("zoneC"::"Alert"::nil):: ("rule"::"1"::"Alert"::"1"::"alert"::"2"::"Log"::"1"::"log"::nil):: getText 0;; fun load (l) = setChoice getChoice l 0; 0;; fun IniEditor (s)= let startEditor _channel nil nil nil 315 230 WN_NORMAL EDITOR_NORMAL s "dms/admin/alert/alert.dmc" nil nil @load @save nil -> ed in ( set editWin = getEditWin ed; /* loc( _CRtext _channel editWin 20 5 290 20 ET_ALIGN_CENTER "Text to display"; ) */ _CRtext _channel editWin 20 5 290 20 ET_ALIGN_CENTER (_locEditor "560-ALERTE-texttodisp" nil); createChoice; if s==nil then nil else openDMI ed ); 0;;