Command to set text color when highlighted

This forum is for eXpress++ general support.
Post Reply
Message
Author
Andy Edward
Posts: 103
Joined: Fri Sep 17, 2010 2:58 am

Command to set text color when highlighted

#1 Post by Andy Edward »

Hi Roger,
brow1.png
brow1.png (18.03 KiB) Viewed 9933 times
brow2.png
brow2.png (26.76 KiB) Viewed 9933 times
in the first browse, the text in the blue line (highlighted line) is white, while the rest is black.

Currently in the second browse, the text color never change when highlighted with the blue line (it stays black).
What setting should I use, so that in the second browse, it will make the text color white when highlighted?

I'm using your example in \Samples\Browse\browtype.prg

Best Regards,

Andy

Leon Berger
Posts: 36
Joined: Thu Jan 28, 2010 2:30 pm

Re: Command to set text color when highlighted

#2 Post by Leon Berger »

Add these lines to your source:

Code: Select all

// Datalines highlite
//
Aadd(aBrwPres  ,{XBP_PP_COL_DA_HILITE_FGCLR,GRA_CLR_WHITE})                   // Hilite FG color
Aadd(aBrwPres  ,{XBP_PP_COL_DA_HILITE_BGCLR,GRA_CLR_BLUE})                    // Hilite BG color
//
Best regards
Leon

Andy Edward
Posts: 103
Joined: Fri Sep 17, 2010 2:58 am

Re: Command to set text color when highlighted

#3 Post by Andy Edward »

Leon Berger wrote:Add these lines to your source:

Code: Select all

// Datalines highlite
//
Aadd(aBrwPres  ,{XBP_PP_COL_DA_HILITE_FGCLR,GRA_CLR_WHITE})                   // Hilite FG color
Aadd(aBrwPres  ,{XBP_PP_COL_DA_HILITE_BGCLR,GRA_CLR_BLUE})                    // Hilite BG color
//
Hi Leon,

I've already have those in the source, but it's still not working.
I'm using express++ 1.9.260 and xBase 1.9.331

Any other ideas?

This is the Init_BrowseColors function.

Code: Select all

Procedure Init_BrowseColors()
LOCAL aBrwPres       := {}
//
// 12-03-2011 Default browse parameters
//
// Header details
//
Aadd(aBrwPres  ,{XBP_PP_COL_HA_FGCLR,BRW_HA_FGCOLOR})                         // Header FG Color
Aadd(aBrwPres  ,{XBP_PP_COL_HA_BGCLR,BRW_HA_BGCOLOR})                         // Header BG Color
Aadd(aBrwPres  ,{XBP_PP_COL_HA_HEIGHT,-1})                                    // Header height (Based on Fontsize)
Aadd(aBrwpres  ,{XBP_PP_COL_HA_COMPOUNDNAME,APP_BROWSEFONT})                  // Font in browse
//
// Dataline details
//
Aadd(aBrwPres  ,{XBP_PP_COL_DA_ROWSEPARATOR,XBPCOL_SEP_NONE})                 // Row seperator
Aadd(aBrwPres  ,{XBP_PP_COL_DA_COLSEPARATOR,XBPCOL_SEP_DOTTED})               // Col seperator
Aadd(aBrwPres  ,{XBP_PP_COL_DA_FGCLR,GRA_CLR_BLACK})                          // Row FG color
Aadd(aBrwPres  ,{XBP_PP_COL_DA_BGCLR,GRA_CLR_WHITE})                          // Row BG color
Aadd(aBrwPres  ,{XBP_PP_COL_DA_ROWHEIGHT,-1})                                 // Row height (Based on Fontsize)
Aadd(aBrwpres  ,{XBP_PP_COL_DA_COMPOUNDNAME,APP_BROWSEFONT})                  // Font in browse
Aadd(aBrwPres  ,{XBP_PP_COL_DA_FRAMELAYOUT,1})                                // Browse outline
Aadd(aBrwPres  ,{XBP_PP_COL_DA_CELLFRAMELAYOUT,2})                            // Cell outline
//
// Datalines highlite
//
Aadd(aBrwPres  ,{XBP_PP_COL_DA_HILITE_FGCLR,GRA_CLR_WHITE})                   // Hilite FG color
Aadd(aBrwPres  ,{XBP_PP_COL_DA_HILITE_BGCLR,GRA_CLR_BLUE})                    // Hilite BG color
//
// Footer details
//
Aadd(aBrwPres  ,{XBP_PP_COL_FA_FGCLR,BRW_HA_FGCOLOR})                         // Footer FG Color
Aadd(aBrwPres  ,{XBP_PP_COL_FA_BGCLR,BRW_HA_BGCOLOR})                         // Footer BG Color
Aadd(aBrwPres  ,{XBP_PP_COL_FA_HEIGHT,-1})                                    // Footer height (Based on Fontsize)
Aadd(aBrwpres  ,{XBP_PP_COL_FA_COMPOUNDNAME,APP_BROWSEFONT})                  // Font in browse
//
// Zebra details
//
Aadd(aBrwPres  ,{XBP_PP_COL_ZEBRA_EVENROW_BGCLR,BRW_ZEBRA_EVEN_BGCOLOR})      // Zebra even row BG color
Aadd(aBrwPres  ,{XBP_PP_COL_ZEBRA_EVENROW_FGCLR,BRW_ZEBRA_EVEN_FGCOLOR})      // Zebra even row FG color
Aadd(aBrwPres  ,{XBP_PP_COL_ZEBRA_ODDROW_BGCLR ,BRW_ZEBRA_ODD_BGCOLOR})       // Zebra odd row BG color
Aadd(aBrwPres  ,{XBP_PP_COL_ZEBRA_ODDROW_FGCLR ,BRW_ZEBRA_ODD_FGCOLOR})       // Zebra odd row FG color
Aadd(aBrwPres  ,{XBP_PP_COL_ZEBRA_ENABLED,1})                                 // Enable standard zebra colour
Dc_BrowPres(aBrwPres)
Return

Leon Berger
Posts: 36
Joined: Thu Jan 28, 2010 2:30 pm

Re: Command to set text color when highlighted

#4 Post by Leon Berger »

Andy Edward wrote:I'm using express++ 1.9.260 and xBase 1.9.331

Any other ideas?
Maybe you should use xBase 1.9.355.
Best regards
Leon

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

Re: Command to set text color when highlighted

#5 Post by Wolfgang Ciriack »

I am setting the colors for background of columns with COLOR {nil, GRA_CLR_....}, that do not change the hilitecolor in DCBROWSE.
_______________________
Best Regards
Wolfgang

Andy Edward
Posts: 103
Joined: Fri Sep 17, 2010 2:58 am

Re: Command to set text color when highlighted

#6 Post by Andy Edward »

Wolfgang Ciriack wrote:I am setting the colors for background of columns with COLOR {nil, GRA_CLR_....}, that do not change the hilitecolor in DCBROWSE.
So whenever there is a color set for the row/column in browse, hilitecolor for the FG (foreground) setting is ignored?

Regards,

Andy

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Command to set text color when highlighted

#7 Post by Auge_Ohr »

try to use

Code: Select all

oBrowse:DataArea:useVisualstyle := .F.
greetings by OHR
Jimmy

Post Reply