BtnBmp Question

BtnBmp Question

Postby PeterHarmes » Thu Jun 11, 2009 9:01 am

Hi,

Just testing 9.05 and have found that on some of my BtnBmps the word tBtnBmp is printed over the BMP - how do you turn this off? Is there a global setting? This seems to only happen on larger buttons that use the center clause

Thanks in advance

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: BtnBmp Question

Postby ukoenig » Thu Jun 11, 2009 10:50 am

Hello Pete,

I use 9.05 as well.
With my new buttontools, I can test all possible combinations :
from Source, Resource, 2007 Style, Transparent, Border and no Border.
BMP on left, top, bottom, right and centered.
On different backgrounds : colors, gradient, brushes and images.
A center problem, I didn't notice.

Image

Try a empty Prompt.

Code: Select all  Expand view

@ 47, 73  BTNBMP oBtn5 OF oDlg1 ;
SIZE D_BUTTONH, D_BUTTONV ;
FILENAME c_path + "\project\" + D_BUTTON2 ;
ACTION MsgAlert( "
Button-Click", "Button 5" ) ;
PROMPT "
" ;    
FONT oButtFont ;
CENTER
oBtn5:lTransparent = .t.  
oBtn5:cTooltip := "
Button5"
oBtn5:SetColor( 9208556, )


Best Resgards
Uwe :lol:
Last edited by ukoenig on Thu Jun 11, 2009 11:31 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: BtnBmp Question

Postby PeterHarmes » Thu Jun 11, 2009 11:09 am

Don't know if this makes a difference, but i am building the button from a resource using the following code:

Code: Select all  Expand view
REDEFINE BTNBMP oBtn89 ID 225 OF oFld:aDialogs[2] RESOURCE "AUDIT" ACTION (ViewInvAudit(),oBtn89:Refresh(),p_rimeth:SetFocus()) TOOLTIP "Invoice Audit" CENTER


The button looks like this:

Image
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: BtnBmp Question

Postby PeterHarmes » Thu Jun 11, 2009 11:13 am

Fixed - it's the prompt setting

Code: Select all  Expand view
REDEFINE BTNBMP oBtn89 ID 225 OF oFld:aDialogs[2] RESOURCE "AUDIT" ACTION (ViewInvAudit(),oBtn89:Refresh(),p_rimeth:SetFocus()) TOOLTIP "Invoice Audit" CENTER PROMPT ""


This now removes the text.

Antonio, is there any way that this could be modified so that if the prompt is not passed, the text does not appear?

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: BtnBmp Question

Postby ukoenig » Thu Jun 11, 2009 11:15 am

Pete,

The Test :

Image

The Code :

Code: Select all  Expand view

// Transparent-Style :
// -----------------------
REDEFINE BTNBMP oBtn5 ID 210 OF oDlg3 ;
FILENAME c_path + "\project\" + D_BUTTON2 ;
ACTION MsgAlert( "
Button-Click", "Button 5" ) ;
PROMPT "
" ;
FONT oButtFont ;
CENTER
oBtn5:lTransparent = .t.  
oBtn5:cTooltip := "
Button5"
oBtn5:SetColor( 9208556, )

// 2007 - Style :
// ----------------
REDEFINE BTNBMP oBtn5 ID 210 OF oDlg4 2007 ;
FILENAME c_path + "
\project\" + D_BUTTON2 ;
ACTION MsgAlert( "
Button-Click", "Button 5" ) ;
PROMPT "
" ;
FONT oButtFont ;
CENTER
oBtn5:cTooltip := "
Button5"
oBtn5:SetColor( 9208556, )


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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: BtnBmp Question

Postby PeterHarmes » Thu Jun 11, 2009 11:40 am

Uwe,

What happens if you remove PROMPT "" - do you get the same problem as i have?

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: BtnBmp Question

Postby PeterHarmes » Thu Jun 11, 2009 11:54 am

Think i've got it now!!

In my RC, the caption property for my button had tBtnBmp in it - if i remove that, the text does not appear. Previous versions of FW must have ignored this information.

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: BtnBmp Question

Postby Antonio Linares » Thu Jun 11, 2009 1:03 pm

Pete,

We are going to review it, thanks for your feedback :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: BtnBmp Question

Postby PeterHarmes » Thu Jun 11, 2009 1:13 pm

Antonio,

Thinking about it, the way it is working is probably the way it should work. For example, if a text string/field/say is defined in the RC file and you don't redefine the say, the text appears as it is entered in the resource - maybe thats the way btnbmp should work?

Regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: BtnBmp Question

Postby ukoenig » Thu Jun 11, 2009 7:45 pm

Hello Pete,

do You have a solution for transparent Button-Bmp on a image-background ?
I tested all solutions : Colors, Gradients, Styles, Brushes are working.
With a Image-background, transparent doesn't work ( tested from source and resource ).
I want to use empty transparent buttons as hotspot-areas.

Image

Code: Select all  Expand view

...
...
DEFINE DIALOG oDlg1 SIZE 400, 600 of oWnd FONT oDlgFont ;
TITLE "Buttons from Source Transparent" TRANSPARENT
...
...
// -----  Transparent button with NOBORDER ---------

@ 3, 4 BTNBMP oBtn1 OF oDlg1 ;
SIZE D_BUTTONH, D_BUTTONV ;
NOBORDER ;
FILENAME c_path + "\project\" + D_BUTTON1 ;
ACTION MsgAlert( "
Button-Click", "Button 1" ) ;
PROMPT "
But.1" ;
FONT oButtFont ;
RIGHT
oBtn1:lTransparent = .t.  
oBtn1:cTooltip := "
Button1"
...
...
ACTIVATE DIALOG oDlg1 CENTERED NOWAIT ;
ON INIT oDlg1:Move( 100, 20, 430, 290, .f. ) ;
ON PAINT DL_IMAGE( hDC, oDlg1 )

RETURN NIL

//------------- IMAGE - Background --------------------

FUNCTION DL_IMAGE( hDC, oDlg )
LOCAL oImage

LOCAL nWidth  := oDlg:nWidth()
LOCAL nHeight := oDlg:nHeight()

DEFINE IMAGE oImage1 FILE c_path + "
\project\" + D_LOGO
PalBmpDraw( hDC, 0, 0, oImage1:hBitmap, , nWIDTH, nHEIGHT, , .T. )

RETURN NIL


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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: BtnBmp Question

Postby PeterHarmes » Fri Jun 12, 2009 10:42 am

Hi Uwe,

I don't use transparent button-bmp - did you mean to ask the question to Antonio?

Regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], wartiaga and 91 guests