/* Consult Client - DMS - nov 1998 by Patrice FAVRE */ typeof win=ObjWin;; typeof lstwin=ObjListTab;; typeof BSelect=ObjButton;; typeof BAnnul=ObjButton;; typeof LstLogin=[S r1];; typeof SelLogin=S;; var Rang=0;; defcom CSelName=SelName S;; /*-----------------------*/ fun _endCli(a)= _DMSdelete this;; /*-----------------------*/ fun _destroyE(a,b)= _endCli nil;; /*-----------------------*/ fun _resizeE(wn, Z, w, h)= _SIZElistTab lstwin w-10 h-35 5 5; _SIZEbutton BSelect 70 20 w/2-80 h-25; _SIZEbutton BAnnul 70 20 w/2+10 h-25;; /*-----------------------*/ fun _selectE(a,b)= _DMSsend this CSelName [ SelLogin ]; _ENbutton BSelect 0;; /*-----------------------*/ fun _selectLine(a,b,c)= if c>=0 then ( set SelLogin=nth_list LstLogin c; _ENbutton BSelect 1 ) else _ENbutton BSelect 0;; /*-----------------------*/ fun AffList()= let _DMSgetZone this Z_LIST nil nil @_endCli -> [wn x y w h] in ( if wn==nil then ( set w=450; set h=300; set win=_CRwindow _channel DMSwin nil nil w h WN_MENU|WN_MINBOX|WN_SIZEBOX TIT_LIST ) else set win=_CRwindow _channel wn x y w h WN_CHILDINSIDE|WN_NOCAPTION|WN_NOBORDER ""; /* Listbox */ set lstwin=_CRlistTab _channel win 5 5 w-10 h-35 LV_SINGLESEL|LV_DOWN; _ADDlistTabColumn lstwin 0 (w-10)/3-52 ET_ALIGN_LEFT COL_LOGIN; _ADDlistTabColumn lstwin 1 70 ET_ALIGN_LEFT COL_CNX; _ADDlistTabColumn lstwin 2 2*(w-10)/3-21 ET_ALIGN_LEFT COL_MOTS; /* Bouton validation */ set BSelect=_CRbutton _channel win w/2-80 h-25 70 20 0 B_SELECT; _ENbutton BSelect 0; _CBbutton BSelect @_selectE nil; set BAnnul=_CRbutton _channel win w/2+10 h-25 70 20 0 B_CANCEL; _CBbutton BAnnul @_destroyE nil; _CBwinDestroy win @_destroyE nil; _CBwinSize win @_resizeE nil; _CBlistTabSelect lstwin @_selectLine nil );; /*-----------------------*/ fun IniDMI(param)= _DMSregisterDMI this nil nil; AffList; _DMSevent this EVT_STARTED nil nil;; /*-----------------------*/ fun conc(p,q)= if p==nil then q else (hd p)::conc (tl p) q;; /*-----------------------*/ fun __AddElem(nom, mots, cnx)= if (strlen nom) == 0 then _DMSevent this EVT_SHOWN nil nil else ( set LstLogin = conc LstLogin nom::nil; _ADDlistTabItem lstwin Rang Rang nom; _SETlistTabItem lstwin Rang 1 cnx; _SETlistTabItem lstwin Rang 2 mots; set Rang=Rang+1 );;