/* Text Client - DMS - June 98 - by Sylvain HUET */ /* Rev 1.1 - Aug. '98 - by Marc BARILLEY */ /* rev. October 99 - by Sébastien DENEUX (action start added)*/ /* rev. May 01 - by Julien ZORKO (ObjText -> RichText) */ typeof win=ObjWin;; typeof txt=ObjRichText;; typeof child=I;; typeof last=RSC;; fun downloadTexts(l)= if l==nil then nil else let l -> [tete queue] in (_RSCdownload this tete tete nil 3; downloadTexts queue;0);; fun IniDMI(param)= if param!=nil then downloadTexts lineextr param else nil;; fun destr(a)=_DMSdelete this;; fun _destroyWin(a,b)=_DMSdelete this;; fun _resizeTx(a,t,x,y)= _SIZErichText t x-2 y-2 1 1;; fun _paintTx(win,txt) = _PAINTrichText txt ;; fun res (coord, z)= let coord -> [wn x y w h] in _SIZErichText txt w h x y; _PAINTrichText txt; 0;; fun disp(content, name, params)= set last=nil; if content==nil then nil else { if child then nil else if win!=nil then { _SETwindowName win name; nil } else { set win=_CRwindow _channel DMSwin 10 10 400 300 WN_MENU+WN_MINBOX+WN_SIZEBOX name; _CBwinDestroy win @_destroyWin 0; set txt = _CRrichText _channel win 1 1 398 298 ET_AHSCROLL|ET_AVSCROLL|ET_ALIGN_LEFT|ET_HSCROLL|ET_VSCROLL|ET_DOWN|ET_NOEDIT nil; _CBwinSize win @_resizeTx txt; _CBwinPaint win @_paintTx txt }; let strextr params -> l in ( let atoi getInfo l "bgColor" -> tmp in let if tmp==nil then 0xffffff else tmp -> bgColor in _SETbkgColorRichText txt bgColor; let atoi getInfo l "fwColor" -> tmp in let if tmp==nil then 0 else tmp -> fwColor in let atoi getInfo l "fontSize" -> tmp in let if tmp==nil then 6 else tmp -> fontSize in let getInfo l "font" -> tmp in let if tmp==nil then "Arial" else tmp -> font in let _getpack _checkpack content -> text in _SETtextRichText txt text font fontSize fwColor 0 ) }; 0 ;; fun __get (name, file, params)= if child!=nil then nil else let _DMSgetZone this "text" @destr @res @destr ->[wn x y w h] in if wn==nil then set child=0 else { set txt = _CRrichText _channel wn x y w h ET_AHSCROLL|ET_AVSCROLL|ET_ALIGN_LEFT|ET_HSCROLL|ET_VSCROLL|ET_DOWN|ET_NOEDIT nil; set child=1 }; _RSCabort this last; set last = _RSCdownload this file file (mkfun2 mkfun3 @disp params name) 3 ;;