strange error on xbrowse

strange error on xbrowse

Postby Silvio » Thu Jan 13, 2011 9:27 am

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

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

Re: strange error on xbrowse

Postby nageswaragunupudi » Thu Jan 13, 2011 9:47 am

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
Code: Select all  Expand view
AEval( aGradiBmp, { |cBmpFile| oCol:AddBmpFile(cBmpFile)} )
 

you can write
Code: Select all  Expand view
oCol:AddBitmap( aGradiBmp )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: strange error on xbrowse

Postby Silvio » Thu Jan 13, 2011 9:55 am

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

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

Re: strange error on xbrowse

Postby Silvio » Thu Jan 13, 2011 10:49 am

Dear Nages ,
Can you see this test please
Code: Select all  Expand view
#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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: strange error on xbrowse

Postby Silvio » Fri Jan 14, 2011 8:10 am

Nages have try the test ?
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 80 guests