Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Button Bitmap with Caption at bottom.
Posted: Sun Jun 08, 2014 07:22 AM
The same but designed as a vertical buttonbar.
Now it is possible, to use a horizontal gradient-direction ( class-change needed ).
Download ( PRG
without the changed BTNBMP-class, included ) :
http://www.pflegeplus.com/DOWNLOADS/Bartest1.zip
I used BtnBMP !!!
@ 0, 0 BTNBMP oSBtn[1] OF oBar ;
SIZE 90, 60 PIXEL 2007 ; // B / H
NOBORDER ;
PROMPT "Button &1" ;
FILENAME c_path1 + "Select.Bmp" ;
ACTION MsgAlert( "Button 1", "Attention" ) ;
FONT oFont1 ;
TOP
oSBtn[1]:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
{ { 0.20, 16763283, 16777215 }, ;
{ 0.20, 16777215, 16763283 } }, ;
{ { 0.20, 9934847, 16777215 }, ;
{ 0.20, 16777215, 9934847 } } ) }
oSBtn[1]:lRound := .f.
oSBtn[1]:lGraddirect := .F. // class-change needed for HORIZONTAL-gradient !!!
oSBtn[1]:lTransparent := .t.
oSBtn[1]:cToolTip = { "Select a Image ","Load Image", 1, CLR_BLACK, 14089979 }
oSBtn[1]:SetColor( 0, )
changes in class BTNBMP
new
DATA lGraddirect AS LOGICAL INIT .T.
in METHOD New( and METHOD ReDefine(
I added <
lGraddirect >
and a new line
::lGraddirect = lGraddirect
In METHOD Paint I changed 3 times :
1.)
if ! Empty( ::aGrad )
GradientFill( ::hDC, 0,0, ::nHeight, ::nWidth, ::aGrad, ::lGraddirect )
endif
2.)
...
otherwise
Rectangle( ::hDC, 0, 0, ::nHeight, ::nWidth )
if ::aGrad != nil
GradientFill( ::hDC, 1, 1, ::nHeight - 2, ::nWidth - 1, ::aGrad, ::lGraddirect )
endif
endcase
3.)
else
if ::aGrad != nil
GradientFill( ::hDC, 0, 0, ::nHeight, ::nWidth, ::aGrad, ::lGraddirect )
endif
endif
best 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.