Colors in Browses

Xbase++ 2.0 Build 554 or later
Message
Author
Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Colors in Browses

#1 Post 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 ?
Attachments
With 2.0
With 2.0
Screen2.0.jpg (57.26 KiB) Viewed 18433 times
With 1.9
With 1.9
screen1.9.jpg (54.18 KiB) Viewed 18433 times
_______________________
Best Regards
Wolfgang

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Colors in Browses

#2 Post 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.

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Colors in Browses

#3 Post by rdonnay »

Send me a small test program. I'll look into this.
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Colors in Browses

#4 Post 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 ?!
Attachments
Test_Browse2.zip
(48.62 KiB) Downloaded 775 times
_______________________
Best Regards
Wolfgang

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Colors in Browses

#5 Post by hz_scotty »

Hi
in my v1.9 is the foreground color black not blue
with your code
best regards
Hans

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Colors in Browses

#6 Post 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.
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Colors in Browses

#7 Post 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))}
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Colors in Browses

#8 Post by Wolfgang Ciriack »

It thought, i tested it. Yes, it is working, thanks.
_______________________
Best Regards
Wolfgang

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Colors in Browses

#9 Post 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 ?
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Colors in Browses

#10 Post 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

The eXpress train is coming - and it has more cars.

Post Reply