Footer en TXBrowse

Footer en TXBrowse

Postby FranciscoA » Thu Jan 01, 2009 7:32 pm

Antonio:
Viendo la necesidad de un colega del foro referente a presentar un solo footer de la anchura del oBrw en la clase TWBrowse, hice un leve cambio en la TXBrowse para obtener el mismo resultado (footer sin divisores de columnas). Aquí el código:


http://img78.imageshack.us/my.php?image=footersindivisordecolumfv4.png

DATA lFooterColDivider

En el METHOD NEW
...
::lHeader := .t.
::lFooter := .f.
::lRefreshOnlyData := .f.
::lFooterColDivider := .t. //FranciscoA Ene/01/2008: Footer con divisor, o no, de columnas.


En el METHOD PAINT
...

/*
Paint Footer
*/

if ::lFooter
if !lOnlyData
nHeight := ::nFooterHeight - 3
nRow := nBrwHeight - ::nFooterHeight
aColors := Eval( ::bClrFooter )

//Pinta linea para los bordes del footer
MoveTo( hDC, 0, nRow)
LineTo( hDC, nBrwWidth, nRow, hGrayPen )
nRow++
MoveTo( hDC, 0, nRow )
LineTo( hDC, nBrwWidth, nRow, hWhitePen )
nRow++
MoveTo( hDC, 0, nRow + nHeight)
LineTo( hDC, nBrwWidth, nRow + nHeight , hGrayPen )

hBrush := CreateSolidBrush( aColors[ 2 ] )
FillRect( hDC, {nRow, 0, nRow + nHeight, nBrwWidth}, ::hBrushRecSel ) // hBrush )
DeleteObject( hBrush )

for nFor := 1 to nLast
nCol := aCols[ nFor ]
oCol := ::ColAtPos( nFor )
IF !::lFooterColDivider //FranciscoA Ene/01/2009 //Pintar o no divisores de cols en el footer
if nFor == 1
nCol := aCols[ nFor ]
oCol := ::ColAtPos( nFor )
MoveTo( hDC, nCol - 2, nRow + 1 )
LineTo( hDC, nCol - 2, nRow + nHeight - 2, hGrayPen )
MoveTo( hDC, nCol - 1, nRow + 1 )
LineTo( hDC, nCol - 1, nRow + nHeight - 2, hWhitePen )
endif
ELSE //Original

MoveTo( hDC, nCol - 2, nRow + 1 )
LineTo( hDC, nCol - 2, nRow + nHeight - 2, hGrayPen )
MoveTo( hDC, nCol - 1, nRow + 1 )
LineTo( hDC, nCol - 1, nRow + nHeight - 2, hWhitePen )
ENDIF

oCol:PaintFooter( nRow, nCol, nHeight ) //Pinta footer de cada col.
next

nCol := aCols[ nFor ] //ultimo divisor de col
MoveTo( hDC, nCol - 2, nRow + 1 )
LineTo( hDC, nCol - 2, nRow + nHeight - 2, hGrayPen )
MoveTo( hDC, nCol - 1, nRow + 1 )
LineTo( hDC, nCol - 1, nRow + nHeight - 2, hWhitePen )
endif

nLastRow -= ::nFooterHeight
endif

/*
Paint cols data
*/

USO:
oBrw:lFooterColDivider := .f. //FranciscoA Ene/01/2008: poner o no, divisor de cols en el footer


Espero sea de utilidad para otros usuarios.

Saludos.
Francisco J. Alegría P.
Chinandega, Nicaragua.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2114
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Footer en TXBrowse

Postby wmormar » Fri Jan 02, 2009 1:16 am

Francisco,

excelente aportación, muchas gracias
William, Morales
Saludos

méxico.sureste
User avatar
wmormar
 
Posts: 1074
Joined: Fri Oct 07, 2005 10:41 pm
Location: México


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests