Page 1 of 1

Command to set text color when highlighted

Posted: Mon Jun 08, 2015 2:56 am
by Andy Edward
Hi Roger,
brow1.png
brow1.png (18.03 KiB) Viewed 10047 times
brow2.png
brow2.png (26.76 KiB) Viewed 10047 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

Re: Command to set text color when highlighted

Posted: Mon Jun 08, 2015 5:15 am
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
//

Re: Command to set text color when highlighted

Posted: Mon Jun 08, 2015 9:41 pm
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

Re: Command to set text color when highlighted

Posted: Mon Jun 08, 2015 11:35 pm
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.

Re: Command to set text color when highlighted

Posted: Mon Jun 08, 2015 11:41 pm
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.

Re: Command to set text color when highlighted

Posted: Mon Jun 08, 2015 11:55 pm
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

Re: Command to set text color when highlighted

Posted: Tue Jun 09, 2015 5:48 am
by Auge_Ohr
try to use

Code: Select all

oBrowse:DataArea:useVisualstyle := .F.