FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BtnBmp Question
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
BtnBmp Question
Posted: Thu Jun 11, 2009 09: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

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: BtnBmp Question
Posted: 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.



Try a empty Prompt.

Code (fw): Select all Collapse
@ 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 :-)
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.
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: BtnBmp Question
Posted: 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 (fw): Select all Collapse
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:

Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: BtnBmp Question
Posted: Thu Jun 11, 2009 11:13 AM
Fixed - it's the prompt setting

Code (fw): Select all Collapse
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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: BtnBmp Question
Posted: Thu Jun 11, 2009 11:15 AM
Pete,

The Test :



The Code :

Code (fw): Select all Collapse
// 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 :-)
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.
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: BtnBmp Question
Posted: Thu Jun 11, 2009 11:40 AM

Uwe,

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

Pete

Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: BtnBmp Question
Posted: 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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: BtnBmp Question
Posted: Thu Jun 11, 2009 01:03 PM

Pete,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: BtnBmp Question
Posted: Thu Jun 11, 2009 01: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

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: BtnBmp Question
Posted: Thu Jun 11, 2009 07: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.



Code (fw): Select all Collapse
...
...
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 :-)
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.
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: BtnBmp Question
Posted: 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

Continue the discussion