FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Footer en TXBrowse
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Footer en TXBrowse
Posted: Thu Jan 01, 2009 07: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
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
Re: Footer en TXBrowse
Posted: Fri Jan 02, 2009 01:16 AM

Francisco,

excelente aportación, muchas gracias

William, Morales

Saludos



méxico.sureste

Continue the discussion