/* Quizz Editor - DMS - feb 98 - by Sylvain HUET */ typeof quizz=tab ObjText;; typeof editWin=ObjWin;; fun onequizz(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 createQuizz()= set quizz=create_tab 8 @onequizz 0;; fun getQuizz(l)= if l==nil then nil else let l->[q n] in if !strcmp hd q "quizz" then (hd tl q)::getQuizz n else getQuizz n;; fun setQuizz(l,i)= if l==nil || i>=8 then 0 else let l->[a n] in (_SETtext quizz.i a; setQuizz n i+1);; /* SCS editor */ fun load (l) = setQuizz getQuizz l 0; 0;; fun getText(i)= if i==8 then nil else ("action"::(strcat "quizz" itoa i)::nil):: ("event"::(strcat "yes" itoa i)::nil):: ("event"::(strcat "no" itoa i)::nil):: ("quizz"::(_GETtext quizz.i)::nil)::getText i+1;; fun save (filename, n)= ("action"::"quizz"::nil):: ("event"::"yes"::nil):: ("event"::"no"::nil):: getText 0;; fun IniEditor(s)= let startEditor _channel nil nil nil 315 230 WN_MENU EDITOR_NORMAL s "dms/tools/quizz/quizz.dmc" nil nil @load @save nil -> ed in ( set editWin = getEditWin ed; /* loc( _CRtext _channel editWin 20 5 290 20 ET_ALIGN_CENTER "Prompt"; ) */ _CRtext _channel editWin 20 5 290 20 ET_ALIGN_CENTER (_locEditor "510-QUIZZE-prompt" nil); createQuizz; if s==nil then nil else openDMI ed ); 0;;