/* Hide Editor - DMS - July 98 - by Patrick MARTY */ /* Hide Editor - DMS2 - Jun 99 - by Christophe LOREK */ typeof plugin=S;; typeof class=S;; /* vvv shall be removed when available in the UserInstance API vvv */ fun InstName(UI)=UI.nameInst;; /* ^^^ shall be removed when available in the UserInstance API ^^^ */ typeof CHkeepDynamicChanges = ObjCheck;; typeof CHinitState = ObjCheck;; typeof blank = ObjWin;; proto save=fun [[Inst r1]] [[S r1] [S r1] [[S r1] r1] [[S r1] r1]];; /* generates the list of supp. events for all the instances of the plugin. */ /*fun suppevents(l)= if l == nil then nil else let l -> [UI nl] in let (InstName UI) -> name in ("eventC"::(strcatn name::".Hidden"::nil)::nil):: ("eventC"::(strcatn name::".Shown"::nil)::nil):: (suppevents nl);;*/ /* generates the list of supp. actions for all the instances of the plugin. */ fun suppactions(l)= if l == nil then nil else let l -> [UI nl] in let (InstName UI) -> name in ("actionC"::(strcatn name::".Hide"::nil)::nil):: ("actionC"::(strcatn name::".Show"::nil)::nil):: ("actionC"::(strcatn name::".HideOrShow"::nil)::nil):: ("action"::(strcatn name::".HideS"::nil)::nil):: ("action"::(strcatn name::".ShowS"::nil)::nil):: ("action"::(strcatn name::".HideOrShowS"::nil)::nil):: (suppactions nl);; fun save(l)= if l==nil then [nil nil nil nil] else [ /* registerF */ nil /* register */ nil /* supplemental dat */ ("plugin"::plugin::nil)::nil /* supplemental dmi */ /*listcat*/ (suppactions l) /*(suppevents l)*/ ];; fun openedit(win,param)= let strextr param -> l in let _GETwindowSizePosition win -> [w h x y] in ( set CHkeepDynamicChanges = _CRcheck _channel win 5 5 200 16 0 "keep dynamic changes"; let getInfo l "keepDynamicChanges" -> string in if (nil == string || !atoi string) then _SETcheck CHkeepDynamicChanges 0 else _SETcheck CHkeepDynamicChanges 1; set CHinitState = _CRcheck _channel win 5 35 200 16 0 "hidden at startup"; let getInfo l "initState" -> string in if (nil == string || !atoi string) then _SETcheck CHinitState 0 else _SETcheck CHinitState 1; 0 );; fun closedit()= strbuild ("keepDynamicChanges"::(itoa _GETcheck CHkeepDynamicChanges)::nil):: ("initState"::(itoa _GETcheck CHinitState)::nil)::nil;; fun IniPlug(file)= set plugin=file; set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @save nil @openedit @closedit;;