DCBROWSE COLOR determine record with highlight bar

This forum is for eXpress++ general support.
Post Reply
Message
Author
Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

DCBROWSE COLOR determine record with highlight bar

#1 Post by Cliff Wiernik »

I have a DCBROWSE ... COLOR command that works fine. However, I would like to have a different color array combination for the record that is displayed as the current selected record.

color1, etc. is a FG/BG color array as defined in the dcbrowse help

For example
iif (condition .and. not selected record,color1, color2) otherwise iif(condition and selected record,color3,color4))

I need to know if it is possible to know for purpose of the color display, when it is on the selected line because my color1/color2 does not show up as well against the blue line selected bar.

This is a database browse.

Cliff.

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

Re: DCBROWSE COLOR determine record with highlight bar

#2 Post by rdonnay »

Cliff -

I think you can do this, but you may have to use CURSORMODE XBPBRW_CURSOR_NONE.

Try this (I haven't tested it):

Code: Select all

nRecordMarked := RecNo()

@ .. DCBROWSE .. COLOR {||IIF(nRecordMarked==RecNo(),{nil,GRA_CLR_YELLOW},{nil,nil}} ;
      ITEMMARKED {||nRecordMarked := RecNo()} ;
      CURSORMODE XBPBRW_CURSOR_NONE
Roger
The eXpress train is coming - and it has more cars.

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

Re: DCBROWSE COLOR determine record with highlight bar

#3 Post by Cliff Wiernik »

Thanks, Roger.

I used the following modification of your suggestions and it works fine. I am using CURSORMODE XBPBRW_CURSOR_ROW.

Code: Select all

        
COLOR {|| iif(!nRecordMarked==(cAlias)->(recno()) .AND. (cAlias)->lbadacct,{GRA_CLR_YELLOW,GRA_CLR_RED},{nil,nil})}   

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

Re: DCBROWSE COLOR determine record with highlight bar

#4 Post by Cliff Wiernik »

I ran into problems with item selected clause screwing things up. I settled on the the following code which worked all the time. The key was the use of the {nil,nil}.

Code: Select all

COLOR {|| iif(condition{GRA_CLR_YELLOW,GRA_CLR_RED},{nil,nil})}  
Thanks,

Cliff.

Post Reply