Page 1 of 1

xbrowse gradient cell colors

Posted: Fri Nov 04, 2022 10:08 am
by Silvio.Falconi
we can set a gradient color for each cell ?

Re: xbrowse gradient cell colors

Posted: Fri Nov 04, 2022 2:20 pm
by karinha
Doesn't it work like that?

¿No funciona así?

Code: Select all | Expand

oBrw:nMarqueeStyle       := 3    // Marquee style (row selected) 0 No Marquee 1 Dotted cell 2 Solid cell 3 Highlight cell 4 Highlight row & Raise Cell 5 Highlight row 6 Highlight row & multiselect 

or

oBrw:bClrRowFocus    := { || { CLR_BLACK, RGB( 150,231,255 ) } }

or

oCol:bClrSelFocus := <....>



 
or

http://forums.fivetechsupport.com/viewt ... da#p100728

or

http://forums.fivetechsupport.com/viewt ... wse#p79502

C:\FWH..\SAMPLES\XBROWGRD.PRG

Regards, saludos.

Re: xbrowse gradient cell colors

Posted: Fri Nov 04, 2022 3:32 pm
by Silvio.Falconi
karinha wrote:Doesn't it work like that?

¿No funciona así?

Code: Select all | Expand

oBrw:nMarqueeStyle       := 3    // Marquee style (row selected) 0 No Marquee 1 Dotted cell 2 Solid cell 3 Highlight cell 4 Highlight row & Raise Cell 5 Highlight row 6 Highlight row & multiselect 

or

oBrw:bClrRowFocus    := { || { CLR_BLACK, RGB( 150,231,255 ) } }

or

oCol:bClrSelFocus := <....>



 
or

http://forums.fivetechsupport.com/viewt ... da#p100728

or

http://forums.fivetechsupport.com/viewt ... wse#p79502

C:\FWH..\SAMPLES\XBROWGRD.PRG

Regards, saludos.
Please
I ask gradient color not only two colors , allready now I have the two colors as you can see here

Image

but it not is gradient

Re: xbrowse gradient cell colors

Posted: Fri Nov 04, 2022 5:29 pm
by nageswaragunupudi
Silvio.Falconi wrote:we can set a gradient color for each cell ?

Code: Select all | Expand

oCol:bClrStd := { || { <clrtext>, <aGradient> } }

Re: xbrowse gradient cell colors

Posted: Fri Nov 04, 2022 7:14 pm
by karinha

Code: Select all | Expand

   oBrw:aCols[2]:bClrStd := { || { CLR_BLACK, aRowGrad } }
 
Regards, saludos.

Re: xbrowse gradient cell colors

Posted: Sun Nov 06, 2022 8:12 pm
by Silvio.Falconi
nageswaragunupudi wrote:
Silvio.Falconi wrote:we can set a gradient color for each cell ?

Code: Select all | Expand

oCol:bClrStd := { || { <clrtext>, <aGradient> } }
Nages,
I tried to make gradient cell color

Image

I made ( I have the colors on ini file and load it on a array)

Code: Select all | Expand

 aadd( aTmpColors, {aText[n], {aBack[n],aGradient[n]}} )

but this is not a pretty sight or probably I am wrong something and I do not have the right effect I want to give, for example the gradient I see it vertical, how can I modify it to give it a more beautiful shape?


then I tried with

Code: Select all | Expand

nClr1:=aGradient[n]
             nClr2:=aBack[n]
  aadd( aTmpColors,  { aText[n], {{ 0.5, nClr1,nClr2 },{0.5, nClr2,nClr1}, .F. } } )
and I had this result

Image



with

Code: Select all | Expand

nClr1:=aGradient[n]
             nClr2:=aBack[n]
  aadd( aTmpColors,  { aText[n], {{ 0.5, nClr1,nClr2 },{0.5, nClr2,nClr1}, .t. } } )
I had this result

Image

Re: xbrowse gradient cell colors

Posted: Wed Apr 29, 2026 11:50 pm
by RAMESHBABU

Dear Mr.Silvio,

Can you please share me some code to achive cell wise colors in xBrowse like timetable of subjects.
like the one you have shown above.

-Ramesh Babu P


Re: xbrowse gradient cell colors

Posted: Thu Apr 30, 2026 4:25 am
by anserkk

Image

Code: Select all | Expand

#include "Fivewin.ch"

*---------------------------*
Function Main()
*---------------------------*
Local oDlg,oBrw
Local aLanguages:={}

aLanguages:= { { "English", "French"  , "Chinese" , "Spanish", "German"  }, ;
               { "French" , "Chinese" , "German"  , "English", "Spanish" }, ;
               { "German" , "Chinese" , "French"  , "Spanish", "English" }, ;
               { "English", "French"  , "Chinese" , "German" , "Spanish" }, ;
               { "Chinese", "French"  , "English" , "Spanish", "German"  }  }
        
DEFINE DIALOG oDlg FROM 10,10 TO 250,600 TITLE "Time Table" PIXEL TRUEPIXEL @60,0 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg UPDATE ; DATASOURCE aLanguages ; COLUMNS 1 , 2 , 3 , 4 , 5 ; HEADERS "Period 1" , "Period 2" , "Period 3" , "Period 4" , "Period 5" ; COLSIZES 100 , 100 , 100 , 100 , 100 ; PICTURES nil , nil , nil , nil , nil ; CELL LINES FOOTERS WITH OBJECT oBrw :nStretchCol:=1 :nColDividerStyle = LINESTYLE_LIGHTGRAY :nRowDividerStyle = LINESTYLE_LIGHTGRAY :lColDividerComplete := .T. :lFlatStyle:=.T. :lHScroll:=.F. :lDisplayZeros:=.F. :lFitGridHeight:=.T. :Period1:bClrStd := { || AssgnClr(oBrw:Period1) } :Period2:bClrStd := { || AssgnClr(oBrw:Period2) } :Period3:bClrStd := { || AssgnClr(oBrw:Period3) } :Period4:bClrStd := { || AssgnClr(oBrw:Period4) } :Period5:bClrStd := { || AssgnClr(oBrw:Period5) } :bRecSeldata := { || oBrw:KeyNo } :nRecSelWidth := "999" :bRecSelFooter := { || oBrw:nLen } :MakeTotals() :CreateFromCode() END ACTIVATE DIALOG oDlg CENTERED Return NIL *----------------------------------------* Function AssgnClr(oCol) *----------------------------------------* Local aClrArr:={} IF oCol:Value == "English" aClrArr:={ CLR_WHITE, RGB(238, 28, 50) } ElseIf oCol:Value == "German"
aClrArr:={ CLR_WHITE, RGB( 28, 53, 238 ) } ElseIf oCol:Value == "French"
aClrArr:={ CLR_WHITE, CLR_GREEN } ElseIf oCol:Value == "Spanish"
aClrArr:={ CLR_WHITE, METRO_VIOLET } ElseIf oCol:Value == "Chinese"
aClrArr:={ CLR_WHITE, CLR_MAGENTA } Else aClrArr:={ CLR_BLACK, CLR_WHITE } Endif Return aClrArr

Re: xbrowse gradient cell colors

Posted: Thu Apr 30, 2026 4:34 am
by RAMESHBABU

Dear Mr.Anser,

This is exactly what I want.

Thank you very much. :D

-Ramesh Babu