Highlight cel in xbrowse when xbrowse is allready running

Post Reply
User avatar
Marc Venken
Posts: 727
Joined: Tue Jun 14, 2016 7:51 am

Highlight cel in xbrowse when xbrowse is allready running

Post by Marc Venken »

I looking for a way to highlight a cel in xbrowse on the fly (when running the program)

like most of us i use code like this :

Code: Select all

function showcolors(cVeld)
  local cKleur:=""
  local aColorPairs := { ;
  { CLR_BLACK, MY_LIGHTGREEN },;  //1
  { CLR_BLACK, MY_GREEN},;        //2
  { CLR_BLACK, MY_PAARS},;        //3
  { CLR_BLACK, MY_LIGHTYELLOW },; //4
  { CLR_BLACK, MY_YELLOW },;       //5
  { CLR_WHITE, CLR_HRED },;       //6
  { CLR_BLACK, CLR_WHITE },;       //7
  { CLR_WHITE, CLR_BLUE },;       //8
  { CLR_WHITE, CLR_HGREEN },;       //9
  { CLR_WHITE, CLR_HBLUE }}       //10


  do case
    case mailbulk->yml_open > 0 .and. mailbulk->nomails
       cKleur = aColorPairs[10]
    case mailbulk->yml_open > 0 .or. left(mailbulk->mailset,4) = "Open"
       cKleur = aColorPairs[8]
    case mailbulk->optout .or. mailbulk->bounced .or. mailbulk->nomails
       cKleur = aColorPairs[6]
    case !empty(mailbulk->mailset)
       cKleur = aColorPairs[9]
    case empty(mailbulk->mailset) .and. mailbulk->yml_open > 0 .and. mailbulk->yml_send > 0
       cKleur = aColorPairs[5]
    case empty(mailbulk->mailset) .and. mailbulk->yml_send = 0
       cKleur = aColorPairs[5]
    case empty(mailbulk->mailset) .and. mailbulk->yml_bounce > 0
       cKleur = aColorPairs[3]
    case upper(left(cVeld,6)) = "MAVECO"
       cKleur = aColorPairs[2]
    case left(cVeld,4) = "Pers"
       cKleur = aColorPairs[2]
    case cVeld = "YMLP"
       cKleur = aColorPairs[3]
    case left(cVeld,6) = "ONLINE"
       cKleur = aColorPairs[4]
    otherwise
       cKleur = aColorPairs[7]
  endcase
return cKleur

 
but this need to be changed in code every time for a new setting :

Can this be done like this ? A xbrowse that I popup in order to let it changes the combinations

Cel Colorset Condition

email { CLR_BLACK, MY_LIGHTGREEN } if data->active .and. data->online .and. data->count > 5
send { CLR_BLACK, MY_LIGHTGREEN } if.... etc...

How can I tell the active xbrowse to start using the selected conditions ?
Marc Venken
Using: FWH 20.08 with Harbour
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Highlight cel in xbrowse when xbrowse is allready running

Post by nageswaragunupudi »

For the entire browse:

Code: Select all

oBrw:bClrStd := { || ShowColors( cVield ) }
 
or

For a specified column

Code: Select all

oBrw:email:bClrStd := { || If( <cond1>, clrPair1, If( <cond2>, clrPair2, ... ) ) }
 
Regards

G. N. Rao.
Hyderabad, India
Post Reply