HELP TO INSERT IMAGE ON XBROWSE

HELP TO INSERT IMAGE ON XBROWSE

Postby Silvio » Thu Mar 10, 2011 12:41 pm

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 ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: HELP TO INSERT IMAGE ON XBROWSE

Postby ukoenig » Thu Mar 10, 2011 1:39 pm

Hello Silvio,

I have shown a Solution for this in Your other Post.
What is wrong with it ?

Image

Best regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: HELP TO INSERT IMAGE ON XBROWSE

Postby Silvio » Thu Mar 10, 2011 7:45 pm

Uwe,
I pray to you to understand what I asked , sometimes !!!

on the other post you wrote something of wrong and here you made the same!

listen !

do you Know xbimg.prg ?

ok ..

I asked only how can I adapt the source code of xbimg.prg to mine application

I saw that all samples of xbrowse come wit arrays , when we try to create these samples with dbfs the sample not run ok

I want understand , how can I adapt the source code of xbimg.prg on the source I wrote on first message of this post

I wrote :

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 insert a image directly from xbrowse how can I do it ?

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 ?

if you see xbimg.prg you'll see I copyed the same source code but on my app not run
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 101 guests