FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Share add on xbrowse 3D header codes
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Share add on xbrowse 3D header codes
Posted: Mon Dec 03, 2007 01: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

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Share add on xbrowse 3D header codes
Posted: Mon Dec 03, 2007 01:16 AM

Shuming,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Share add on xbrowse 3D header codes
Posted: Mon Dec 03, 2007 01:25 AM
Antonio,
Here is

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

Engjoy !

Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651

Continue the discussion