Bug in TBtnBmp [Solved]
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Bug in TBtnBmp
Enrico,
Yes, I saw the two times also.
Please lets try this obvious change:
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop + 1, oBmpRect:nLeft + 1, oBmpRect:nWidth, oBmpRect:nHeight )
and let me know if you get part of the border back, thanks
Yes, I saw the two times also.
Please lets try this obvious change:
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop + 1, oBmpRect:nLeft + 1, oBmpRect:nWidth, oBmpRect:nHeight )
and let me know if you get part of the border back, thanks
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Bug in TBtnBmp
Antonio,
EMG
No, they are four places to fix. Look carefully.Antonio Linares wrote:Enrico,
Yes, I saw the two times also.
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Bug in TBtnBmp
Antonio,
EMG
No, sorry.Antonio Linares wrote:Please lets try this obvious change:
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop + 1, oBmpRect:nLeft + 1, oBmpRect:nWidth, oBmpRect:nHeight )
and let me know if you get part of the border back, thanks
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Bug in TBtnBmp
Enrico,
Ok, I am going to review it in deep and see whats going on.
Thanks for your great feedback, my friend
Ok, I am going to review it in deep and see whats going on.
Thanks for your great feedback, my friend
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Bug in TBtnBmp
Antonio,
you're welcome. It's our interest to keep Fivewin healty!
EMG
you're welcome. It's our interest to keep Fivewin healty!
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Bug in TBtnBmp
Enrico,
This code (in both places) seems to fix the border issue
I appreciate your comments, thanks
This code (in both places) seems to fix the border issue
Code: Select all
if ! Empty( hBmp )
if ::lBmpTransparent
if SetAlpha() .and. ::aAlpha[ nBtn ]
ABPaint( ::hDC, oBmpRect:nLeft, oBmpRect:nTop, hBmp, ::nAlphaLevel() )
else
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft, oBmpRect:nWidth, oBmpRect:nHeight )
endif
else
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft, oBmpRect:nWidth, oBmpRect:nHeight )
endif
if ::lBorder
WndBox( ::hDC, 0, 0, ::nHeight - 1, ::nWidth - 1 )
endif
endif
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Bug in TBtnBmp
Enrico,
To me, this is the right fix (I am testing FWH\samples\testbtnb.prg).
Anyhow, we may need to test it in deep and see if there are some side effects.
To me, this is the right fix (I am testing FWH\samples\testbtnb.prg).
Code: Select all
if ! Empty( hBmp )
if ::lBmpTransparent
if SetAlpha() .and. ::aAlpha[ nBtn ]
ABPaint( ::hDC, oBmpRect:nLeft, oBmpRect:nTop, hBmp, ::nAlphaLevel() )
else
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft + 2, oBmpRect:nWidth, oBmpRect:nHeight )
endif
else
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft + 2, oBmpRect:nWidth, oBmpRect:nHeight )
endif
if ::lBorder
WndBox( ::hDC, 0, 0, ::nHeight - 1, ::nWidth - 1 )
endif
endif
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Bug in TBtnBmp
Antonio,
I'm lost in the changes.
Can you send me the fixed btnbmp.prg to my email, please?
EMG
I'm lost in the changes.
Can you send me the fixed btnbmp.prg to my email, please?
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Bug in TBtnBmp
Enrico,
xharbour and Borland, right ?
(I know you can't move to harbour yet)
xharbour and Borland, right ?
(I know you can't move to harbour yet)
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Bug in TBtnBmp
Enrico,
I have sent you the libs and btnbmp.prg, thanks
I have sent you the libs and btnbmp.prg, thanks
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Bug in TBtnBmp
Antonio,
thank you. Unfortunately the result is... ugly!
EMG
thank you. Unfortunately the result is... ugly!
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Bug in TBtnBmp
Enrico,
I am testing FWH\samples\testbtnb.prg and it looks fine.
What example are you testing ?
I am testing FWH\samples\testbtnb.prg and it looks fine.
What example are you testing ?
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Bug in TBtnBmp
Antonio,
EMG
The simple one that I've already reported:Antonio Linares wrote:Enrico,
I am testing FWH\samples\testbtnb.prg and it looks fine.
What example are you testing ?
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg;
SIZE 800, 600
@ 10, 10 BTNBMP SIZE 20, 20;
FILE "c:\fwh\bitmaps\open.bmp";
ADJUST
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Bug in TBtnBmp
Antonio,
EMG
As you can see, there is no border anymore (it was there using the previous FWH release).Antonio Linares wrote:
EMG