Page 1 of 1

Bitmaps on listbox

Posted: Tue Jul 07, 2009 10:07 am
by Silvio
I cannot see the bitmaps

why ?

Code: Select all

#include "FWCE.ch"


#Define EVENT_SIP 224

REQUEST DBFCDX

Static lsave:=.f.

FUNCTION Main()

local oDlgClient , oTabs
local oLbx
local cVar
local aHBitMaps:=Array( 5 )
local n


aHBitMaps:= { ReadBitmap( 0, CurDir() +"\Level1.bmp" ), ; // BitMaps de 10x10
                     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->(DbSetIndex( CurDir() + "\CliName" ))
Clientes->( OrdSetFocus( "CliName" ) )
Clientes->( DbGoTop() )


DEFINE DIALOG oDlgClient TITLE "Clients"

@ 0, 0.2 LISTBOX oLbx FIELDS aHBitmaps[ Max( 1, Clientes->Nivel ) ],;
                              Clientes->Nombre, AllTrim( Clientes->Direccion ),;
                              Clientes->Telefono,;
                              Str( Clientes->Edad, 3 ) ;
          HEADERS    "L", "Name", "Address", "Phone", "Age" ;
          FIELDSIZES 16, 222, 213, 58, 24 ;
          SIZE 118, 132  OF oDlgClient



oLbx:nClrPane := { || If( OrdKeyNo() % 2 == 0, RGB( 230, 230, 230), RGB( 190, 215, 190 ) ) }

oLbx:nClrForeHead:=CLR_BLUE

*oLbx::bKeyDown :={|nKey| Val_nKey(nKey,oDlg)}

oDlgClient:bSettingChange := {|uVal|PocketEvent( uVal,oDlgClient,olbx ) }

ACTIVATE DIALOG oDlgClient;
ON INIT ( SetOKButton( oDlgClient:hWnd ),;
DlgFullScreen( oDlgClient:hWnd ), ;
oDlgClient:SetMenu( DialogBar(oDlgClient,oLbx) ) )



AEval( aHBitmaps, { | hBmp | DeleteObject( hBmp ) } )
Clientes->(DbCloseArea())
RETU NIL