FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Disabled button get still clickable (TBtnBmp) - SOLVED
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Disabled button get still clickable (TBtnBmp) - SOLVED
Posted: Wed Oct 29, 2014 01:39 AM
Dear all,

Code (fw): Select all Collapse
        @3, 3  GET oGet VAR cVar OF oBar PIXEL;
               SIZE 260, 20;
               PICTURE '@!';
               BITMAP 'Note16';
               ACTION (  MsgInfo('This should be disabled', oGet:oBtn:ClassName()) )    //this is the issue.. WHY :oBtn still clickable??? ..

               oGet:lBtnTransparent := .T.                                                                  //i need class TBtnBmp
               oGet:CreateButton()

               oGet:oBtn:Disable()


Is this bug?
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Disabled button get still clickable (TBtnBmp)
Posted: Wed Oct 29, 2014 06:23 AM

Frances,

Was this working fine previously ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Disabled button get still clickable (TBtnBmp)
Posted: Wed Oct 29, 2014 08:18 AM
Antonio Linares wrote:Frances,

Was this working fine previously ?



Antonio,

I revert back to v14.08 down to my version v12.05..
Sadly, it is a bug.
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Disabled button get still clickable (TBtnBmp)
Posted: Wed Oct 29, 2014 09:18 AM

Frances,

Is it working fine in version v12.05 ?

many thanks for your feedback

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Disabled button get still clickable (TBtnBmp)
Posted: Thu Oct 30, 2014 12:00 AM
Antonio Linares wrote:Frances,

Is it working fine in version v12.05 ?

many thanks for your feedback



Antonio,

No it's not.

This is the first time I used TBtnBmp on Button Get. I was just looking for a way to make oGet:oBtn transparent and no border
when I discovered the bug.
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Disabled button get still clickable (TBtnBmp)
Posted: Thu Oct 30, 2014 07:02 AM
Frances,

Not sure if this is what you are looking for. This example is working fine :-)

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg

   DEFINE DIALOG oDlg SIZE 500, 300

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT BuildBar( oDlg )

return nil

function BuildBar( oDlg )

   local oBar, oGet, cVar := Space( 20 )

   DEFINE BUTTONBAR oBar OF oDlg 2007

   @ 3, 3 GET oGet VAR cVar OF oBar PIXEL;
      SIZE 260, 20;
      PICTURE '@!';
      ACTION MsgInfo( 'This should be disabled', oGet:oBtn:ClassName() ) 
   
   oGet:oBtn:Disable()
   
return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Disabled button get still clickable (TBtnBmp)
Posted: Fri Oct 31, 2014 12:05 AM
Antonio,

These are all of my button gets.. but all buttons are not like that of TBtnBmp, no border on bitmap and transparent..
Please review the following lines:

Code (fw): Select all Collapse
oGet:oBtn:lBtnTransparent := .T.
oGet:CreateButton()
...
oGet:oBtn:Disable()
...


Where oGet:bAction still executes..
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Disabled button get still clickable (TBtnBmp)
Posted: Fri Oct 31, 2014 05:43 AM

Frances,

You don't need this line as FWH creates the button automatically:

oGet:CreateButton()

Also, are you using a dialog box ? You will not be able to disable a button until it has a valid Windows handle, so it has to be done from the ON INIT clause of the dialog.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Disabled button get still clickable (TBtnBmp)
Posted: Fri Oct 31, 2014 06:24 AM

Antonio,

Please refer to this testbed

https://drive.google.com/folderview?id= ... =drive_web

If from redefine.. no need to add :createbutton() but if from @1,1 Get... I must in order to create tBtnBmp instead of tbuttonbmp.

Please kindly check.

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Disabled button get still clickable (TBtnBmp)
Posted: Fri Oct 31, 2014 08:25 AM

Frances,

Please try this before you call CreateButton():

oGet:oBtn:End()

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Disabled button get still clickable (TBtnBmp)
Posted: Fri Oct 31, 2014 12:28 PM
Frances,

This seems to be the right way to do it:

Code (fw): Select all Collapse
 DEFINE BUTTONBAR oBar SIZE 28, 28 OF oDlg TOP 3D 2010

        @3, 3  GET oGet VAR cVar OF oBar PIXEL;
               SIZE 260, 20;
               PICTURE '@!';
               BITMAP 'Note16';
               ACTION (  MsgInfo('This should be disabled', oGet:oBtn:ClassName()) )
               
        oGet:oBtn:End()
        oGet:lBtnTransparent = .T.
        oGet:CreateButton()       
        oGet:oBtn:Disable()


Please notice that if you double click on the GET its contents will overlap the button. It is not a nice effect :-)

I am thinking a way to solve that, but it does not seems easy.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Disabled button get still clickable (TBtnBmp) - SOLVED
Posted: Sat Nov 01, 2014 12:10 PM
Antonio Linares wrote:Frances,

Please try this before you call CreateButton():

oGet:End()



Antonio,

This solved my issue. :-)
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Disabled button get still clickable (TBtnBmp) - SOLVED
Posted: Sat Nov 01, 2014 12:35 PM

Very good :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion