/* Contact Server - DMS - Apr 98 - by Sylvain HUET */ /* Rev. Mar. '99 - by Patrice FAVRE */ typeof button=ObjButton;; typeof bitmapori=ObjBitmap;; typeof bitmap=ObjBitmap;; defcom Copen=open S;; fun contact()= _on _masterchannel Copen [strcat "scol://:" itoa DMSport]; 0;; fun activate(from,cli,action,param,rep)= if !strcmp action "contact" then contact else nil;; fun _setBitmap(button,w,h)= let _GETbitmapSize bitmapori -> [u v] in ( _DSbitmap bitmap; set bitmap=_CRbitmap _channel w h; _SCPbitmap bitmap 0 0 w h bitmapori 0 0 u v nil; _SETbuttonBitmap button bitmap; ); 0;; fun _resizeI(x,s)= let x->[win x y w h] in ( _SIZEbutton button w h x y; if bitmapori!=nil then _setBitmap button w h else 0; ); 0;; fun contactb(a,b)=contact;; fun cbtim(t,x)= _deltimer t; contact;; fun IniDMI(param)= _DMSregisterDMI this @activate nil nil nil; let strextr _getpack _checkpack param -> l in ( if 1==atoi getInfo l "auto" then _rfltimer _starttimer _channel 1000 @cbtim 0 else nil; let _DMSgetZone this "Button" nil @_resizeI nil ->[win x y w h] in if win==nil then nil else ( let _checkpack getInfo l "bmp" -> bmpfile in if bmpfile==nil then ( set button=_CRbutton _channel win x y w h 0 "Connection"; nil; ) else ( set bitmapori=_LDbitmap _channel bmpfile; if bitmapori==nil then set bitmapori=_LDjpeg _channel bmpfile else nil; if bitmapori==nil then ( set button=_CRbutton _channel win x y w h 0 "Connection"; nil ) else ( set button=_CRbuttonBitmap _channel win nil x y w h 0; _setBitmap button w h ) ); _CBbutton button @contactb 0; ) );;