Page 1 of 1

xbrowses color

Posted: Wed Nov 08, 2017 3:57 pm
by Silvio.Falconi
I tried to insert the color of row with a condition but I not have success

Image

I wish change color all lines have V at seven column

I made



oLbx:bClrStd := {|| { IIF(oLbx:aArrayData[1][7]="V", CLR_GRAY,CLR_BLUE),CLR_WHITE } }

or

cColor1:= CLR_GRAY
cColor2:= CLR_BLUE

AEval( oLbx:aCols, {|oCol|oCol:bClrStd := { || { CLR_WHITE, If(oLbx:aArrayData[1][7]="V", cColor1, cColor2 ) } }



Then I tried
oLbx:bClrStd := {|| { IIF(arrayTicket[oLbx:nArrayAt,7]="V",CLR_GREEN,CLR_RED),CLR_WHITE } }

Image

but it write the text and not the background

where is the error ?

Re: xbrowses color

Posted: Wed Nov 08, 2017 4:26 pm
by nageswaragunupudi

Code: Select all

oLbx:bClrStd := {|| { IIF(oLbx:aRow[7]="V", CLR_GRAY,CLR_BLUE),CLR_WHITE } }

Re: xbrowses color

Posted: Wed Nov 08, 2017 4:53 pm
by Silvio.Falconi
I wish the background with color and the text on white
TYPE
oLbx:bClrStd := {|| { IIF(oLbx:aRow[7]="V", CLR_GRAY,CLR_BLUE),IIF(oLbx:aRow[7]="V",RGB( 220, 235, 252 ) ,CLR_WHITE) } }

Re: xbrowses color

Posted: Wed Nov 08, 2017 5:42 pm
by Otto
Hello Silvio,
please try to insert :value.
oLbx:bClrStd := {|| { IIF(oLbx:aRow[7]:value="V", CLR_GRAY,CLR_BLUE),CLR_WHITE } }

I would suggest you to switch to Fivedit.
Have you seen the video.
Best regards,
Otto


Image

Image

Re: xbrowses color

Posted: Wed Nov 08, 2017 8:47 pm
by Silvio.Falconi
Otto, for now I use xmate ... In Italy there is a adage...."Who leaves the old road for the new knows that what he leaves does not know what he finds."

Re: xbrowses color

Posted: Wed Nov 08, 2017 10:02 pm
by Otto
Hello Silvio,
does you program work with
oLbx:bClrStd := {|| { IIF(oLbx:aRow[7]:value="V", CLR_GRAY,CLR_BLUE),CLR_WHITE } }.


Best regards,
Otto

Re: xbrowses color

Posted: Thu Nov 09, 2017 7:53 am
by Silvio.Falconi
The colors is good
only I have records link to another record
I explain you

I have a product : "Pizza Caprese"
and then I have variants of this product sample :
"Più Prosciutto"
"Più mozzarella"

I wish show a color with a link I not Know How make it :

2 "Pizza Caprese"
--------- "Più Prosciutto"
--------- "Più mozzarella"
1 " cocacola"
2 "Dessert"

the products must have different colors and his variant a color near to color's prduct
What I can build ?

Re: xbrowses color

Posted: Thu Nov 09, 2017 8:14 am
by Marc Venken
Maybe with a function call in the cell ?

oBrw[6]:T1:bClrStd := { || showcolors(oBrw[6]:T1:Value) }
oBrw[6]:T2:bClrStd := { || showcolors(oBrw[6]:T2:Value) }
oBrw[6]:T3:bClrStd := { || showcolors(oBrw[6]:T3:Value) }

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

  do case
    case cVeld = "X"
       cKleur = aColorPairs[2]
    case cVeld = "K"
       cKleur = aColorPairs[3]
    case cVeld = "V"
       cKleur = aColorPairs[5]
    otherwise
       cKleur = aColorPairs[1]
  endcase
return cKleur
 

Re: xbrowses color

Posted: Fri Nov 10, 2017 5:17 am
by sreerajklm
Are you looking like this,

Image

Code: Select all

#Include "FiveWin.ch"

*-----------------------------------------*
Function Main()
*-----------------------------------------*
Local oWnd,oBrw
Local aArry:={{"Pizza Caprese","PIZCA","P"},;
              {"Più Prosciutto","PIZCB","V"},;
              {"Più mozzarella","PIZCC","V"},;
              {"Cocacola","COCAC","P"},;
              {"Cocacola One","COCAA","V"},;
              {"Cocacola Two","COCAB","V"}}

DEFINE WINDOW oWnd TITLE "Test" 

@ 1, 1 XBROWSE oBrw SIZE 500, 230 OF oWnd ;
    ARRAY aArry ;
    HEADER "Item Name","Item Code","Item Level" ;
    COLUMNS 1,2,3 ; 
    COLSIZES 250,140


    WITH OBJECT oBrw
        :nColDividerStyle = LINESTYLE_LIGHTGRAY
        :nRowDividerStyle = LINESTYLE_LIGHTGRAY 
        :ItemName:bindent:={ || If(Alltrim(oBrw:ItemLevel:Value) == "P" ,0,20 )}    
        :bClrStd  := { || IF( (oBrw:ItemLevel:Value) = "P" ,;
                                              { 16777215,RGB(248, 100, 12) },;
                                              { 16777215,RGB(154, 188, 49) } ) }   
                                                
        :CreateFromCode()                                   
    END

ACTIVATE WINDOW oWnd
Return Nil
Regards
Sreeraj

Re: xbrowses color

Posted: Fri Nov 10, 2017 7:34 am
by Silvio.Falconi
It can go good
but I have another structure

Image


USE CONSUM ALIAS CO
INDEX ON upper(NUMDOC)+Upper(numriga) TAG MESACON TO CONSUM for !deleted()