I wish show the image with a dialog and Have the possibility to insert a new image from xbrowse directly
I have a dbf with this structure
DbCreate(cDir+'TT', {{'Codice' , 'C', 4, 0} ,;
{'Descri' , 'C', 60, 0} ,;
{'Image' , 'C', 60, 0}}, 'DBFCDX')
And I want create a xbrowse
oApp():oGrid := TXBrowse():New( oApp():oDlg )
....
aBrowse := { { { || TT->CODICE }, i18n("Codice"), 80 },;
{ { || TT->DESCRI }, i18n("Descrizione"),200 },;
{ { || TT->IMAGE }, i18n("Immagine"), 50 } }
FOR i := 1 TO Len(aBrowse)
oCol := oApp():oGrid:AddCol()
oCol:bStrData := aBrowse[ i, 1 ]
oCol:cHeader := aBrowse[ i, 2 ]
oCol:nWidth := aBrowse[ i, 3 ]
NEXT
then I want insert a new column ([4])
for make a selection for images
oCol := oApp():oGrid:AddCol()
oCol:cHeader :=""
oCol:nWidth :=60
and then I insert these lines
WITH OBJECT oApp():oGrid
WITH OBJECT oApp():oGrid:aCols[3]
:nEditType := TYPE_IMAGE
:lBmpStretch := .t.
:lBmpTransparent := .t.
:bBmpData := {|oCol, oGrid| oApp():oGrid:aRow[ 4 ] }
:nDataBmpAlign := AL_CENTER
END
WITH OBJECT oApp():oGrid:aCols[4]
:nEditType := EDIT_BUTTON
:bEditBlock := {|nRow, nCol, oCol| oCol:Value := cGetFile( "*.*", "Select a file" ) }
END
END
oApp():oGrid:SetRDD()
oApp():oGrid:CreateFromCode()
Error description: Error BASE/1068 Parametro errato: accesso all'array
why it is wrong ?