/* Sequence Cooperative Editor - DMS - February 2003 - by Bob Le Gob */ /******************************************************************************* Variables *******************************************************************************/ typeof ctxtNb = CompText;; typeof ed = Editor;; /******************************************************************************* Functions *******************************************************************************/ /******************************************************************************* GetSeq() - Saving supplemental DMI data n -> I : Outputs count l -> [[S r1] r1] : Supplemental data being buildt <- [[S r1] r1] : Supplemental data *******************************************************************************/ fun GetSeq(n, l) = if ((n == nil) || (n <= 0)) then l else GetSeq (n - 1) ("event"::(strcat "out" itoa n)::nil)::l;; /******************************************************************************* Editor's main callbacks *******************************************************************************/ /******************************************************************************* cbLoad() - Standard callback - Loading parameters l -> [[S r1] r1] : DMI block <- I : Not used *******************************************************************************/ fun cbLoad(l) = _SETcompText ctxtNb getInfo l "sequence" nil nil CT_NOCHANGE; 0;; /******************************************************************************* cbSave() - Standard callback - Saving parameters filename -> S : Not used n -> S : Not used <- [[S r1] r1] : DMI block *******************************************************************************/ fun cbSave (filename, n) = let atoi _GETcompText ctxtNb -> p in ("action"::"register"::nil):: ("action"::"unregister"::nil):: ("action"::"inputOneByOne"::nil):: ("action"::"inputAllAtOnce"::nil):: ("event"::"registered"::nil):: ("event"::"unregistered"::nil):: ("sequence"::(itoa p)::nil):: GetSeq p nil;; /******************************************************************************* Editor's main function *******************************************************************************/ /******************************************************************************* IniEditor() - Standard IniEditor function param -> S : Not used <- I : Not used *******************************************************************************/ fun IniEditor(s)= set ed = startEditor _channel nil 0 0 315 40 WN_NORMAL EDITOR_NORMAL nil nil nil nil @cbLoad @cbSave 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 ctxtNb= _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"; openDMI ed; _PAINTcontainer cont; }; 0;;