i MADE A GRID ( XBROWSE)
i PUT A BACKGROUND
FOR EACH XBROWSE COLUMN i USE BITMAPS AS YOU SEE ON MY PICTURE
THE BITMPAS ARE NOT TRAPSRENT ON XBROWSE BACKGROUND
: WHY ?
I TRY ALSO TO REFILL EACH BITMAPS WITH 255,0,255 COLOR
ANY IDEA ?
PalBmpDraw( hDC, nBmpRow, nBmpCol,;
aBitmap[ BITMAP_HANDLE ],;
aBitmap[ BITMAP_PALETTE ],;
aBitmap[ BITMAP_WIDTH ],;
aBitmap[ BITMAP_HEIGHT ];
,, .t., aColors[ 2 ] )
PalBmpDraw( hDC, nBmpRow, nBmpCol,;
aBitmap[ BITMAP_HANDLE ],;
aBitmap[ BITMAP_PALETTE ],;
aBitmap[ BITMAP_WIDTH ],;
aBitmap[ BITMAP_HEIGHT ];
,if(::oBrw:lBrushed,SRCPAINT,), ::lBmpTransparent, aColors[ 2 ] )
IF oBrw:nRowHeight < nBMPHight
oBrw:nRowHeight := nBMPHight + 4
ENDIF
aBrw[ 1 ]:= txbrowse():new( oFolder:aDialogs[ 1 ] )
aBrw[ 1 ]:nRowHeight := 30
aBrw[ 1 ]:nColDividerStyle := LINESTYLE_BLACK
aBrw[ 1 ]:nRowDividerStyle := LINESTYLE_BLACK
aBrw[ 1 ]:SetArray( aArray1 )
aBrw[ 1 ]:cBmpAdjBrush := "frog.bmp"
aBrw[ 1 ]:SetBackGround( "frog.bmp" )
aBrw[ 1 ]:CreateFromCode()
aBrw[ 1 ]:bClrStd := {|| {CLR_WHITE, CLR_BLACK} }
aBrw[ 1 ]:nTop := 0
aBrw[ 1 ]:nLeft := 0
aBrw[ 1 ]:nBottom := 120
aBrw[ 1 ]:nRight := 160
aBrw[ 1 ]:aCols[ 1 ]:addbmpfile( "arrow.bmp" )
aBrw[ 1 ]:aCols[ 1 ]:addbmpfile( "bottom.bmp" )
aBrw[ 1 ]:aCols[ 1 ]:bBmpData := {|| if ( aBrw[ 1 ]:nArrayAt() % 2 == 0,2,1) }
// Image
// --------
IF nArrayPos = 9
// To receive the Row-Height ( from biggest BMP )
// --------------------------------------------------------
DEFINE IMAGE oImage1 RESOURCE "Help"
oBrw5:nRowHeight := oImage1:nWidth() + 4
oImage1:End()
// --------------
oBrw5:cBmpAdjBrush := "FANTASY1.BMP"
oBrw5:SetBackGround( "FANTASY1.BMP" )
* aeval( oBrw5:aCols, { |o|o:lColTransparent := .t. } )
oBrw5:aCols[ 2 ]:bClrStd := {|| {CLR_WHITE, CLR_BLACK} }
oBrw5:aCols[ 2 ]:AddResource("Help")
oBrw5:aCols[ 2 ]:AddResource("Calendar")
* oBrw5[ 2 ]:aCols[ 1 ]:addbmpfile( "arrow.bmp" )
* oBrw5[ 2 ]:aCols[ 1 ]:addbmpfile( "bottom.bmp" )
oBrw5:aCols[2]:bBmpData := {|| if ( oBrw5:nArrayAt() % 2 == 0,2,1) }
oBrw5:Refresh()
ENDIF
PalBmpDraw( hDC, nBmpRow, nBmpCol,;
aBitmap[ BITMAP_HANDLE ],;
aBitmap[ BITMAP_PALETTE ],;
aBitmap[ BITMAP_WIDTH ],;
aBitmap[ BITMAP_HEIGHT ];
,, ::lBmpTransparent, aColors[ 2 ] )
IF ::oBrw:lTransparent
nOldColor := SetBkColor( hDC, nRGB( 255, 255, 255 ) )
TransBmp( aBitmap[ BITMAP_HANDLE ], aBitmap[ BITMAP_WIDTH ], aBitmap[ BITMAP_HEIGHT ],;
aBitmap[ BITMAP_ZEROCLR ], hDC, nBmpCol, nBmpRow, aBitmap[ BITMAP_WIDTH ], ;
aBitmap[ BITMAP_HEIGHT ] )
SetBkColor( hDC, nOldColor )
else
PalBmpDraw( hDC, nBmpRow, nBmpCol,;
aBitmap[ BITMAP_HANDLE ],;
aBitmap[ BITMAP_PALETTE ],;
aBitmap[ BITMAP_WIDTH ],;
aBitmap[ BITMAP_HEIGHT ];
,, ::lBmpTransparent, aColors[ 2 ] )
endif
oApp():oDlg:NewGrid( nSplit )
oApp():oGrid:nMarqueeStyle := MARQSTYLE_HIGHLROWMS // per la multi selezione
oApp():oGrid:nColDividerStyle := LINESTYLE_FORECOLOR
oApp():oGrid:lColDividerComplete := .t.
oApp():oGrid:lRecordSelector := .F.
and one column :
oCol:= oApp():oGrid:AddCol()
oCol:AddResource("sort1")
oCol:AddResource("sort2")
oCol:cHeader := "Grado"
oCol:nHeadBmpNo := if( (oDCli)->( ORDNUMBER() ) == 7, 1, 2)
oCol:nHeadBmpAlign := AL_RIGHT
oCol:bLClickHeader :={ ||(Sel_Index(6,oDCli) , oApp():oTab:nOption:=6,oApp():oTab:refresh()) }
oCol:AddResource("GRADO1")
oCol:AddResource("GRADO2")
oCol:AddResource("GRADO3")
oCol:AddResource("GRADO4")
oCol:AddResource("GRADO5")
oCol:AddResource("GRADO6")
oCol:AddResource("GRADO7")
oCol:AddResource("GRADO8")
oCol:AddResource("GRADO0")
oCol:bStrData := { || (oDCli)->GRADO}
oCol:bBmpData := { || (oDCli)->GRADO + 2}
oCol:nWidth :=40
and then at the end
oApp():oGrid:nFreeze :=3
oApp():oGrid:SetRDD()
oApp():oGrid:bClrStd := { || Colores(oDCli) }
oApp():oGrid:SetBackGround( ".\bitmaps\pclogog.BMP" )
oApp():oGrid:CreateFromCode()
oApp():oGrid:bChange :={ || (RefreshCont(oCont,oDCli)) }
oApp():oGrid:bRClicked := {|nRow,nCol| Disp_Men(oApp():oDlg,nRow,nCol,oDCli) }
oApp():oGrid:bKeyDown :={|nKey| Val_nKey(nKey,oApp():oDlg)}
oApp():oGrid:bSeek :={|c| DbSeek( Upper( c ) ) }
oApp():oGrid:nRowHeight :=40
oApp():oGrid:nHeaderHeight := 36
oApp():oGrid:RestoreState( cState )
.......
STATIC FUNCTION Colores(cdbf)
LOCAL aCol:={}
IF (cdbf)->(Ordkeyno()) % 2 == 0
aCol:={CLR_BLACK, RGB(193,221,255) }
ELSE
aCol:={CLR_BLACK, RGB(221,245,255) }
ENDIF
RETURN (aCol)
// Color DOESN'T WORK !!!
// ----------------------------
IF nArrayPos = 2
DEFINE IMAGE oImage1 RESOURCE "Help"
oBrw5:nRowHeight := oImage1:nWidth() + 4
oImage1:End()
DEFINE BRUSH oBrush5 COLOR 16105859
oBrw5:SetBackGround( oBrush5 )
RELEASE BRUSH oBrush5
oBrw5:aCols[ 2 ]:AddResource("Help")
oBrw5:aCols[ 2 ]:AddResource("Calendar")
oBrw5:aCols[ 2 ]:bBmpData := {|| IIF( oBrw5:nArrayAt = 5, 1, 2 ) }
oBrw5:Refresh()
ENDIF
// Alternate Row-Color WORKS !!!
// ------------------------------------
IF nArrayPos = 3
DEFINE IMAGE oImage1 RESOURCE "Help"
oBrw5:nRowHeight := oImage1:nWidth() + 4
oImage1:End()
oBrw5:nColDividerStyle := LINESTYLE_BLACK
oBrw5:nRowDividerStyle := LINESTYLE_BLACK
aClrCol := { { 0, 16105859 }, { 0, 16776960 } }
oBrw5:bClrStd := { || aClrCol[ oBrw5:KeyNo % 2 + 1 ] }
oBrw5:aCols[ 2 ]:AddResource("Help")
oBrw5:aCols[ 2 ]:AddResource("Calendar")
oBrw5:aCols[ 2 ]:bBmpData := {|| IIF( oBrw5:nArrayAt = 5, 1, 2 ) }
ENDIF
// Alternate Col- Color WORKS !!!!
// -------------------------------------
IF nArrayPos = 4
DEFINE IMAGE oImage1 RESOURCE "Help"
oBrw5:nRowHeight := oImage1:nWidth() + 4
oImage1:End()
oBrw5:nColDividerStyle := LINESTYLE_BLACK
oBrw5:nRowDividerStyle := LINESTYLE_BLACK
aClrCol := { { 0, 16105859 }, { 0, 16776960 } }
lSELECT := .T.
FOR nFOR := 1 TO LEN( oBrw5:aCols )
IF lSELECT = .T.
oBrw5:aCols[nFOR]:bClrStd := { || aClrCol[ nFOR % 1 + 2 ] }
lSELECT := .F.
ELSE
oBrw5:aCols[nFOR]:bClrStd := { || aClrCol[ nFOR % 2 + 1 ] }
lSELECT := .T.
ENDIF
NEXT
oBrw5:aCols[ 2 ]:AddResource("Help")
oBrw5:aCols[ 2 ]:AddResource("Calendar")
oBrw5:aCols[ 2 ]:bBmpData := {|| IIF( oBrw5:nArrayAt = 5, 1, 2 ) }
ENDIF
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 73 guests