FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index Bugs report & fixes / Informe de errores y arreglos Bug in TBtnBmp [Solved]
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 09:18 AM

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 10:43 AM
Antonio,

Antonio Linares wrote:Enrico,

Yes, I saw the two times also.


No, they are four places to fix. Look carefully. :-)

EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 10:46 AM
Antonio,

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


No, sorry. :-)

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 10:48 AM

Enrico,

Ok, I am going to review it in deep and see whats going on.

Thanks for your great feedback, my friend :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 10:58 AM

Antonio,

you're welcome. It's our interest to keep Fivewin healty! :-)

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 11:16 AM
Enrico,

This code (in both places) seems to fix the border issue :-)

Code (fw): Select all Collapse
      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


I appreciate your comments, thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 11:26 AM
Enrico,

To me, this is the right fix (I am testing FWH\samples\testbtnb.prg).

Code (fw): Select all Collapse
      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


Anyhow, we may need to test it in deep and see if there are some side effects.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 11:53 AM

Antonio,

I'm lost in the changes. :-)

Can you send me the fixed btnbmp.prg to my email, please?

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 12:13 PM

Enrico,

xharbour and Borland, right ? :-)

(I know you can't move to harbour yet)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 12:16 PM

Enrico,

I have sent you the libs and btnbmp.prg, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 12:43 PM

Antonio,

thank you. Unfortunately the result is... ugly! :-(

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 02:37 PM

Enrico,

I am testing FWH\samples\testbtnb.prg and it looks fine.

What example are you testing ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 02:39 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 02:42 PM
Antonio,

Antonio Linares wrote:Enrico,

I am testing FWH\samples\testbtnb.prg and it looks fine.

What example are you testing ?


The simple one that I've already reported:

Code (fw): Select all Collapse
#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


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TBtnBmp
Posted: Fri May 30, 2014 02:43 PM
Antonio,

Antonio Linares wrote:


As you can see, there is no border anymore (it was there using the previous FWH release). :-)

EMG