/* Contact Editor - DMS - Apr 98 - by Sylvain HUET */ /* Rev. Aug. '98 - by Marc BARILLEY */ /* Rev. Mar. '99 - by Patrice FAVRE */ typeof auto=ObjCheck;; typeof tbitmap=ObjText;; typeof editWin=ObjWin;; fun _paintWn(w,b)=_BLTbitmap w b 0 0;; fun _destroyWn(w,b)=_DSbitmap b;; fun resbitmap(a,b,r)= let b->[wn newbmp name] in (if !r then nil else _SETtext tbitmap name; _DSwindow wn; _DSbitmap newbmp);; fun _OpenBmp(d,b,s)= let _PtoScol s -> name in if name==nil then nil else (let _LDbitmap _channel s -> bmp0 in let if bmp0==nil then _LDjpeg _channel s else bmp0 -> newbmp in if newbmp==nil then /* loc( (_DLGMessageBox _channel editWin "Warning" ) */ (_DLGMessageBox _channel editWin (_locEditor "250-CONTAC-warning" nil) /* loc( "This file is not a correct bitmap file" 0;nil) ) */ (_locEditor "260-CONTAC-thisfileis" nil) 0;nil) else let _GETbitmapSize newbmp -> [w h] in let _CRwindow _channel editWin 10 10 w h WN_MENU+WN_MINBOX name -> wn in (_CBwinPaint wn @_paintWn newbmp; _CBwinDestroy wn @_destroyWn newbmp; _paintWn wn newbmp; if b then nil else _DLGrflmessage /* loc( _DLGMessageBox _channel wn "Bitmap" "Do you want to use this bitmap ?" 2 ) */ _DLGMessageBox _channel wn (_locEditor "340-CONTAC-bitmap" nil) (_locEditor "341-CONTAC-doyouwantt" nil) 2 @resbitmap [wn newbmp name]; 0));; fun _display(a,b)= _OpenBmp nil 1 _checkpack _GETtext tbitmap;; fun _change(a,b)= _DLGrflopen (_DLGOpenFile _channel editWin nil nil "bitmap (*.bmp,*.jpg)\0*.BMP;*.JPG\0\0") @_OpenBmp 0;; fun _remove(a,b)= _SETtext tbitmap ""; 0;; fun load (l) = _SETcheck auto atoi getInfo l "auto"; _SETtext tbitmap getInfo l "bmp"; 0;; fun save (s,n)= ("zone"::"Button"::nil):: ("action"::"contact"::nil):: ("auto"::(itoa _GETcheck auto)::nil):: ("bmp"::(_GETtext tbitmap)::nil):: nil;; fun IniEditor (filename)= let [315 80] -> [w h] in let startEditor _channel nil nil nil w h WN_NORMAL EDITOR_NORMAL filename "dms/admin/contact/contact.dmc" nil nil @load @save nil -> ed in ( set editWin = getEditWin ed; /* loc( set auto = _CRcheck _channel editWin 5 0 200 20 0 "AutoStart"; ) */ set auto = _CRcheck _channel editWin 5 0 200 20 0 (_locEditor "700-CONTAC-autostart" nil); /* loc( _CBbutton _CRbutton _channel editWin 5 30 50 20 0 "Bitmap :" @_display 0; ) */ _CBbutton _CRbutton _channel editWin 5 30 50 20 0 (_locEditor "710-CONTAC-bitmap:" nil) @_display 0; set tbitmap=_CRtext _channel editWin 60 30 w-120 20 ET_AHSCROLL+ET_DOWN ""; /* loc( _CBbutton _CRbutton _channel editWin w-55 30 50 20 0 "Change" @_change 0; ) */ _CBbutton _CRbutton _channel editWin w-55 30 50 20 0 (_locEditor "730-CONTAC-change" nil) @_change 0; /* loc( _CBbutton _CRbutton _channel editWin w-55 50 50 20 0 "Remove" @_remove 0; ) */ _CBbutton _CRbutton _channel editWin w-55 50 50 20 0 (_locEditor "740-CONTAC-remove" nil) @_remove 0; if filename==nil then nil else openDMI ed ); 0;;