typeof plugin=S;; typeof class=S;; typeof CheckAutosave=ObjCheck;; typeof TextAutosaveDelay=ObjText;; typeof FileName=S;; var DefFileIni="Dms/3d/Plugins/DynEditor/dyneditor.ini";; fun InstName(UI)=UI.nameInst;; fun InstParam(UI)=UI.paramInst;; proto save=fun [ [Inst r1] ] [[S r1] [S r1] [[S r1]r1] [[S r1]r1]];; fun save(l)= if l==nil then [nil nil nil nil] else let l -> [UI nl] in let (InstName UI) -> name in [nil /* registerF */ nil ("plugin"::plugin::nil)::nil /* supplemental Dat */ ("actionC"::(strcatn name::".init"::nil)::nil):: ("action" ::(strcatn name::".edit"::nil)::nil):: ("eventC" ::(strcatn name::".register"::nil)::nil):: ("eventC" ::(strcatn name::".unregister"::nil)::nil):: ("eventC" ::(strcatn name::".initOK"::nil)::nil):: ("eventC" ::(strcatn name::".posAdded"::nil)::nil):: /* Tony: Rajouté */ ("zoneC" ::"MenuButtons"::nil):: nil ];; fun CBcheckAutosave (check, param, state) = _ENtext TextAutosaveDelay state ;; fun VerifyDelay (val) = if (atoi val) < 30 then "30" else val ;; fun CBtextDelay (text, param, val) = _SETtext text VerifyDelay val ;; fun openDynEdit(win,param)= let strextr param -> l in let let getInfo l "autosave" -> tmp in if tmp == nil then 1 else atoi tmp -> autosave in let let getInfo l "autosavedelay" -> tmp in if tmp == nil then "100" else tmp -> autodelay in let _GETwindowSizePosition win -> [w h x y] in { set CheckAutosave = _CBcheck (_SETcheck (_CRcheck _channel win 5 5 130 16 0 "Autosave site on disk") autosave) @CBcheckAutosave nil; _CRtext _channel win 5 25 150 16 ET_ALIGN_RIGHT "Autosave delay (in seconds) :"; set TextAutosaveDelay = _CBlineOk (_ENtext (_CReditLine _channel win 160 25 40 16 ET_BORDER autodelay) autosave) @CBtextDelay nil; _CRtext _channel win 5 45 300 16 ET_ALIGN_LEFT "Autosave delay cannot be lower than 30 seconds."; 0 };; fun closeDynEdit()= strbuild ("ini"::DefFileIni::nil):: ("autosave"::(itoa _GETcheck CheckAutosave)::nil):: ("autosavedelay"::(VerifyDelay (_GETtext TextAutosaveDelay))::nil):: nil ;; fun cbPro () = let "000000000" /*Tony:BigToAsc BigInvn BigFromAsc _getpack _checkpack "dms/3d/plugins/dyneditor/dyneditor.conf" BigFromAsc "93ff4009011b14e5"*/ -> s in let if (strlen s)!=9 then nil else [htoi substr s 1 4 htoi substr s 5 4] -> [datedebut periode] in if periode==nil then (_DLGMessageBox _channel nil _locEditor "PRO_WARNING" nil _locEditor "PRO_INVALID_MSG" nil 0;0) else if periode==0 then 1 else let ((time>>1)&0x3fffffff)/43200-datedebut -> x in if x<0 then (_DLGMessageBox _channel nil _locEditor "PRO_WARNING" nil _locEditor "PRO_INVALID_MSG" nil 0;0) else if x<=periode then (_DLGMessageBox _channel nil _locEditor "PRO_WARNING" nil _locEditor "PRO_LIMITED_MSG" (itoa (periode-x))::nil 0;1) else (_DLGMessageBox _channel nil _locEditor "PRO_WARNING" nil _locEditor "PRO_ENDLIMITED_MSG" nil 0;0) ;; fun IniPlug(file)= set plugin=file; set class=getInfo strextr _getpack _checkpack file "name"; PlugRegisterPro class @cbPro; PlugRegister class @save nil @openDynEdit @closeDynEdit ;;