by Silvio » Mon May 11, 2009 12:25 pm
I have also the problem : I cannot see the bitmaps aHBitMaps
#include "FWCE.ch"
REQUEST DBFCDX
FUNCTION Main()
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->(DbSetIndex( CurDir() + "\CliName" ))
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
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
static Function DialogBar(oDlgClient,oLbx)
local oMenu
DEFINE MENU oMenu RESOURCE 103 ;
BITMAPS 11 ; // bitmap resources ID
IMAGES 6 // number of images in the bitmap
REDEFINE MENUITEM ID 113 OF oMenu ACTION EditClient( oLbx, .t. )
REDEFINE MENUITEM ID 114 OF oMenu ACTION EditClient( oLbx, .f. )
REDEFINE MENUITEM ID 115 OF oMenu ACTION DelClient( oLbx )
REDEFINE MENUITEM ID 116 OF oMenu ACTION (SeekClient( oLbx ),oLbx:Refresh())
REDEFINE MENUITEM ID 117 OF oMenu ACTION MsgInfo( "PRINT" )
REDEFINE MENUITEM ID 118 OF oMenu ACTION oDlgClient:End()
return oMenu
function EditClient( oLbx, lAppend )
local oDlg, oFld,oFont, oFont1
Local lSave :=.f.
lFivePro = "F" $ Clientes->Productos
lDialog = "D" $ Clientes->Productos
lObjects = "O" $ Clientes->Productos
nNivel = max( 1, Clientes->Nivel )
cName = Clientes->Nombre
cAddress = Clientes->Direccion
cPhone = Clientes->Telefono
nAge = Clientes->Edad
DEFINE FONT oFont NAME "Arial" SIZE 0, -8
DEFINE FONT oFont1 NAME "Arial" SIZE 0, -68
ShowKeyboard()
DEFINE DIALOG oDlg TITLE If( lAppend, "New", "Update" )
@ 0, 0 FOLDER oFld PROMPTS "Generale", "Dettagli", "Note" ;
SIZE 119,95
@ 1, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] SIZE 40,10
@ 2, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] SIZE 40,10
/*@ 11, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
@ 12, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] PIXEL
@ 13, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
@ 14, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] PIXEL
@ 15, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
@ 16, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] PIXEL
@ 17, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
/* @ 1, 0 GET cName OF oFld:aDialogs[ 1 ] size 40,10
@ 1, 6 GET cAddress OF oFld:aDialogs[ 1 ] size 40,10
@ 3, 1 TO 7, 8 LABEL "&Products" OF oFld:aDialogs[ 1 ]
@ 4, 2 CHECKBOX lFivePro PROMPT "&FivePro" OF oFld:aDialogs[ 1 ] size 40,10
@ 5, 2 CHECKBOX lDialog PROMPT "&Dialog" OF oFld:aDialogs[ 1 ] size 40,10
@ 6, 2 CHECKBOX lObjects PROMPT "&Objects"OF oFld:aDialogs[ 1 ] size 40,10
* @ 0.5, 1 GET cName1 SIZE 60, 20 OF oFld:aDialogs[ 1 ]
*/
ACTIVATE DIALOG oDlg ;
ON INIT ( DlgFullScreen( oDlg:hWnd ), oDlg:SetMenu( DialogButtons(oDlg) ) )
HideKeyboard()
IF lSave :=.t.
? "I'here"
ELSE
? "I'm not here"
ENDIF
return nil
Best Regards, Saludos
Falconi Silvio