/************************************************** Module Template Editor part Version: 1.0 Author: Sebastien DENEUX & Julien Zorko Last update: 28/02/2001 Template Module **************************************************/ typeof TemplateEditor = Editor;; typeof EditorWin = ObjWin ;; typeof check = ObjCheck ;; fun cbLoad(list) = _SETcheck check atoi hd hd strextr (getInfo list "distinct"); 0 ;; /******************************************************************************* save modifications a -> S : not used b -> S : not used editor -> Editor : editor <- [[S r1] r1] : the dmi contents *******************************************************************************/ fun cbSave (a, b) = let itoa _GETcheck check -> tmp in ("action"::"start"::nil):: ("actionC"::"show"::nil):: ("actionC"::"hide"::nil):: ("event"::"entering"::nil):: ("eventC"::"in"::nil):: ("event"::"out"::nil):: ("eventC"::"shown"::nil):: ("eventC"::"hidden"::nil):: ("distinct"::tmp::nil):: nil ;; fun cbPro () = let BigToAsc BigInvn BigFromAsc _getpack _checkpack "dms/db/dbrequest/dbrequest.conf" BigFromAsc "e7072fd625cc61ef" -> 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) ;; /******************************************************************************* main function called when the editor is starting. The openDMI function must be called at the end in order to load the data if the module has already been edited. s -> S : obsolete (unused) <- I : nothing special *******************************************************************************/ fun IniEditor (s) = set TemplateEditor = _StartEditor _channel nil nil nil 300 20 WN_NORMAL EDITOR_NORMAL @cbLoad @cbSave @cbPro; set EditorWin = getEditWin TemplateEditor ; set check = _CRcheck _channel EditorWin 0 0 300 20 CH_TABFOCUS (_locEditor "SEL_DISTINCT" nil); openDMI TemplateEditor; 0 ;;