/* Stat Window - Aug.97 - by Sylvain Huet */ struct StatWin= [chStatW:Chn,winStatW:ObjWin, bannerStatW:ObjText,textsStatW:[[ObjText ObjText] r1], endStatW:fun [StatWin] I]mkStatW;; fun _destroyE(x,b)= exec b.endStatW with [b];; fun resizeTexts(h,w,l)= if l==nil then 0 else let l->[[p q] n] in (_SIZEtext p w 20 5 h; _SIZEtext q w 20 5+w h; resizeTexts h+20 w n);; fun _resizeE(a,b,w,h)= if (w<40) then nil else (_SIZEtext b.bannerStatW w-10 20 5 5; resizeTexts 30 (w-10)/2 b.textsStatW) ;; fun createTexts(ch,win,h,w,txt)= if txt==nil then nil else [_CRtext ch win 5 h w 20 ET_DOWN|ET_AHSCROLL hd txt _CRtext ch win 5+w h w 20 ET_DOWN|ET_AHSCROLL ""]:: createTexts ch win h+20 w tl txt;; fun iniStatW(ch,father,x,y,w,h,title,end,flag,titles)= let _CRwindow ch father x y w h (if flag then WN_CHILDINSIDE|WN_NOCAPTION|WN_NOBORDER else WN_MENU+WN_MINBOX+WN_SIZEBOX) title -> win in let _CRtext ch win 5 5 w-10 20 ET_DOWN title -> banner in let createTexts ch win 30 (w-10)/2 titles -> texts in let mkStatW [ch win banner texts end] -> b in (_CBwinDestroy win @_destroyE b; _CBwinSize win @_resizeE b; b );; fun setStat(l,q)= if l==nil then 0 else let l->[[_ t] n] in (_SETtext t hd q; setStat n tl q);; fun _setStatW(b,new)= setStat b.textsStatW hd strextr new;; fun _killStatW(b)=_DSwindow b.winStatW;;