I must show bitmaps on a column for different type of record
I made at init
// prendo i bitmaps dei gradi
oDTipGrad:=Apri_Dbf("Tabelle" ) // open database
(oDTipGrad)->(DbSeek("G"))
DO WHILE (oDTipGrad)->CveTab="G" .AND. !(oDTipGrad)->(EoF())
AAdd(aGradiBmp,(oDTipGrad)->Bitmap)
(oDTipGrad)->(DbSkip())
ENDDO
Chiudi_Dbf("Tabelle",oDTipGrad) // close database
and I save on aGradiBmp all bitmaps sample ".\bitmaps\gradi\0028.bmp"
then on xbrowse I made
oCol:= oApp():oGrid:AddCol()
oCol:AddBmpFile(".\BITMAPS\GRID\SORT1.BMP")
oCol:AddBmpFile(".\BITMAPS\GRID\SORT2.BMP") oCol:cHeader := "Grado"
oCol:nHeadBmpNo := if( (oDVds)->( ORDNUMBER() ) == 7, 1, 2)
oCol:nHeadBmpAlign := AL_RIGHT
AEval( aGradiBmp, { |cBmpFile| oCol:AddBmpFile(cBmpFile)} )
oCol:bBmpData := { || (oDVds)->GRADO+2}
oCol:nWidth :=40
this runned ok but now I cannot show the bitmaps
strange error on xbrowse
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: strange error on xbrowse
Please make sure that all elements of aGradiBmp represent correct filepaths, If necessary first check all elements of the array with File(aGradiBmp[n]) before creating xbrowse.
Incidentally with recent versions of xbrowse
instead of
you can write
Incidentally with recent versions of xbrowse
instead of
Code: Select all | Expand
AEval( aGradiBmp, { |cBmpFile| oCol:AddBmpFile(cBmpFile)} )
you can write
Code: Select all | Expand
oCol:AddBitmap( aGradiBmp )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: strange error on xbrowse
NOT RUN
I made
// prendo i bitmaps dei gradi
oDTipGrad:=Apri_Dbf("Tabelle" )
(oDTipGrad)->(DbSeek("G"))
DO WHILE (oDTipGrad)->CveTab="G" .AND. !(oDTipGrad)->(EoF())
AAdd(aGradiBmp,(oDTipGrad)->Bitmap)
(oDTipGrad)->(DbSkip())
ENDDO
Chiudi_Dbf("Tabelle",oDTipGrad)
// to control file
FOR n=1 TO len(aGradiBmp)
IF ! file( aGradiBmp[n])
MsgInfo("NoT exit file bmp")
endif
next
oCol:= oApp():oGrid:AddCol()
oCol:AddBmpFile(".\BITMAPS\GRID\SORT1.BMP")
oCol:AddBmpFile(".\BITMAPS\GRID\SORT2.BMP")
oCol:cHeader := "Grado"
oCol:nHeadBmpNo := if( (oDVds)->( ORDNUMBER() ) == 7, 1, 2)
oCol:nHeadBmpAlign := AL_RIGHT
oCol:AddBitmap( aGradiBmp )
oCol:bBmpData := { || (oDVds)->GRADO+2} // I add 2 because the first and second are for the sort
oCol:nWidth :=40
WITH OBJECT oApp():oGrid
:nMarqueeStyle = 7 // MARQSTYLE_HIGHLWIN7 // for Windows 7 style
:nFreeze :=3
:SetRDD()
:nRecSelColor = 15512898
// :bClrStd := { || Colores(oDVds) }
// :bClrSelFocus = { || { 0, DARKCYAN } }
// :bClrSel ={ || { 0, DARKCYAN } }
:bChange :={ || (RefreshCont(oCont,oDVds)) }
END
oApp():oGrid:CreateFromCode()
I made
// prendo i bitmaps dei gradi
oDTipGrad:=Apri_Dbf("Tabelle" )
(oDTipGrad)->(DbSeek("G"))
DO WHILE (oDTipGrad)->CveTab="G" .AND. !(oDTipGrad)->(EoF())
AAdd(aGradiBmp,(oDTipGrad)->Bitmap)
(oDTipGrad)->(DbSkip())
ENDDO
Chiudi_Dbf("Tabelle",oDTipGrad)
// to control file
FOR n=1 TO len(aGradiBmp)
IF ! file( aGradiBmp[n])
MsgInfo("NoT exit file bmp")
endif
next
oCol:= oApp():oGrid:AddCol()
oCol:AddBmpFile(".\BITMAPS\GRID\SORT1.BMP")
oCol:AddBmpFile(".\BITMAPS\GRID\SORT2.BMP")
oCol:cHeader := "Grado"
oCol:nHeadBmpNo := if( (oDVds)->( ORDNUMBER() ) == 7, 1, 2)
oCol:nHeadBmpAlign := AL_RIGHT
oCol:AddBitmap( aGradiBmp )
oCol:bBmpData := { || (oDVds)->GRADO+2} // I add 2 because the first and second are for the sort
oCol:nWidth :=40
WITH OBJECT oApp():oGrid
:nMarqueeStyle = 7 // MARQSTYLE_HIGHLWIN7 // for Windows 7 style
:nFreeze :=3
:SetRDD()
:nRecSelColor = 15512898
// :bClrStd := { || Colores(oDVds) }
// :bClrSelFocus = { || { 0, DARKCYAN } }
// :bClrSel ={ || { 0, DARKCYAN } }
:bChange :={ || (RefreshCont(oCont,oDVds)) }
END
oApp():oGrid:CreateFromCode()
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
Re: strange error on xbrowse
Dear Nages ,
Can you see this test please
where is the error ?
Can you see this test please
Code: Select all | Expand
#include "FiveWin.ch"
#include "xbrowse.ch"
#define MARQSTYLE_HIGHLWIN7 7
REQUEST DBFCDX, DBFFPT
external ordkeyno, ordkeycount,ordcreate
FUNCTION TEST()
Local aGradiBmp:={},oDTipGrad,n
Local oGrid,oDVds
Local oDlg
RddSetDefault( "DBFCDX" )
USE TABELLE ALIAS oDTipGrad INDEX TABELLE
oDTipGrad->(DbSeek("G"))
DO WHILE oDTipGrad->CveTab="G" .AND. !oDTipGrad->(EoF())
AAdd(aGradiBmp,oDTipGrad->Bitmap)
oDTipGrad->(DbSkip())
ENDDO
FOR n=1 TO len(aGradiBmp)
IF ! file( aGradiBmp[n])
MsgInfo("non esiste")
endif
next
DEFINE DIALOG oDlg SIZE 800,600
oGrid := TXBrWin7():New( oDlg )
oGrid:nTop := 00
oGrid:nLeft := 00
oGrid:nBottom := 200
oGrid:nRight := 400
USE SOCI ALIAS oDVds
oDVds->(OrdSetFocus(2))
oDVds->(DbGoTop())
oCol:= oGrid:AddCol()
oCol:AddBmpFile(".\BITMAPS\GRID\SORT1.BMP")
oCol:AddBmpFile(".\BITMAPS\GRID\SORT2.BMP")
oCol:AddBitmap( aGradiBmp )
oCol:cHeader := "Grado"
oCol:nHeadBmpNo := if( oDVds->( ORDNUMBER() ) == 7, 1, 2)
oCol:bBmpData := { || oDVds->GRADO+2}
oCol:nWidth :=40
WITH OBJECT oGrid
:nMarqueeStyle = 7 // MARQSTYLE_HIGHLWIN7 // for Windows 7 style
END
oGrid:SetRDD()
oGrid:CreateFromCode()
ACTIVATE DIALOG oDlg
RETURN NIL
where is the error ?
Best Regards, Saludos
Falconi Silvio
Falconi Silvio