My code (not perfect in the sense of Mr. Rao ) :
First in classes TXbrowse and TXBrwColumn
- Code: Select all Expand view
- // BOX AROUND CELL
DATA nBoxPen AS NUMERIC INIT 0 //box linewidth //BYTE-ONE
DATA nColorBoxPen AS NUMERIC INIT CLR_WHITE //boxpencolor //BYTE-ONE
Then in method :drawline() add lines with BYTE-ONE in text
- Code: Select all Expand view
- .....
RoundBox( hDC, 2, nRow - 1, nLast - 1, nRow + nDataHeight, 2, 2,;
RGB( 235, 244, 253 ), 1 )
RoundBox( hDC, 1, nRow - 2, nLast, nRow + nDataHeight + 1, 2, 2,;
RGB( 125, 162, 206 ), 1 )
endcase
oCol := ::ColAtPos( ::nColSel ) //BYTE-ONE
if oCol:lEditable //only on edit-cells //BYTE-ONE
if oCol:nBoxPen > 0//Box for this cell //BYTE-ONE
oCol:Box( nRow, nil, nDataHeight, 4, oCol:nColorBoxPen, oCol:nBoxPen ) //BYTE-ONE
elseif ::nBoxPen > 0 //Box for all cells //BYTE-ONE
oCol:Box( nRow, nil, nDataHeight, 4, ::nColorBoxPen, ::nBoxPen ) //BYTE-ONE
endif //BYTE-ONE
endif //BYTE-ONE
endif
::ReleaseDC()
return nil
Then in method box()() add lines with BYTE-ONE in text
- Code: Select all Expand view
- METHOD Box( nRow, nCol, nHeight, nType, nColor, nPen ) CLASS TXBrwColumn //BYTE-ONE
local nKorr, hPen, hBrush //BYTE-ONE
...
case nType == 3 // Raise
WndBoxRaised( hDC, nRow, nCol, nRow + nHeight - 1, nCol + nWidth - 1 )
case nType == 4 // Box around the cell //BYTE-ONE
nKorr := if(nPen%2==0,nPen/2,(nPen-1)/2) //BYTE-ONE
hPen := CreatePen( PS_SOLID, nPen, nColor ) //BYTE-ONE
hBrush := getstockobject(5) //BYTE-ONE
selectobject(hDC,hBrush) //BYTE-ONE
Rectangle( hDC, nRow + nKorr , nCol + nKorr, nRow + nHeight - nKorr , nCol + nWidth - nKorr + 1 , hPen ) //BYTE-ONE
DeleteObject( hPen ) //BYTE-ONE
endcase
::oBrw:ReleaseDC()
return nil