Hello !
At this time TwBrowse have 2 possibilities to colour background of active row - logic lCellStyle . If choose ! lCellStyle , then all active row coloured with one color and the active cell too . I want to do something mix of both styles - paint active row with wanted color and underline with other color active cell . Is it possible ?
Here is my own background painting for bBkColor color :
METHOD GrPair( nRow, nCol, nStyle, oSel, nFtr ) CLASS TWBrowse // Rimantas U.
local nClr := ::nClrPane
default nFtr := NIL
if nStyle == 1 .or. nStyle == 2 // headers and footers
nClr := GetSysColor( 15 )
if nStyle == 1 .and. nFtr # NIL
if nFtr == nCol
nClr := nRGB( 192, 192, 192 )
endif
endif
elseif nStyle == 3 // active cells
nClr := GetSysColor( 13 )
if ( ::lCellStyle .and. nCol == ::nColAct ) .or. !::lCellStyle
if oSel <> NIL .and. oSel:lSelect
nClr := nRGB( 128, 128, 128 ) // CLR_GRAY
endif
endif
elseif nStyle == 0 // normal cells
if oSel <> NIL .and. oSel:lSelect
nClr := nRGB( 192, 192, 192 ) // CLR_HGRAY
else
if ::aGrPair[ 1 ] # ::aGrPair[ 2 ]
if ::nGrRec != if( upper( ::cAlias ) # "ARRAY", ( ::cAlias )->( recno() ), ::nAt ) .and. ::lScrolling
::nGrRec := if( upper( ::cAlias ) # "ARRAY", ( ::cAlias )->( recno() ), ::nAt )
nClr := ::aGrPair[ 1 ]
::aGrPair[ 1 ] := ::aGrPair[ 2 ]
::aGrPair[ 2 ] := nClr
endif
if nRow % 2 == 0
nClr := ::aGrPair[ 2 ]
else
nClr := ::aGrPair[ 1 ]
endif
else
nClr := NIL
endif
// for active row
if nRow == ::nRowPos
nClr := nRGB( 0, 200, 255 )
endif
endif
endif
return( nClr )
The problem : repainting of background after moving with Up and Down keys . It leave the same background colour an the previuos line . I tried to correct GoUp() and GoDown() methods adding Refresh . It did the job , but it slowness browse too .. :-(( . With PgDown and PgUp it works OK , because here its repainting of all browse . Maybe you can help me in this situation ?
With best regards ! Rimantas .