/* Nav Client - DMS - aug 98 - by Sylvain HUET */ defcom Cregister=register;; typeof nav=Nav;; typeof focus=DMI;; typeof reply=S;; var bmpname="";; var horiz=0;; fun navig(v,w,f)= let v->[x y z] in let w->[a b c] in let strbuild ((itoh x)::(itoh y)::(itoh z)::(itoh a)::(itoh b)::(itoh c)::(itoh f)::nil)::nil -> msg in (_DMSreply this focus reply msg nil; _DMSevent this "Command" msg nil);; fun activate(from,action,param,rep)= if !strcmp action "getMotion" then (set focus=from; set reply=rep;0) else nil;; fun _end(a)= _DMSdelete this;; fun _resize(x,s)= let x->[wn x y w h] in _SIZEwindow nav.winNav w h x y; 0;; fun downok(file)= let _DMSgetZone this "Nav" @_end @_resize @_end ->[wn x y w h] in set nav=if wn==nil then iniNav _channel DMSwin nil nil 240 64 "Navigation" @navig 0 StdCursor CrossCursor horiz bmpname else iniNav _channel wn x y w h "Navigation" @navig 1 StdCursor CrossCursor horiz bmpname; _DMSsend this Cregister []; 0;; fun IniDMI(param)= _DMSregisterDMI this @activate nil; let hd strextr param->[a[b _]] in ( set bmpname= if b==nil then strcat _DMSgetpath _DMSgetClass this "ressources/movingball.jpg" else b; set horiz=atoi a ); _RSCdownload this bmpname bmpname @downok 3 ;;