Differences in BTNBMP

Differences in BTNBMP

Postby devtuxtla » Sun Mar 26, 2017 9:26 pm

Hi Fivewinnes.

In the version of FWH14.08 I use the following code to create a button bar and its buttons, as shown in figure 1, the same code using the FWH17.02 version generates a different button.
What is the difference in BTNBMP for fwh17.02?
(Original code of ukoenig)

Codigo :

Code: Select all  Expand view

DEFINE FONT oFont1  NAME "Tahoma" SIZE 0,-11
SetBalloon( .T. )

DEFINE BUTTONBAR oBar OF oWnd _3D SIZE 40,58 CURSOR oHand _2007 TOP

@ 0, 0 BTNBMP oSBtn[1] OF oBar SIZE 56, 60 PIXEL 2007 ;
NOBORDER  PROMPT "Primero"  FILENAME "C:\BMPS\NWBTOP.BMP" ;
ACTION NIL ;
FONT oFont1 TOP

oSBtn[1]:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
        { { 0.50, 16763283, 16777215 }, ;
        { 0.50, 16777215, 16763283 } }, ;
        { { 0.20, 11513775, 16777215 }, ;
        { 0.20, 16777215, 11513775 } } ) }
       
oSBtn[1]:lRound := .f.
oSBtn[1]:lTransparent := .t.  
oSBtn[1]:cToolTip =  {"Ir al", "Primero ", 1, CLR_BLACK, 14089979 }
oSBtn[1]:SetColor( 0, )
 


Barra generada con fwh14.08

Image

Barra generada con fwh17.02
Image

How do I define it with fwh17.02 to get the same result?

Thank you
Visite Chiapas, el paraiso de México.
devtuxtla
 
Posts: 392
Joined: Tue Jul 29, 2008 1:55 pm

Re: Differences in BTNBMP

Postby nageswaragunupudi » Mon Mar 27, 2017 3:42 am

In the version of FWH14.08 I use the following code to create a button bar and its buttons, as shown in figure 1, the same code using the FWH17.02 version generates a different button.
What is the difference in BTNBMP for fwh17.02?


The main difference is that in older versions Btn:lTransparent was not working on buttonbars, but now it is working. So you see the background color of the Bar.

If you remove :lTransparent := .t., you will see the gradient of the button as expected.

Though it works, it is not the recommended way to create buttons on buttonbars. We give below the recommended way to create buttons on buttonars.


Code: Select all  Expand view
#include "fivewin.ch"

#define GRAD_BTNS_ONLY

function main()

local oWnd, oBar, oFont1, aGrad, oBtn

aGrad = { | lMouseOver | If( ! lMouseOver,;
        { { 0.50, 16763283, 16777215 }, ;
        { 0.50, 16777215, 16763283 } }, ;
        { { 0.20, 11513775, 16777215 }, ;
        { 0.20, 16777215, 11513775 } } ) }

DEFINE FONT oFont1  NAME "Tahoma" SIZE 0,-11
SetBalloon( .T. )

DEFINE WINDOW oWnd
oWnd:SetFont( oFont1 )

DEFINE BUTTONBAR oBar OF oWnd _3D SIZE 64,64 2007

#ifndef GRAD_BTNS_ONLY
   oBar:bClrGrad := aGrad
#endif

DEFINE BUTTON oBtn OF oBar FILE "C:\fwh\bitmaps\attach.BMP" PROMPT "Primero" ;
   TOOLTIP  {"Ir al", "Primero ", 1, CLR_BLACK, 14089979 }

#ifdef GRAD_BTNS_ONLY
oBtn:bClrGrad := aGrad
#endif

ACTIVATE WINDOW oWnd CENTERED

return nil
 
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 49 guests