/* Consult Editor - DMS - nov 98 - by Patrice FAVRE */ typeof server=ObjText;; typeof port=ObjText;; typeof before=ObjText;; typeof tafter=ObjText;; typeof after=ObjText;; typeof login_name=ObjCheck;; typeof other_name=ObjText;; typeof server_ip=ObjCheck;; typeof other_ip=ObjText;; /* Nom des champs */ typeof F_SERVER=S;; typeof F_REALNAME=S;; typeof F_HOST=S;; typeof F_PORT=S;; typeof F_BEFORE=S;; typeof F_AFTER=S;; typeof F_LOGIN=S;; typeof F_SERVER_IP=S;; fun iniFieldNames () = /* loc(set F_SERVER="SMTP Mail Server :";; ) */ set F_SERVER=(_locEditor "130-MAILED-smtpmailse" nil); /* loc(set F_REALNAME="Sender real name :";; ) */ set F_REALNAME=(_locEditor "140-MAILED-senderreal" nil); /* loc(set F_HOST="Sender host :";; ) */ set F_HOST=(_locEditor "150-MAILED-senderhost" nil); /* loc(set F_PORT="SMPT port :";; ) */ set F_PORT=(_locEditor "160-MAILED-smptport:" nil); /* loc(set F_BEFORE="Text before body";; ) */ set F_BEFORE=(_locEditor "170-MAILED-textbefore" nil); /* loc(set F_AFTER="Text after body";; ) */ set F_AFTER=(_locEditor "180-MAILED-textafterb" nil); /* loc(set F_LOGIN="login name";; ) */ set F_LOGIN=(_locEditor "190-MAILED-loginname" nil); /* loc(set F_SERVER_IP="Scol server IP";; ) */ set F_SERVER_IP=(_locEditor "200-MAILED-scolserver" nil);; /*-----------------------*/ fun rfl_login_name(B,u,etat)= if etat==1 then _ENtext _SETtext other_name "" 0 else _SETtextFocus _ENtext other_name 1;; /*-----------------------*/ fun rfl_server_ip(B,u,etat)= if etat==1 then _ENtext _SETtext other_ip "" 0 else _SETtextFocus _ENtext other_ip 1;; /*-----------------------*/ fun save(s,n)= ("action"::ACT_START::ACT_START::nil):: ("action"::ACT_SHOW::ACT_SHOW::nil):: ("action"::ACT_SEND::ACT_SEND::nil):: ("action"::ACT_DESTROY::ACT_DESTROY::nil):: ("event"::EVT_DESTROYED::EVT_DESTROYED::nil):: ("event"::EVT_SENT_OK::EVT_SENT_OK::nil):: ("event"::EVT_SENT_KO::EVT_SENT_KO::nil):: ("actionC"::ACT_HIDE::ACT_HIDE::nil):: ("eventC"::EVT_SHOWN::EVT_SHOWN::nil):: ("eventC"::EVT_HIDDEN::EVT_HIDDEN::nil):: ("eventC"::EVT_IN::EVT_IN::nil):: ("zoneC"::Z_MAIL::nil):: (KW_SMTP::(_GETtext server)::nil):: (KW_BEFORE::(_GETtext before)::nil):: (KW_AFTER::(_GETtext after)::nil):: (KW_PORT::(_GETtext port)::nil):: (KW_REALNAME::(itoa _GETcheck login_name)::(_GETtext other_name)::nil):: (KW_HOST::(itoa _GETcheck server_ip)::(_GETtext other_ip)::nil):: nil;; /*-----------------------*/ fun load (l)= _SETtext server getInfo l KW_SMTP; _SETtext before getInfo l KW_BEFORE; _SETtext after getInfo l KW_AFTER; _SETtext port getInfo l KW_PORT; let getInfos l KW_REALNAME -> [etat [name _]] in ( _SETcheck login_name atoi etat; rfl_login_name login_name nil atoi etat; if (atoi etat)==0 then _SETtext other_name name else nil ); let getInfos l KW_HOST -> [etat [ip _]] in ( _SETcheck server_ip atoi etat; rfl_server_ip server_ip nil atoi etat; if (atoi etat)==0 then _SETtext other_ip ip else nil ); _SETtextFocus server; 0;; /*-----------------------*/ fun rflSizeEditWin (wn, blurp, w, h)= _POSITIONtext server 5+6*strlen F_SERVER 5 w-10-6*strlen F_SERVER 20; _POSITIONtext port 5+6*strlen F_SERVER 30 30 20; _POSITIONtext other_name 5+6*strlen F_REALNAME 80 w-10-6*strlen F_REALNAME 20; _POSITIONtext other_ip 5+6*strlen F_HOST 130 w-10-6*strlen F_HOST 20; _POSITIONtext before 5 175 w-10 (h-205)/2; _POSITIONtext tafter 5 190+(h-205)/2 6*strlen F_AFTER 20; _POSITIONtext after 5 205+(h-205)/2 w-10 (h-205)/2;; /*-----------------------*/ fun IniEditor (filename)= let [315 480] -> [w h] in let startEditor _channel nil nil nil w h WN_NORMAL EDITOR_NORMAL filename "Dms/CommTools/Mail/mail.dmc" nil nil @load @save nil -> ed in let getEditWin ed -> editWin in ( iniFieldNames; _CRtext _channel editWin 5 5 6*strlen F_SERVER 20 ET_ALIGN_LEFT F_SERVER; set server=_CReditLine _channel editWin 5+6*strlen F_SERVER 5 w-10-6*strlen F_SERVER 20 ET_DOWN|ET_AHSCROLL ""; _CRtext _channel editWin 5 30 6*strlen F_PORT 20 ET_ALIGN_LEFT F_PORT; set port=_CReditLine _channel editWin 5+6*strlen F_SERVER 30 30 20 ET_DOWN|ET_AHSCROLL "25"; _CRtext _channel editWin 5 55 6*strlen F_REALNAME 20 ET_ALIGN_LEFT F_REALNAME; set login_name=_CBcheck _SETcheck _CRcheck _channel editWin 5+6*strlen F_REALNAME 55 30+6*strlen F_LOGIN 20 0 F_LOGIN 1 @rfl_login_name nil; set other_name=_ENtext _CReditLine _channel editWin 5+6*strlen F_REALNAME 80 w-10-6*strlen F_REALNAME 20 ET_DOWN|ET_AHSCROLL "" 0; _CRtext _channel editWin 5 105 6*strlen F_HOST 20 ET_ALIGN_LEFT F_HOST; set server_ip=_CBcheck _SETcheck _CRcheck _channel editWin 5+6*strlen F_HOST 105 30+6*strlen F_SERVER_IP 20 0 F_SERVER_IP 1 @rfl_server_ip nil; set other_ip=_ENtext _CReditLine _channel editWin 5+6*strlen F_HOST 130 w-10-6*strlen F_HOST 20 ET_DOWN|ET_AHSCROLL "" 0; _CRtext _channel editWin 5 160 6*strlen F_BEFORE 20 ET_ALIGN_LEFT F_BEFORE; set before=_CReditText _channel editWin 5 175 w-10 (h-205)/2 ET_DOWN|ET_HSCROLL|ET_VSCROLL ""; set tafter=_CRtext _channel editWin 5 190+(h-205)/2 6*strlen F_AFTER 20 ET_ALIGN_LEFT F_AFTER; set after= _CReditText _channel editWin 5 205+(h-205)/2 w-10 (h-205)/2 ET_DOWN|ET_HSCROLL|ET_VSCROLL ""; _CBwinSize editWin @rflSizeEditWin 0; if filename==nil then nil else openDMI ed ); 0;;