xbrowses color

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

xbrowses color

Post 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 ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xbrowses color

Post by nageswaragunupudi »

Code: Select all

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

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowses color

Post 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) } }
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: xbrowses color

Post 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowses color

Post 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."
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: xbrowses color

Post 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowses color

Post 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 ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Marc Venken
Posts: 727
Joined: Tue Jun 14, 2016 7:51 am

Re: xbrowses color

Post 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
 
Marc Venken
Using: FWH 20.08 with Harbour
sreerajklm
Posts: 5
Joined: Tue Sep 23, 2014 5:22 am
Location: Kochi, India

Re: xbrowses color

Post 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
Last edited by sreerajklm on Fri Nov 10, 2017 8:25 am, edited 1 time in total.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowses color

Post 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()
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply