FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Highlight cel in xbrowse when xbrowse is allready running
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Highlight cel in xbrowse when xbrowse is allready running
Posted: Fri Feb 19, 2021 04:14 PM
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 (fw): Select all Collapse
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 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Highlight cel in xbrowse when xbrowse is allready running
Posted: Sat Feb 20, 2021 03:15 AM
For the entire browse:
Code (fw): Select all Collapse
oBrw:bClrStd := { || ShowColors( cVield ) }


or

For a specified column
Code (fw): Select all Collapse
oBrw:email:bClrStd := { || If( <cond1>, clrPair1, If( <cond2>, clrPair2, ... ) ) }
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion