/* Items2 Editor - DMS - march 99 - by Sebastien DENEUX */ typeof open=ObjCheck;; typeof dbname=ObjText;; typeof dblogin=ObjText;; typeof dbpassw=ObjText;; typeof dbsql=ObjText;; fun save(s,n)= ("action"::"start"::"start"::nil):: ("action"::"destroy"::"destroy"::nil):: ("event"::"started"::"started"::nil):: ("event"::"destroyed"::"destroyed"::nil):: ("dbname"::(_GETtext dbname)::nil):: ("dblogin"::(_GETtext dblogin)::nil):: ("dbpassw"::(_GETtext dbpassw)::nil):: ("dbsql"::(_GETtext dbsql)::nil):: nil;; fun load (l)= _SETtext dbname getInfo l "dbname"; _SETtext dblogin getInfo l "dblogin"; _SETtext dbpassw getInfo l "dbpassw"; _SETtext dbsql getInfo l "dbsql"; 0;; fun rflSizeEditWin (wn, blurp, w, h)= _SIZEtext dbname w-100 20 95 5; _SIZEtext dblogin w-100 20 95 30; _SIZEtext dbpassw w-120 20 115 55; _SIZEtext dbsql w-10 h-130 5 105;; fun IniEditor (filename)= let [315 350] -> [w h] in let startEditor _channel nil nil nil w h WN_NORMAL EDITOR_NORMAL filename "Dms/Db/Items2/Items2.dmc" nil nil @load @save nil -> ed in let getEditWin ed -> editWin in ( _CBwinSize editWin @rflSizeEditWin 0; _CRtext _channel editWin 5 5 85 20 ET_ALIGN_LEFT "DataBase Name"; set dbname= _CReditLine _channel editWin 95 5 w-100 20 ET_DOWN|ET_AHSCROLL ""; _CRtext _channel editWin 5 30 85 20 ET_ALIGN_LEFT "DataBase Login"; set dblogin=_CReditLine _channel editWin 95 30 w-100 20 ET_DOWN+ET_AHSCROLL ""; _CRtext _channel editWin 5 55 110 20 ET_ALIGN_LEFT "DataBase Password"; set dbpassw=_CReditLine _channel editWin 115 55 w-120 20 ET_PASSWORD|ET_DOWN|ET_AHSCROLL ""; _CRtext _channel editWin 5 85 305 20 ET_ALIGN_LEFT "SQL Request"; set dbsql= _CReditText _channel editWin 5 105 w-10 h-130 ET_DOWN|ET_HSCROLL|ET_VSCROLL "pseudo1\nSELECT pseudo1 from tableUsers where login = ?;\npseudo2\nSELECT pseudo2 from tableUsers where login = ?;"; if filename==nil then nil else openDMI ed ); 0;;