/* ContX Client - DMS - may 1999 by Patrice FAVRE */ typeof CLSID=GUID;; typeof listAct=[[S S] r1];; typeof listEvt=[[S S] r1];; typeof ax=AX;; typeof listFunc=[AXFun r1];; typeof axWin=ObjWin;; /*-----------------------*/ fun concLst(l1,l2)= if l1==nil then l2 else (hd l1)::(concLst tl l1 l2);; /*-----------------------*/ fun findAct(a,x)= let a -> [_ alias] in !strcmp alias x;; /*-----------------------*/ fun findEvt(a,x)= let a -> [_ alias] in !strcmp alias x;; /*-----------------------*/ fun findFunc(a,x)= let _AXGetFuncInfo a -> [fname _ _ _] in !strcmp fname x;; /*-----------------------*/ fun axResize(c,z)= let c -> [_ x y w h] in ( _SIZEwindow axWin w h x y; _AXSetSize ax 0 0 w h ); 0 ;; /*-----------------------*/ fun axDestroy(z)= _fooS "axDestroy 0"; _AXDestroyInstance _fooI ax; _fooS "axDestroy 1"; _DMSreleaseZone this z; _fooS "axDestroy 2"; _DMSdelete this; _fooS "axDestroy 3"; 0 ;; /*-----------------------*/ fun axEvent(A,u,ename,p)= let search_in_list listEvt @findEvt ename -> [_ alias] in if alias!=nil then _DMSevent this alias strbuild p::nil nil else nil; hd p;; /*-----------------------*/ fun getIntFunc(int,u)= let _AXGetInterfaceInfo int -> [_ _ _ ityp] in if ityp==0 then set listFunc=concLst _AXGetFuncList int listFunc else nil ;; /*-----------------------*/ fun action(from,act,param,rep)= if !strcmp act "show" then if axWin==nil then let _DMSgetZone this "axSite" nil @axResize @axDestroy -> [wn x y w h] in if wn!=nil then ( set ax=_AXCreateInstance _channel CLSID; if ax==nil then ( _DMSreleaseZone this "axSite"; _DMSevent this "notfound" nil nil ) else ( set axWin=_CRwindow _channel wn x y w h WN_CHILDINSIDE|WN_NOBORDER ""; apply_on_list _AXEnumInterfaces ax @getIntFunc nil; _AXrflEvent ax @axEvent nil; _AXSetSite axWin ax; _DMSevent this "shown" nil nil ) ) else nil else _DMSevent this "shown" nil nil else if !strcmp act "hide" then ( if axWin!=nil then ( _AXDestroyInstance ax; _DMSreleaseZone this "axSite"; set axWin=nil; ) else nil; _DMSevent this "hidden" nil nil ) else ( let search_in_list listAct @findAct act -> [func _] in if func!=nil then let search_in_list listFunc @findFunc func -> axfun in _AXCallFunc axfun _fooSList hd strextr param else nil; nil );; /*-----------------------*/ fun IniDMI(p)= _DMSregisterDMI this @action nil; set CLSID=_AXstring2GUID p;; /*-----------------------*/ fun __addAct(act,alias)= set listAct=[[act alias] listAct];; /*-----------------------*/ fun __addEvt(evt,alias)= set listEvt=[[evt alias] listEvt];; /*-----------------------*/ fun __go()= _DMSevent this "in" nil nil ;;