Page 1 of 2
Colors in Browses
Posted: Fri Dec 11, 2015 10:34 am
by Wolfgang Ciriack
Hi all,
there is a difference between 2.0 and 1.9 how the color of the hilited row is shown (see screenshots).
The foreground color always is black. Is there a workaround for this ?
Re: Colors in Browses
Posted: Fri Dec 11, 2015 10:45 am
by Cliff Wiernik
Don't know about this but I have experienced a different issue with 1.9 vs 2.0.
For a disabled checkbox, the background color does not appear to be able to be set via :setcolorbg(). I had to instead set it via the presentation parameters clause.
Re: Colors in Browses
Posted: Fri Dec 11, 2015 11:54 am
by rdonnay
Send me a small test program. I'll look into this.
Re: Colors in Browses
Posted: Sat Dec 12, 2015 12:41 am
by Wolfgang Ciriack
Hello Roger,
attached is a small example, extracted from my prog.
Someone in the german forum says, that he had a lot of discussions with Till from Alaska about Browses.
He says, if you set the arrays in :colorBlock with 4 parameters {cColor, NIL, cColor, NIL} the coloring should work ?!
Re: Colors in Browses
Posted: Sat Dec 12, 2015 2:40 am
by hz_scotty
Hi
in my v1.9 is the foreground color black not blue
with your code
Re: Colors in Browses
Posted: Sat Dec 12, 2015 6:46 am
by Wolfgang Ciriack
Thats right. The problem is the selected row, if you are on a colored row you do not see the blue or red anymore, always black.
Re: Colors in Browses
Posted: Sat Dec 12, 2015 7:24 am
by rdonnay
He says, if you set the arrays in :colorBlock with 4 parameters {cColor, NIL, cColor, NIL} the coloring should work ?!
Did you try it? I did, and it seems to work just fine.
Code: Select all
local bStdClrSp:={|| iif(ascan(aSelRec,recno())<>0,BRW_CLR_MARKED,iif(bau->baucolor<>0,{bau->baucolor,nil,bau->baucolor,nil},BRW_CLR_NONE))}
Re: Colors in Browses
Posted: Sun Dec 13, 2015 12:56 am
by Wolfgang Ciriack
It thought, i tested it. Yes, it is working, thanks.
Re: Colors in Browses
Posted: Mon Dec 14, 2015 3:32 am
by Wolfgang Ciriack
Hello Roger,
can you change the TAGCOLOR of DCBrowses, so that it accept an array with 4 elements ?
With XBase++ 2.0 the marked item is nor visible anymore, if the browse cursor is on that row.
Or can i manipulate the tagcolor in another way ?
Re: Colors in Browses
Posted: Mon Dec 14, 2015 5:56 am
by rdonnay
can you change the TAGCOLOR of DCBrowses, so that it accept an array with 4 elements ?
I suggest that you replace DC_XbpBrowse:rowColor() with the below code in _DCXBROW.PRG and rebuild DCLIPX.DLL. Let me know if this works for you.
Code: Select all
METHOD DC_XbpBrowse:rowColor()
LOCAL aColor, aBrowseColor := DC_BrowseColor()
IF Valtype(::dataSource) == 'C'
IF ::tagEnable .AND. (::dataSource)->(DC_Tagged())
RETURN {::tagColorFG, nil, ::tagColorBG, nil} <<<<<<<<<<<<<<<<<<
ELSEIF (::dataSource)->(RecNo()) <> ::nBRow
::lBRow := !::lBRow
::nBRow := (::dataSource)->(RecNo())
ENDIF
ELSEIF Valtype(::dataSource) == 'A' .AND. Len(::dataSource) > 0
IF ::tagEnable .AND. ::arrayElement > 0 .AND. ::dataSource[::arrayElement,::tagElement]
RETURN {::tagColorFG, nil, ::tagColorBG, nil} <<<<<<<<<<<<<<<<<<
ELSEIF (::arrayElement) % 2 == 0
::lBRow := .t.
ELSE
::lBrow := .f.
ENDIF
ELSE
::lBrow := .t.
ENDIF
IF Valtype(aBrowseColor) == 'A'
IF ::lBRow
aColor := {aBrowseColor[1],aBrowseColor[2]}
ELSE
aColor := {aBrowseColor[3],aBrowseColor[4]}
ENDIF
ELSE
aColor := { nil, nil}
ENDIF
RETURN aColor