listbox not indexed
Posted: Fri May 08, 2009 5:10 pm
why the records are not indexed ?
I made :
Code: Select all
STATIC FUNCTION Client()
local oDlgClient , oTabs
local oLbx
local cVar
local aHBitMaps:=Array( 5 )
local n
aHBitMaps:= { ReadBitmap( 0, CurDir() +"Level1.bmp" ), ; // BitMaps de 14 x 32
ReadBitmap( 0, CurDir() +"\Level2.bmp" ), ;
ReadBitmap( 0, CurDir() +"\Level3.bmp" ), ;
ReadBitmap( 0, CurDir() +"\Level4.bmp" ),;
ReadBitmap( 0, CurDir() +"\Level5.bmp" ) }
USE ( CurDir() + "\Clientes" ) VIA "DBFCDX"
if RecCount() == 0
APPEND BLANK
endif
if ! File( CurDir() + "\CliName.CDX" )
INDEX ON Clientes->Nombre TO ( CurDir() + "\CliName" )
endif
Clientes->( OrdSetFocus( "\CliName" ) )
Clientes->( DbGoTop() )
DEFINE DIALOG oDlgClient TITLE "Clienti"
@ 0, 0 LISTBOX oLbx FIELDS aHBitmaps[ Max( 1, Clientes->Nivel ) ],;
Clientes->Nombre,;
Clientes->Telefono,;
Str( Clientes->Edad, 3 ) ;
HEADERS "L", "Cognome e nome", "Telefono", "Ombrellone" ;
FIELDSIZES 16, 95, 80, 8 ;
SIZE 119, 140 OF oDlgClient
// Lets use different row colors
oLbx:nClrText = { || SelColor( Clientes->Nivel ) }
oLbx:nClrForeFocus = { || SelColor( Clientes->Nivel ) }
* oLbx:nClrPane = { | nCol | If( nCol = 2, CLR_HGREEN, ) }
* oLbx:nClrForeFocus= { || Colores( "CLIENTES") ) }
* oLbx:nClrText = { || Colores( "CLIENTES") ) }
ACTIVATE DIALOG oDlgClient;
ON INIT ( DlgFullScreen( oDlgClient:hWnd ), oDlgClient:SetMenu( DialogBar(oDlgClient,oLbx) ) )
AEval( aHBitmaps, { | hBmp | DeleteObject( hBmp ) } )
Clientes->(DbCloseArea())
RETU NIL