Button Bitmap with Caption at bottom.

Post Reply
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Button Bitmap with Caption at bottom.

Post by byron.hopp »

Anybody remember many years ago we had the capability to create a button bar with buttons which had an image kind of in the middle of the button, and a caption at the bottom of the button. Is this available anymore. We have a customer which would like to do this for an app we are converting for them.

Thanks

Byron ...
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
FranciscoA
Posts: 2163
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Button Bitmap with Caption at bottom.

Post by FranciscoA »

Maybe this way?

Code: Select all | Expand

  DEFINE BUTTONBAR oBar OF oWnd SIZE 60, 64 2007

   DEFINE BUTTON oBoto1 RESOURCE "FOLDER40"    PROMPT "Hola"   OF oBar TOOLTIP "Hi all of you"  ACTION MsgInfo("Hi")
 
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Button Bitmap with Caption at bottom.

Post by ukoenig »

Byron,

Maybe the buttonbar-style You are looking for ?

Image

best regards
Uwe :?:
Last edited by ukoenig on Sun Jun 08, 2014 8:26 am, edited 3 times 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.
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Button Bitmap with Caption at bottom.

Post by byron.hopp »

Yes this is exactly what I am looking for. Has this been in Fivewin a while, we cant get the prompt to show at the bottom of the button. It shows right in the middle of the button. My version is "Fivewin for Harbour", "FWH 7.01".
Wasn't planning on color but looks good, I might add that as well.

Byron ...
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Button Bitmap with Caption at bottom.

Post by nageswaragunupudi »

Please make sure you specified enough height to accommodate the bitmap and prompt one below the other while defining the BUTTONBAR.

Code: Select all | Expand

DEFINE BUTTONBAR oBar OF oWnd SIZE <nWidth>, <nHeight>

If the height is less, prompt will overlap the bitmap.

By default the bitmap is painted on top and prompt at the bottom. If this not working by default in older version please try adding clause "TOP" while defining the button. This indicates that the bitmap should be painted on Top.

Code: Select all | Expand

DEFINE BUTTON OF oBar RESOURCE <resname> TOP PROMPT <prompt> ACTION <action>
Regards

G. N. Rao.
Hyderabad, India
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Button Bitmap with Caption at bottom.

Post by ukoenig »

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

Image

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 :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.
Post Reply