Possible to change gradient to single color in xBrowse ?

Possible to change gradient to single color in xBrowse ?

Postby ukoenig » Sat Sep 06, 2008 8:13 pm

Hello,

It seems, it is impossible to change a gradient for header / Footer
to single color at runtime.
I tested a new setting for the browse-tools.

bClrGrad => to => bClrHeader
or
bClrHeader => to bClrGrad

Image

once bClrGrad was defined, i couldn't change to => bClrHeader
I want to have the choice to use 2 Colors for the Gradient, or use
only the 1. Color ( no Gradient ).
I can change the colors from bClrGrad, but not switch to bClrHeader.

I did this test inside of a browser :

*oLbx0:bClrHeader := {|| { BR_COLOR1, BR_TCOLOR } }

oLbx0:bClrGrad := { | lInvert | If( ! lInvert, { { nMOVE1, BR_COLOR1, BR_COLOR2 }, ;
{ nMOVE1,BR_COLOR2,BR_COLOR1 } }, ;
{ { nMOVE2,BR_MCOLOR,BR_COLOR2 }, ;
{ nMOVE2,BR_COLOR2,BR_MCOLOR } } ) }

oLbx0:bClrHeader := {|| { BR_COLOR1, BR_TCOLOR } }

oLbx0:bClrHeader should be the Header-color, but it is ignored
because of the oLbx0:bClrGrad define.

If i open a extra dialog for the settings, it is ok.
In this sample NON-GRADIENT is selected.
Code: Select all  Expand view
IF nHEADGRAD = 1
   oLbx30:bClrGrad := { | lInvert | If( ! lInvert, ;
   { { nMOVE1, BR_COLOR1, BR_COLOR2 }, ;
   { nMOVE1,BR_COLOR2,BR_COLOR1 } }, ;
   { { nMOVE2,BR_MCOLOR,BR_COLOR2 }, ;
   { nMOVE2,BR_COLOR2,BR_MCOLOR } } ) }
ELSE
   bClrHeader := { BR_COLOR1, BR_TCOLOR }
ENDIF


Image

Is there a solution for it ?

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby nageswaragunupudi » Sun Sep 07, 2008 3:47 am

There are several ways to have single color for headers or footers

Alternative.1

oBrw:bClrGrad := nil
oBrw:l2007 := .f.
oBrw:bClrHeader := { || nReqdClr }
oBrw:bClrFooter := { || nReqdClr }

Alternative .2

oBrw:bClrGrad := { | lInv | If( ! lInv, ;
{ { 1, nNormalClr, nNormalClr } }, { { 1, nInvClr, nInvClr } } ) }
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Switch Gradient to color.

Postby ukoenig » Sun Sep 07, 2008 6:58 am

nageswaragunupudi,

thank you very much it works fine now.

I using a "color-change-browser" as a switch and there are extra
folder-pages for header and footer now. I had a look at the xbrowse-class.
I think the gradient-define works together on header and footer. There is no
extra one, i can define for the footer. A gradient only for the Header and a "normal" color for the footer seems not to be possible.
I have still to test this combination.
The new xBrowse-Tool-version 2.0a will have many new possible tests.

Code: Select all  Expand view

// nHEADGRAD = var to keep the information if < Gradient > or < Color >
// is used. I have to write different sources for gradient- or Color-selection.

oLbx50:bLClicked := { | nRow, nCol | ;
( nHEADGRAD := oLbx50:nRowSel, NEW_PAINT(oLbx0) ) }
.....
.....
// -----------------------------------------

FUNCTION NEW_PAINT(oLbx0)

IF nHEADGRAD = 1
   oLbx0:l2007 := .T.
   oLbx0:Refresh()
   oLbx0:bClrGrad := { | lInvert | If( ! lInvert, ;
   { { nMOVE1, BR_COLOR1, BR_COLOR2 }, ;
     { nMOVE1,BR_COLOR2,BR_COLOR1 } }, ;
   { { nMOVE2,BR_COLOR3,BR_COLOR2 }, ;
     { nMOVE2,BR_COLOR2,BR_COLOR3 } } ) }
ELSE
   oLbx0:bClrGrad := NIL
   oLbx0:l2007 := .F.
   // For each column
   // -------------------
   i := 1
   FOR i := 1 TO 3
      WITH OBJECT oLbx0:aCols[i]
         :oHeaderFont := oHeadFont
         :oFooterFont := oFootFont
         :bClrHeader := { || { BR_TCOLOR, BR_COLOR1 } } 
         :bClrFooter := { || { BR_TCOLOR, BR_COLOR1 } }
      END
  NEXT
ENDIF   

oLbx0:Refresh()

RETURN( NIL )

Last edited by ukoenig on Sun Sep 07, 2008 3:54 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby nageswaragunupudi » Sun Sep 07, 2008 12:37 pm

>
I think the gradient-define works together on header and footer.
>

Yes. Only one gradient color for both Header and Footer.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 96 guests