Share add on xbrowse 3D header codes

Share add on xbrowse 3D header codes

Postby ShumingWang » Mon Dec 03, 2007 1:12 am

Hi,
METHOD PaintHeader( nRow, nCol, nHeight, lInvert, hDC ) CLASS TXBrwColumn
...
// begin add on
nTop = 0
nBottom = nTop + nHeight1
nLeft := ncol-2
nRight = Min( nLeft + ::nwidth , ::obrw:nWidth )

if ncol == Len( ::obrw:acols )
nRight = nWidth
endif

WndBox( hDC, ntop-1 , nLeft - 2, nBottom+1, nRight-1 )
WndBoxRaised( hDC, nTop+1, nLeft-1, nBottom , nRight-1 )

// end add on


oFont:Deactivate( hDC )

if !lOwnDC
::oBrw:ReleaseDC()
endif

return nil


METHOD Paint() CLASS TXBrowse

...
/*
Paint Header
*/


replace
if ::lHeader
...
end

with:

if ::lHeader
if !lOnlyData
nRow := 0
nHeight := ::nHeaderHeight - 3
// top line
MoveTo( hDC,1, nRow)
LineTo( hDC, nBrwWidth, nRow, hGrayPen )
nRow++
MoveTo( hDC, 1, nRow )
LineTo( hDC, nBrwWidth, nRow, hWhitePen )
nRow++
MoveTo( hDC, 1, nRow + nHeight)
LineTo( hDC, nBrwWidth, nRow + nHeight , hGrayPen )
aColors := Eval( ::bClrHeader, Self )
hBrush := CreateSolidBrush( aColors[ 2 ] )
FillRect( hDC, {nRow, 2, nRow + nHeight, nBrwWidth}, hBrush )
DeleteObject( hBrush )


for nFor := 1 to nLast
nCol := aCols[ nFor ]
oCol := ::ColAtPos( nFor )
oCol:PaintHeader( nRow, nCol, nHeight )

next

// paint space right col header, 2007 look
nTop = 0
nBottom = nTop + nHeight
nLeft := ncol
nRight = ::nWidth
nWidth:=nright
nBottom = nRow + ( nHeight / 3 )
Gradient( hDC, { nRow - 1, nCol+ocol:nwidth, nBottom, nCol + nWidth + 2 },;
nRGB( 219, 230, 244 ), nRGB( 207, 221, 239 ), .T. )
Gradient( hDC, { nBottom + 1, nCol+ocol:nwidth, nRow + nHeight - 1, nCol + nWidth },;
nRGB( 201, 217, 237 ), nRGB( 231, 242, 255 ), .T. )


// 3d header box
nTop = 0
nBottom = nTop + nHeight
nLeft := ncol
nRight = ::nWidth


WndBox( hDC, ntop - 1, nLeft+ocol:nwidth, nBottom+1, nRight-1 )
WndBoxRaised( hDC, nTop+1, nLeft+1+ocol:nwidth, nBottom , nRight - 1 )


endif
nFirstRow += ::nHeaderHeight
endif


Have a fun

Shuming Wang
Last edited by ShumingWang on Mon Dec 03, 2007 1:32 am, edited 1 time in total.
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby Antonio Linares » Mon Dec 03, 2007 1:16 am

Shuming,

Could you please post a screenshot of how it looks ? thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41390
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby ShumingWang » Mon Dec 03, 2007 1:25 am

Antonio,
Here is
Image
If you want paint space lines below data lines and right data columns like excel, there must add another codes .

Engjoy !

Shuming Wang
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests