FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour HELP TO INSERT IMAGE ON XBROWSE
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
HELP TO INSERT IMAGE ON XBROWSE
Posted: 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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: HELP TO INSERT IMAGE ON XBROWSE
Posted: Thu Mar 10, 2011 01:39 PM
Hello Silvio,

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



Best regards
Uwe :-)
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.
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: HELP TO INSERT IMAGE ON XBROWSE
Posted: Thu Mar 10, 2011 07: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():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():AddCol()
oCol:cHeader :=""
oCol:nWidth :=60


and then I insert these lines
WITH OBJECT oApp():oGrid
WITH OBJECT oApp():aCols[3]
:nEditType := TYPE_IMAGE
:lBmpStretch := .t.
:lBmpTransparent := .t.
:bBmpData := {|oCol, oGrid| oApp():aRow[ 4 ] }
:nDataBmpAlign := AL_CENTER
END

WITH OBJECT oApp():aCols[4]
:nEditType := EDIT_BUTTON
:bEditBlock := {|nRow, nCol, oCol| oCol:Value := cGetFile( "*.*", "Select a file" ) }
END

END

oApp():SetRDD()
oApp():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

Continue the discussion