/* Module EXPOPHOTO version 1.0 february 2004 */ /* part Client, by iri : info@irizone.net */ /* rev 1.1 by iri - march 2004 - fixes bugs */ typeof win = ObjWin;; typeof bmp = ObjBitmap;; typeof last = RSC;; typeof initbmp = ObjBitmap;; typeof txt = ObjText;; var globalname = "";; fun downloadBitmaps(l)= if l==nil then _DMSevent this "in" nil nil else let l -> [tete queue] in (_RSCdownload this tete tete nil 3; downloadBitmaps queue;0);; fun IniDMI(param)= if param!=nil then downloadBitmaps lineextr param else nil;; fun _end(a)= _DMSdelete this;; fun _endWin(a, b)= _DMSdelete this;; fun _paintWin(w,b)=_BLTbitmap win bmp 0 0;; fun inibmp(t)= let _GETbitmapSize bmp -> [w h] in let _GETbitmapSize initbmp -> [w2 h2] in let if t == nil then _GETtext txt else t -> titre in (set txt = _CRtext _channel win 0 h+5 w 20 ET_ALIGN_CENTER|ET_BORDER titre; _SCPbitmap bmp 0 0 w-1 h-1 initbmp 0 0 w2-1 h2-1 nil);; fun _clickWin(a,b,x,y,i)= inibmp nil; _paintWin nil nil;; fun _unclickWin(a,b,x,y,i)= inibmp nil; _paintWin nil nil; _DMSevent this if i==1 then "clickLeft" else "clickRight" nil nil; _DMSevent this strcat globalname if i==1 then ".left" else ".right" nil nil;; fun display(file, p)= let p -> [name wn t] in (set last=nil; if file == nil then nil else let _LDbitmap _channel _checkpack file -> bmp0 in let if bmp0 == nil then _LDjpeg _channel _checkpack file else bmp0 -> newbmp in if newbmp == nil then nil else (_DSbitmap initbmp; set initbmp = newbmp; if wn != nil then (inibmp t; 0) else let _GETbitmapSize initbmp -> [w h] in ( _DSwindow win; _DSbitmap bmp; set win=_CRwindow _channel DMSwin 10 10 w h+30 WN_MENU+WN_MINBOX name; set bmp=_CRbitmap _channel w h; inibmp t; _CBwinPaint win @_paintWin 0; _CBwinDestroy win @_endWin 0; 0 ); _CBwinClick win @_clickWin 0; _CBwinUnclick win @_unclickWin 0; _paintWin nil nil)); 0;; fun _resizeI(x,s)= let x->[_ x y w h] in if w<1 || h<1 then nil else (_SIZEwindow win w h x y; _DSbitmap bmp; set bmp=_CRbitmap _channel w h; inibmp nil; _paintWin nil nil; 0);; fun __getBmp(name, file, title)= set globalname = name; let _DMSgetZone this "bitmap" nil @_resizeI @_end ->[wn x y w h] in ( if wn == nil then nil else ( set win=_CRwindow _channel wn x y w h WN_CHILDINSIDE|WN_NOCAPTION|WN_NOBORDER name; set bmp=_CRbitmap _channel w h-30; _FILLbitmap bmp 0; _CBwinPaint win @_paintWin 0; _CBwinClick win @_clickWin 0; _CBwinUnclick win @_unclickWin 0 ); _RSCabort this last; set last=_RSCdownload this file file mkfun2 @display [name wn title] 3 );;