/* Consult Editor - DMS - nov 98 - by Patrice FAVRE */ typeof dbname=ObjText;; typeof dblogin=ObjText;; typeof dbpassw=ObjText;; typeof ltab=ObjText;; typeof lcolname=ObjText;; typeof lcolemail=ObjText;; typeof wftab=ObjText;; typeof wtab=ObjText;; typeof wcolname=ObjText;; typeof wcolword=ObjText;; typeof wfcolname=ObjText;; typeof wfcolword=ObjText;; typeof nbmax=ObjText;; /* Nom des champs */ var F_DBNAME="DataBase Name";; var F_DBLOGIN="DataBase Login";; var F_DBPASSW="DataBase Password";; var F_LTABLE="Login Table";; var F_LCOLNAME="Login column";; var F_LCOLEMAIL="E-Mail column";; var F_WTABLE="Key Words Table";; var F_WCOLNAME="Login column";; var F_WCOLWORD="Key word column";; var F_NBMAX="Max number of elements";; /* Valeurs par défaut */ var DFT_TABLE="Table";; /*-----------------------*/ fun save(s,n)= ("action"::ACT_START::ACT_START::nil):: ("action"::ACT_DESTROY::ACT_DESTROY::nil):: ("event"::EVT_DESTROYED::EVT_DESTROYED::nil):: ("event"::EVT_SELECT::EVT_SELECT::nil):: ("eventC"::EVT_STARTED::EVT_STARTED::nil):: ("eventC"::EVT_SHOWN::EVT_SHOWN::nil):: ("zoneC"::Z_LIST::nil):: (KW_DBNAME::(_GETtext dbname)::nil):: (KW_DBLOGIN::(_GETtext dblogin)::nil):: (KW_DBPASSW::(_GETtext dbpassw)::nil):: (KW_LTABLE::(_GETtext ltab)::nil):: (KW_LCOLNAME::(_GETtext lcolname)::nil):: (KW_LCOLEMAIL::(_GETtext lcolemail)::nil):: (KW_WTABLE::(_GETtext wtab)::nil):: (KW_WCOLNAME::(_GETtext wcolname)::nil):: (KW_WCOLWORD::(_GETtext wcolword)::nil):: (KW_NBMAX::(_GETtext nbmax)::nil):: nil;; /*-----------------------*/ fun load (l)= _SETtext dbname getInfo l KW_DBNAME; _SETtext dblogin getInfo l KW_DBLOGIN; _SETtext dbpassw getInfo l KW_DBPASSW; _SETtext ltab getInfo l KW_LTABLE; _SETtext lcolname getInfo l KW_LCOLNAME; _SETtext lcolemail getInfo l KW_LCOLEMAIL; _SETtext wtab getInfo l KW_WTABLE; _SETtext wcolname getInfo l KW_WCOLNAME; _SETtext wcolword getInfo l KW_WCOLWORD; _SETtext nbmax getInfo l KW_NBMAX; 0;; /*-----------------------*/ fun rflSizeEditWin (wn, blurp, w, h)= _POSITIONtext dbname 95 5 w-110 20; _POSITIONtext dblogin 95 30 w-110 20; _POSITIONtext dbpassw 115 55 w-130 20; _POSITIONtext ltab 90 105 w/2-95 20; _POSITIONtext lcolname 115 150 w/2-165 20; _POSITIONtext lcolemail 115 175 w/2-165 20; _POSITIONtext wftab w/2+5 105 90 20; _POSITIONtext wtab w/2+95 105 w/2-100 20; _POSITIONtext wfcolname w/2+5 150 110 20; _POSITIONtext wcolname w/2+115 150 w/2-165 20; _POSITIONtext wfcolword w/2+5 175 110 20; _POSITIONtext wcolword w/2+115 175 w/2-165 20;; /*-----------------------*/ fun IniEditor (filename)= let [620 250] -> [w h] in let startEditor _channel nil nil nil w h WN_NORMAL EDITOR_NORMAL filename "dms/db/consult/consult.dmc" nil nil @load @save nil -> ed in let getEditWin ed -> editWin in ( _CRtext _channel editWin 5 5 85 20 ET_ALIGN_LEFT F_DBNAME; set dbname= _CReditLine _channel editWin 95 5 w-100 20 ET_DOWN|ET_AHSCROLL ""; _CRtext _channel editWin 5 30 85 20 ET_ALIGN_LEFT F_DBLOGIN; set dblogin= _CReditLine _channel editWin 95 30 w-100 20 ET_DOWN|ET_AHSCROLL ""; _CRtext _channel editWin 5 55 110 20 ET_ALIGN_LEFT F_DBPASSW; set dbpassw= _CReditLine _channel editWin 115 55 w-120 20 ET_PASSWORD|ET_DOWN|ET_AHSCROLL ""; _CRtext _channel editWin 5 105 85 20 ET_ALIGN_LEFT F_LTABLE; set ltab= _CReditLine _channel editWin 90 105 w/2-95 20 ET_DOWN|ET_AHSCROLL strcat DFT_TABLE "1"; _CRtext _channel editWin 5 150 110 20 ET_ALIGN_LEFT F_LCOLNAME; set lcolname= _CReditLine _channel editWin 115 150 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; _CRtext _channel editWin 5 175 110 20 ET_ALIGN_LEFT F_LCOLEMAIL; set lcolemail= _CReditLine _channel editWin 115 175 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; set wftab= _CRtext _channel editWin w/2+5 105 90 20 ET_ALIGN_LEFT F_WTABLE; set wtab= _CReditLine _channel editWin w/2+95 105 w/2-100 20 ET_DOWN|ET_AHSCROLL strcat DFT_TABLE "2"; set wfcolname= _CRtext _channel editWin w/2+5 150 110 20 ET_ALIGN_LEFT F_WCOLNAME; set wcolname= _CReditLine _channel editWin w/2+115 150 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; set wfcolword= _CRtext _channel editWin w/2+5 175 110 20 ET_ALIGN_LEFT F_WCOLWORD; set wcolword= _CReditLine _channel editWin w/2+115 175 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; _CRtext _channel editWin 5 225 130 20 ET_ALIGN_LEFT F_NBMAX; set nbmax= _CReditLine _channel editWin 135 225 40 20 ET_DOWN|ET_NUMBER "10"; _CBwinSize editWin @rflSizeEditWin 0; if filename==nil then nil else openDMI ed ); 0;;