/* Nav2 Editor - DMS - Aug. '98 - by Sylvain HUET */ /* Rev. Sep. '98 - by Marc BARILLEY */ typeof tbitmap=ObjText;; typeof horiz=ObjCheck;; typeof editWin = ObjWin;; var DEFAULT_SKIN = "dms/interf/nav2/ressources/movingball.jpg";; /* SCS editor */ 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 "260-NAV2ED-warning" nil) /* loc( "This file is not a correct bitmap file" 0;nil) ) */ (_locEditor "270-NAV2ED-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 "350-NAV2ED-bitmap" nil) (_locEditor "351-NAV2ED-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 load (l) = let getInfo l "bmp" -> bmp in if bmp == nil then _SETtext tbitmap DEFAULT_SKIN else _SETtext tbitmap bmp; _SETcheck horiz atoi getInfo l "horizontal"; 0;; fun save (filename, n)= ("registerF"::(_GETtext tbitmap)::nil):: ("action"::"start"::"start"::nil):: ("action"::"destroy"::"destroy"::nil):: ("actionC"::"getMotion"::nil):: ("event"::"entering"::"entering"::nil):: ("event"::"destroyed"::"destroyed"::nil):: ("eventC"::"Command"::nil):: ("zoneC"::"Nav"::nil):: ("bmp"::(_GETtext tbitmap)::nil):: ("horizontal"::(itoa _GETcheck horiz)::nil):: nil;; fun IniEditor(s)= let [315 55] -> [w h] in let startEditor _channel nil nil nil w h WN_MENU EDITOR_NORMAL s "dms/interf/nav2/nav2.dmc" nil nil @load @save nil -> ed in ( set editWin = getEditWin ed; /* loc( _CBbutton _CRbutton _channel editWin 5 5 50 20 0 "Bitmap :" @_display 0; ) */ _CBbutton _CRbutton _channel editWin 5 5 50 20 0 (_locEditor "740-NAV2ED-bitmap:" nil) @_display 0; set tbitmap=_CRtext _channel editWin 60 5 w-120 20 ET_AHSCROLL+ET_DOWN DEFAULT_SKIN; /* loc( _CBbutton _CRbutton _channel editWin w-55 5 50 20 0 "Change" @_change 0; ) */ _CBbutton _CRbutton _channel editWin w-55 5 50 20 0 (_locEditor "760-NAV2ED-change" nil) @_change 0; /* loc( set horiz=_CRcheck _channel editWin 5 30 w-10 20 0 "Horizontal Navigation Bar"; ) */ set horiz=_CRcheck _channel editWin 5 30 w-10 20 0 (_locEditor "770-NAV2ED-horizontal" nil); if s==nil then nil else openDMI ed ); 0;;