Page 1 of 1

XBrowse header gradient

PostPosted: Wed Aug 29, 2012 12:00 pm
by StefanHaupt
Deear friends,

in this sample the header gradient does not change, what am I doing wrong ?

Code: Select all  Expand view
  #include "FiveWin.ch"
    #include "xbrowse.ch"

    REQUEST DBFCDX

    //----------------------------------------------------------------------------//

    function Main()

       local oDlg, oBrw, oFont

       SET DATE GERMAN
       SET CENTURY ON

       XBrNumFormat( 'E', .t. )

       USE CUSTOMER NEW ALIAS CUST VIA "DBFCDX"

       DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
       DEFINE DIALOG oDlg SIZE 750,400 PIXEL FONT oFont
       @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
          ALIAS "CUST" ;
          COLUMNS "First", "City", "HireDate", "Age", "Salary" ;
          CELL LINES FOOTERS NOBORDER

          oBrw:bClrGrad := { | lInvert | If( lInvert, ;
                                     { { 0.4, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
                                       { 0.6, nRGB( 255, 215,  84 ), nRGB( 255, 233, 162 ) }  ;
                                                                                            }, ;
                                     { { 0.4, nRGB( 219, 230, 244 ), nRGB( 207, 221, 239 ) }, ;
                                       { 0.6, nRGB( 201, 217, 237 ), nRGB( 231, 242, 255 ) }  ;
                                                                                                } ) }

          obrw:CreateFromCode()


       ACTIVATE DIALOG oDlg CENTERED
       RELEASE FONT oFont
       CLOSE DATA

    return nil
 

Re: XBrowse header gradient

PostPosted: Wed Aug 29, 2012 12:23 pm
by ADutheil
Did you try to set bClrHeader?

Re: XBrowse header gradient

PostPosted: Wed Aug 29, 2012 12:31 pm
by ADutheil
I just did and got an error from tbrush class :cry:

Re: XBrowse header gradient

PostPosted: Wed Aug 29, 2012 1:43 pm
by kok joek hoa
Dear Stefan,


Try :

Code: Select all  Expand view
 oBrw:bClrGrad := { | |   { { 0.4, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
                                       { 0.6, nRGB( 255, 215,  84 ), nRGB( 255, 233, 162 ) }  }  }


regard,
kok

Re: XBrowse header gradient

PostPosted: Wed Aug 29, 2012 4:03 pm
by StefanHaupt
Andre,

ADutheil wrote:Did you try to set bClrHeader?


bClrHeader does only accept a pair of colors, no gradient. I tried that before, but you can only use bClrGrad for a new gradient.

Kok,

oBrw:bClrGrad := { | | { { 0.4, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 0.6, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } } }


thanks, your suggestion is working :D