BTNBMP from resource missing command COLOR ?

BTNBMP from resource missing command COLOR ?

Postby ukoenig » Sat Nov 25, 2017 6:37 pm

Hello,

why there is no COLOR defined in BTNBMP from resource ?

#xcommand REDEFINE BTNBMP [<oBtn>] ;
...
....
[ GRADIENT <bGradColors> ];
???????????
[ <lGDIP: GDIP, GDIPLUS> ];

------------------

#xcommand @ <nRow>, <nCol> BTNBMP [<oBtn>] ;
[ GRADIENT <bGradColors> ];
[ COLOR <nClrFore> [,<nClrBack>] ] ;
[ <pixel: PIXEL> ] ;
[ <design: DESIGN> ] ;
[ <lGDIP: GDIP, GDIPLUS> ];

Question 2

how to change the color ( NO gradient ) on mouseover ?
I couldn't find any sample.

for gradient it works ( using vars from a dbf ) like

GRADIENT { | lMouseOver | If( ! lMouseOver,;
{ { nBPos[5], nBColA1[5], nBColB1[5] }, ;
{ nBPos[5], nBColB1[5], nBColA1[5] } }, ;
{ { nBPos[5], nBColA2[5], nBColB2[5] }, ;
{ nBPos[5], nBColB2[5], nBColA2[5] } } ) } UPDATE

I want a colorchange in buttonline 2 like for gradient in buttonline 1
( define and adjusing colors of buttongroups )
ROUND only works with style 2007 ?

for buttonline 2
I can use GRADIENT { | lMouseOver | If( ! lMouseOver,;
with only 2 colors but maybe there is another solution.

Image

regards
Uwe :?:
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

Re: BTNBMP from resource missing command COLOR ?

Postby nageswaragunupudi » Sun Nov 26, 2017 2:30 pm

In bGradient, we can specify solid colors also like:

bClrGrad := { |lMouseOver| If( lMouseOver, CLR_HRED, { { 1, CLR_BLUE, CLR_WHITE } } ) }
Regards

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

Re: BTNBMP from resource missing command COLOR ?

Postby ukoenig » Mon Nov 27, 2017 11:30 am

Mr. Rao,

Your sample works fine.
To change the textcolor as well I did the following changes
with a included Setcolor() :

GRADIENT { |lMouseOver| If( lMouseOver, ( oBtn:SetColor( 16777215, ), 255 ), ; // red with white text
{ { 1, (oBtn:SetColor( 0, ), 3067734 ), 3067734 } } ) } // green with black text

the gradient-solution

GRADIENT { | lMouseOver | If( ! lMouseOver, ;
( oBtn[1]:SetColor( 255, ), ; // red text
{ { 0.5, 3067734, 16777215 }, ; // gradient green - white
{ 0.5, 16777215, 3067734 } } ), ;
( oBtn[1]:SetColor( 8388608, ), ; // blue text
{ { 0.5, 255, 16777215 }, ; // gradient red - white
{ 0.5, 16777215, 255 } } ) ) } UPDATE

It works but I am not sure if to keep it as the final solution.

regards
Uwe :?:
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

Re: BTNBMP from resource missing command COLOR ?

Postby nageswaragunupudi » Mon Nov 27, 2017 4:35 pm

:nClrText := { |lMouseOver, oBtn| <color>( lMouseOver, oBtn ) }
Regards

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

Re: BTNBMP from resource missing command COLOR ?

Postby ukoenig » Mon Nov 27, 2017 6:30 pm

Thank You very much.
much better and shorter now :

Code: Select all  Expand view  RUN

GRADIENT { |lMouseOver, oBtn| If( lMouseOver, ( oBtn:nClrText := 16777215, 255 ), ;
        { { 1, ( oBtn:nClrText := 0, 3067734 ), 3067734 } } ) }

--------------

GRADIENT { |lMouseOver, oBtn| If( ! lMouseOver, ;
( oBtn:nClrText := 255, ; // red text
{ { 0.5, 3067734, 16777215 }, ; // gradient green - white
{ 0.5, 16777215, 3067734 } } ), ;
( oBtn:nClrText := 255, ; // blue text
{ { 0.5, 255, 16777215 }, ; // gradient red - white
{ 0.5, 16777215, 255 } } ) ) } UPDATE

 


regards
Uwe
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

Re: BTNBMP from resource missing command COLOR ?

Postby nageswaragunupudi » Mon Nov 27, 2017 11:40 pm

Instead of:
Code: Select all  Expand view  RUN

GRADIENT { |lMouseOver, oBtn| If( lMouseOver, ( oBtn:nClrText := 16777215, 255 ), ;
        { { 1, ( oBtn:nClrText := 0, 3067734 ), 3067734 } } ) }
 

Recommended:
Code: Select all  Expand view  RUN

GRADIENT { |lMouseOver, oBtn| If( lMouseOver, 255, 3067734 ) }

:nClrText := { |lMouseOver,oBtn| If( lMouseOver, 16777215, 0 ) }
 


Instead of:
Code: Select all  Expand view  RUN

GRADIENT { |lMouseOver, oBtn| If( ! lMouseOver, ;
( oBtn:nClrText := 255, ; // red text
{ { 0.5, 3067734, 16777215 }, ; // gradient green - white
{ 0.5, 16777215, 3067734 } } ), ;
( oBtn:nClrText := 255, ; // blue text
{ { 0.5, 255, 16777215 }, ; // gradient red - white
{ 0.5, 16777215, 255 } } ) ) } UPDATE
 

Recommended:
Code: Select all  Expand view  RUN

GRADIENT { |lMouseOver, oBtn| If( ! lMouseOver, ;
{ { 0.5, 3067734, 16777215 }, ; // gradient green - white
{ 0.5, 16777215, 3067734 } } ), ;
{ { 0.5, 255, 16777215 }, ; // gradient red - white
{ 0.5, 16777215, 255 } } ) ) }

:nClrText := { |lMouseOver, oBtn| If( lMouseOver, CLR_HRED, CLR_BLUE ) }
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10681
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 39 guests