/* Items Editor - DMS - jan 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"::"editUser"::"editUser"::nil):: ("action"::"editAdmin"::"editAdmin"::nil):: ("action"::"getItems"::"addItems"::nil):: ("action"::"destroy"::"destroy"::nil):: ("action"::"add"::"add"::nil):: ("action"::"sub"::"sub"::nil):: ("eventC"::"in"::"in"::nil):: ("event"::"destroyed"::"destroyed"::nil):: ("zoneC"::"ZoneEdition"::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 IniEditor (filename)= let startEditor _channel nil 0 0 325 310 WN_NORMAL EDITOR_NORMAL filename "Dms/Db/Items/Items.dmc" nil nil @load @save nil -> ed in let getEditWin ed -> edWin in ( /* loc( _CRtext _channel edWin 5 5 140 20 ET_ALIGN_LEFT "DataBase Name"; ) */ _CRtext _channel edWin 5 5 140 20 ET_ALIGN_LEFT (_locEditor "450-ITEMSE-databasena" nil); set dbname= _CReditLine _channel edWin 160 5 160 20 ET_DOWN|ET_AHSCROLL "toto"; /* loc( _CRtext _channel edWin 5 30 140 20 ET_ALIGN_LEFT "DataBase Login"; ) */ _CRtext _channel edWin 5 30 140 20 ET_ALIGN_LEFT (_locEditor "480-ITEMSE-databaselo" nil); /* loc( set dblogin=_CReditLine _channel edWin 160 30 160 20 ET_DOWN+ET_AHSCROLL "Admin"; ) */ set dblogin=_CReditLine _channel edWin 160 30 160 20 ET_DOWN+ET_AHSCROLL (_locEditor "490-ITEMSE-admin" nil); /* loc( _CRtext _channel edWin 5 55 140 30 ET_ALIGN_LEFT "DataBase Password"; ) */ _CRtext _channel edWin 5 55 140 30 ET_ALIGN_LEFT (_locEditor "510-ITEMSE-databasepa" nil); set dbpassw=_CReditLine _channel edWin 160 60 160 20 ET_PASSWORD|ET_DOWN|ET_AHSCROLL ""; /* loc( _CRtext _channel edWin 5 90 100 20 ET_ALIGN_LEFT "SQL Request"; ) */ _CRtext _channel edWin 5 90 100 20 ET_ALIGN_LEFT (_locEditor "540-ITEMSE-sqlrequest" nil); set dbsql= _CReditText _channel edWin 5 115 315 200 ET_DOWN|ET_VSCROLL "SELECT refItem, nameItem, countItem FROM tableItems WHERE login = ?"; if filename==nil then nil else openDMI ed ); 0;;