FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BTNBMP from resource missing command COLOR ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
BTNBMP from resource missing command COLOR ?
Posted: Sat Nov 25, 2017 06: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.



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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: BTNBMP from resource missing command COLOR ?
Posted: Sun Nov 26, 2017 02: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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: BTNBMP from resource missing command COLOR ?
Posted: 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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: BTNBMP from resource missing command COLOR ?
Posted: Mon Nov 27, 2017 04:35 PM

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

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: BTNBMP from resource missing command COLOR ?
Posted: Mon Nov 27, 2017 06:30 PM
Thank You very much.
much better and shorter now :

Code (fw): Select all Collapse
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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: BTNBMP from resource missing command COLOR ?
Posted: Mon Nov 27, 2017 11:40 PM
Instead of:
Code (fw): Select all Collapse
GRADIENT { |lMouseOver, oBtn| If( lMouseOver, ( oBtn:nClrText := 16777215, 255 ), ;
        { { 1, ( oBtn:nClrText := 0, 3067734 ), 3067734 } } ) }

Recommended:
Code (fw): Select all Collapse
GRADIENT { |lMouseOver, oBtn| If( lMouseOver, 255, 3067734 ) }

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


Instead of:
Code (fw): Select all Collapse
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 (fw): Select all Collapse
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

Continue the discussion