@ 0, 0 XBROWSE oBrw OF oWnd ;
ALIAS 'CUSTOMER' AUTOCOLS ;
LINES
//I colorize only some columns
//the problem is when I use the MarqueeStyle I cannot use
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
//or
//:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
//because it not show the red colors of that columns
WITH OBJECT oBrw:aCols[ 3 ] // colored column
:bPaintText := { | oCol, hDC, cText, aRect | ;
DRAW_RECT( oCol, hDC, cText, aRect, 255 ) }
END
//------------------------
STATIC FUNCTION DRAW_RECT ( oCol, hDC, cText, aRect, nCellcolor )
LOCAL nTop := aRect[ 1 ]
LOCAL nLeft := aRect[ 2 ]
LOCAL nBottom := aRect[ 3 ]
LOCAL nRight := aRect[ 4 ]
LOCAL nFontHt := GetTextHeight( oCol:oBrw:hWnd, hDC )
LOCAL nColor, Fieldvalue, hBrush1
IF nCellcolor <> NIL // Full cellcolor
hBrush1 := CreateSolidBrush( nCellcolor )
hOld1:= SelectObject( hBrush1 )
FillRect( hDC, { nTop -1, nLeft -4, nBottom +1, nRight +2 }, hBrush1 )
SelectObject( hOld1 )
DeleteObject( hBrush1 )
ENDIF
//oCol:nDataStyle 0 = lefft, 1 = centered, 2 = right
DrawTextEx( hDC, cText, { nTop, nLeft, nTop + nFontHt + 4, nRight }, 0 ) //oCol:nDataStyle )
RETURN NIL
@ 0, 0 XBROWSE oBrw OF oWnd ;
ALIAS 'CUSTOMER' AUTOCOLS LINES
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:bClrStd:= {|| { 0, 16766638 } } // Black on LightBlue
nCol := 2 // start col
FOR I := 2 TO 7
WITH OBJECT oBrw:aCols[ nCol ]
:bPaintText := { | oCol, hDC, cText, aRect | ;
DRAW_RECT( oCol, hDC, cText, aRect, 255 ) }
END
nCol += 2 // every 2. col
NEXT
//------------------------
STATIC FUNCTION DRAW_RECT ( oCol, hDC, cText, aRect, nCellcolor )
LOCAL nFontHt := GetTextHeight( oCol:oBrw:hWnd, hDC )
IF nCellcolor <> NIL // Full cellcolor
hBrush1 := CreateSolidBrush( nCellcolor )
hOld1 := SelectObject( hBrush1 )
FillRect( hDC, { aRect[ 1 ] -1, aRect[ 2 ] -2, aRect[ 3 ] +1, aRect[ 4 ] + 1 }, hBrush1 )
SelectObject( hOld1 )
DeleteObject( hBrush1 )
ENDIF
DeleteObject( hBrush1 )
//oCol:nDataStyle 0 = lefft, 1 = centered, 2 = right
DrawTextEx( hDC, cText, { aRect[ 1 ], aRect[ 2 ], aRect[ 1 ] + nFontHt + 4, aRect[ 4 ] }, 0 ) //oCol:nDataStyle )
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 73 guests