/* Sequence Editor - DMS - feb 98 - by Sylvain HUET */ /* Rev. Aug. '98 _ by Marc BARILLEY */ typeof nb=CompText;; typeof oneByOne = CompCheck;; typeof allAtATime = CompCheck;; typeof ed = Editor;; fun load (l) = _SETcompText nb getInfo l "sequence" nil nil CT_NOCHANGE; let getInfo l "mode" -> mode in if !strcmp mode "OneByOne" then { _SETcompCheckState oneByOne CHK_CHECKED; _SETcompCheckState allAtATime CHK_UNCHECKED; } else { _SETcompCheckState oneByOne CHK_UNCHECKED; _SETcompCheckState allAtATime CHK_CHECKED; }; 0;; fun changeState (co1, co2_state)= let co2_state -> [co2 state] in if co1==co2 then nil else _SETcompCheckState co1 state;; fun rflCompCheckChanged (co, l, newstate)= apply_on_list l @changeState [co if newstate == CHK_CHECKED then CHK_UNCHECKED else CHK_CHECKED]; _PAINTcontainer getEditCont ed ;; fun getseq(n,l)= if n==nil || n<=0 then l else getseq n-1 ("event"::(strcat "out" itoa n)::nil)::l;; fun save (filename, n)= let atoi _GETcompText nb -> p in ("action"::"input"::nil):: ("sequence"::(itoa p)::nil):: ("mode"::(if _GETcompCheckState oneByOne then "OneByOne" else "AllAtATime")::nil):: getseq p nil;; fun IniEditor(s)= set ed = startEditor _channel nil 0 0 315 125 WN_NORMAL EDITOR_NORMAL s "Dms/Tools/Sequence/sequence.dmc" "Dms/Tools/Sequence/help.txt" "Dms/Tools/Sequence/sequence.bmp" @load @save nil; let getEditCont ed -> cont in let _GETcontainerPositionSize cont -> [xcont ycont wcont hcont] in { GRAPHICDRESSING_CRcompText _channel cont nil [5 5] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL|CT_RIGHT OBJ_CONTAINER_MOVE 100 25 (_locEditor "SEQUENCE_LENGTH" nil) Font [0xffffff 0 0 0] [0x303030 50]; set nb= _SETcompTextAuthorizedChar GRAPHICDRESSING_CRcompText _channel cont nil [110 5] OBJ_VISIBLE|OBJ_ENABLE|CT_EDITLINE OBJ_CONTAINER_MOVE wcont-215 25 "" Font [0xffffff 0 0 0] [0x303030 50] "0123456789"; set oneByOne = { GRAPHICDRESSING_CRcompText _channel cont nil [50 50] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL|CT_LEFT OBJ_CONTAINER_MOVE wcont-50 25 (_locEditor "ONE_BY_ONE" nil) Font [0xffffff 0 0 0] [0x303030 50]; GRAPHICDRESSING_CRcompCheck _channel cont nil [5 50] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_MOVE ; }; set allAtATime = { GRAPHICDRESSING_CRcompText _channel cont nil [50 85] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL|CT_LEFT OBJ_CONTAINER_MOVE wcont-50 50 (_locEditor "ALL" nil) Font [0xffffff 0 0 0] [0x303030 50]; GRAPHICDRESSING_CRcompCheck _channel cont nil [5 85] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_MOVE ; }; _CBcompCheckStateChanged oneByOne @rflCompCheckChanged oneByOne::allAtATime::nil; _CBcompCheckStateChanged allAtATime @rflCompCheckChanged oneByOne::allAtATime::nil; if s==nil then { _SETcompCheckState allAtATime CHK_CHECKED; nil } else openDMI ed; _PAINTcontainer cont; }; 0;;