/******************************************************************************* Plugin Link Client part Version: 1.0 Author: Sebastien DENEUX Last update: 27/07/2001 *******************************************************************************/ /******************************************************************************* *******************************************************************************/ typeof class =S;; /* Plugin class name */ /******************************************************************************* Click action Callback ui -> UserI : user instance action -> S : action param -> S : parameters z -> [Ob I] : Ob and flat color <- I : not used *******************************************************************************/ fun cbResClick(ui,action,param,o)= if !strcmp param "0" then ( _DLGMessageBox _channel DMSwin "Warning" "Invalid Password" 0; 0 ) else nil ;; /******************************************************************************* Defines the callbacks of the links in the anchor, and return the list of them o -> Ob : Object obj -> Obj : mat -> HMat3d : material button -> I : flag for the mouse button (1 is the left one) <- I : not used *******************************************************************************/ fun cbClickLink(o,obj,mat,button) = if button==1 then UsendMessage ObUi o "click" nil else nil ;; /******************************************************************************* Defines the callbacks of the links in the anchor, and return the list of them <- [[H3d HMat3d S ObjCursor fun [Ob H3d HMat3d I] I fun [Ob H3d HMat3d I] I fun [Ob H3d HMat3d] I] r1] *******************************************************************************/ proto GetLinks = fun [[Anchor r1] S] [[H3d HMat3d S ObjCursor fun [Ob H3d HMat3d I] I fun [Ob H3d HMat3d I] I fun [Ob H3d HMat3d] I] r1];; fun GetLinks(l,text)= if l==nil then nil else match hd l with (objAnchor [ah am name _] -> ([ah am text HandCursor @cbClickLink nil nil]::(GetLinks tl l text))) | (_->(GetLinks tl l text)) ;; /******************************************************************************* New object creation o -> Ob : object <- I : not used *******************************************************************************/ fun newOb(o)= /* instance params */ let hd UgetParam ObUi o "alias" -> text in ObSetLinks o GetLinks ObAnchor o text; UcbMessage ObUi o ["resClick" mkfun4 @cbResClick o]::nil; 0 ;; /******************************************************************************* Function called when plugin is initialised file -> S : '*.plug' file name <- I : not used *******************************************************************************/ fun IniPlug(file)= set class=getInfo strextr _getpack _checkpack file "name"; PLUGsetinfo thisplug PLUGIN_ONLINE_EDITING|PLUGIN_NOTRESERVED|PLUGIN_MATERIAL; PLUGdefineEditor thisplug @dynamicedit; PlugRegister class @newOb nil; 0 ;;