Tengo un xbrowse, al que aplico el efecto pijama:
- Code: Select all Expand view RUN
- oLbx:bClrStd:= { || { CLR_BLACK, If( oLbx:KeyNo % 2 == 0, nRGB(242,247,252),nRGB(226,226,208) ) } }
en una columna necesito que dependiendo de un valor, me pinte el texto en rojo y con otro valor, me pinte el fondo en rojo:
Texto en Rojo
- Code: Select all Expand view RUN
- WITH OBJECT oLbx:aCols[ 8 ]
:cTooltip := "(G)iro,(M)etalico"
:bEditValue := {|| if((aAlias[22])->clasef="1","G","M")}
:nHeadStrAlign := AL_CENTER
:nDataStrAlign := AL_CENTER
:bClrStd := {|| If(((aAlias[22])->clasef="1" .and. (aAlias[22])->estado="1" ),{CLR_BLACK,nRGB(250,219,216)}, {CLR_BLACK,If( oLbx:KeyNo % 2 == 0, nRGB(242,247,252),nRGB(226,226,208) )}) }
nRGB(242,247,252),nRGB(226,226,208) )}) }
END WITH
Fondo en Rojo
- Code: Select all Expand view RUN
WITH OBJECT oLbx:aCols[ 8 ]
:cTooltip := "(G)iro,(M)etalico"
:bEditValue := {|| if((aAlias[22])->clasef="1","G","M")}
:nHeadStrAlign := AL_CENTER
:nDataStrAlign := AL_CENTER
:bClrStd := { || if((aAlias[22])->clasef="2" .and. (aAlias[22])->estado="1", {CLR_HRED,If( oLbx:KeyNo % 2 == 0, nRGB(242,247,252),nRGB(226,226,208) )},{CLR_BLACK,If( oLbx:KeyNo % 2 == 0, nRGB(242,247,252),nRGB(226,226,208) )}) }
END WITH
He probado a hacer:
- Code: Select all Expand view RUN
- WITH OBJECT oLbx:aCols[ 8 ]
:cTooltip := "(G)iro,(M)etalico"
:bEditValue := {|| if((aAlias[22])->clasef="1","G","M")}
:nHeadStrAlign := AL_CENTER
:nDataStrAlign := AL_CENTER
:bClrStd := Colores(oLbx,aAlias)
END WITH
...................................................
//---------------------------
static function Colores(oLbx,aAlias)
local respuesta
if (aAlias[22])->clasef = "1" .and. (aAlias[22])->estado = "1"
respuesta := {|| {CLR_BLACK,nRGB(250,219,216)}, {CLR_BLACK,If( oLbx:KeyNo % 2 == 0, nRGB(242,247,252),nRGB(226,226,208) )} }
endif
if (aAlias[22])->clasef = "2" .and. (aAlias[22])->estado = "1"
respuesta := {||{CLR_HRED,CLR_BLACK,If( oLbx:KeyNo % 2 == 0, nRGB(242,247,252),nRGB(226,226,208) ) }, {CLR_BLACK,If( oLbx:KeyNo % 2 == 0, nRGB(242,247,252),nRGB(226,226,208) )} }
endif
return respuesta
y nada, lo ignora.
Como podría hacerlo?