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.zipI 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 = lGraddirectIn METHOD Paint I changed 3 times :
1.)
if ! Empty( ::aGrad )
GradientFill( ::hDC, 0,0, ::nHeight, ::nWidth, ::aGrad, ::lGraddirect )
endif2.)
...
otherwise
Rectangle( ::hDC, 0, 0, ::nHeight, ::nWidth )
if ::aGrad != nil
GradientFill( ::hDC, 1, 1, ::nHeight - 2, ::nWidth - 1, ::aGrad, ::lGraddirect )
endif
endcase3.)
else
if ::aGrad != nil
GradientFill( ::hDC, 0, 0, ::nHeight, ::nWidth, ::aGrad, ::lGraddirect )
endif
endifbest regards
Uwe