/* module SKIN - part client author : iri, oct, 2004 info : http://www.irizone.net */ typeof skinListe = [S r1];; typeof skinFiles = [S r1];; typeof BMP = ObjBitmap;; var nbRSC = 0;; defcom CchgSkin = chgSkin S;; fun cbListSkin(lbox, win, n, s)= _DSwindow win; let nth_list skinListe n -> skinPath in _DMSsend this CchgSkin [skinPath];; fun setSkin(s)= let strfind "/" s 0 -> r in if r == nil then s else setSkin substr s r+1 strlen s;; fun returnpath(s)= let strfind "/" s (strlen s)-1 -> r in if r != nil then s else returnpath substr s 0 (strlen s)-1;; fun addlistskin(listSkin, l)= if l == nil then 0 else let l -> [elt suite] in let setSkin elt -> skin in (_ADDlist listSkin (_GETlistCount listSkin)+1 skin; addlistskin listSkin suite);; fun openPanel()= let _GETscreenPos -> [x y] in let _CRwindow _channel DMSwin x y 130 120 WN_MENU "Skin" -> win in let _CRlist _channel win 0 0 130 120 LB_VSCROLL|LB_DOWN -> listSkin in ( addlistskin listSkin skinListe; _CBlistDclick listSkin @cbListSkin win ); 0;; fun activate(from, action, param, rep)= if !strcmp action "choice" then openPanel else 0;; fun IniDMI(param)= set skinListe = lineextr param; _DMSregisterDMI this @activate nil; 0;; /* fun compareBmp(l, bmp)= if l == nil then nil else let l -> [elt suite] in if (!strcmp setSkin elt setSkin bmp) then elt else compareBmp suite bmp;; fun loadBMP(path)= let _LDbitmap _channel _checkpack path -> tmp in if tmp == nil then let _LDjpeg _channel _checkpack path -> tmp in if tmp == nil then _LDbitmap _channel _checkpack path else tmp else tmp;; fun updateDOC(l, namedoc, file, bmp)= if l == nil then nil else let l -> [elt suite] in if !strcmp elt.nameDOC namedoc then (set elt.bmpDOC = bmp; set elt.bmpnameDOC = file) else updateDOC suite namedoc file bmp;; fun chgSkin(file, type)= _DSbitmap BMP;_showconsole; _fooS strcat ">>>>>" file; set BMP = loadBMP compareBmp skinFiles file; let _GETwindowSizePosition DMSwin -> [wwin hwin _ _] in let _GETbitmapSize BMP -> [wbmp hbmp] in ( _DSbitmap DMSdocs.bmpDOC; updateDOC DMSdocs.sonsDOC "client" file BMP; // to do : tous les docs pas que le 'père' if type != nil && file != nil then if type == 0 then // centré (_BLTbitmap DMSwin BMP (wwin/2)-(wbmp/2) (hwin/2)-(hbmp/2); 0) else if type == 4 then // carrelé let 0 -> i in while i < wwin do (let 0 -> j in while j < hwin do (_BLTbitmap DMSwin BMP i j; set j= j + hbmp); set i=i + wbmp) else if type == 8 then // étendue (_STBLTbitmap DMSwin 0 0 wwin hwin BMP 0 0 wbmp hbmp; 0) else 0 else 0 ); _DMSevent this "changed" linebuild skinFiles nil;; */ fun createWinDL(size)= let _GETscreenPos -> [x y] in let _CRwindow _channel DMSwin x y 250 20 WN_MENU (_loc this "titleWinDL" nil) -> winDL in ( _CRtext _channel winDL 0 0 250 20 0 strcatn (_loc this "msgWinDL"nil)::" "::(itoa size)::" ko"::nil; winDL );; fun endDownload(file, p)= set nbRSC = nbRSC+1; let p -> [s winDL fic type] in ( if nbRSC == s then ( _DMSevent this "chgDmsTrans" returnpath file nil; _DMSevent this "changed" linebuild skinFiles nil; set nbRSC = 0; _DSwindow winDL ) else 0 );; fun downloadrsc(rscs, s, winDL, fic, type)= if rscs == nil then 0 else let rscs -> [file suite] in (_RSCdownload this file file mkfun2 @endDownload [s winDL fic type] 1; set skinFiles = file::skinFiles; downloadrsc suite s winDL fic type);; fun __interfDL(r, size, fic, type)= set skinFiles = nil; let createWinDL size -> winDL in let lineextr r -> rscs in let sizelist rscs -> s in downloadrsc rscs s-1 winDL fic type;;