FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Small bug in class TBTNBMP
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Small bug in class TBTNBMP
Posted: Fri Jan 13, 2012 11:57 PM

A friend of mine noticed a small problem with TBTNBMP class. If an accelerator key if defined for a button it works even the button is disabled. I patched adding

.AND. aControls[ n ]:lActive

to line (1631 in FWH 11.12)

if Upper( SubStr( cPrompt, nAt + 1, 1 ) ) == Upper( Chr( nKey ) )

in CallClick function in class TControl but I don´t know if it is the best way.

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Small bug in class TBTNBMP
Posted: Sat Jan 14, 2012 08:29 AM

André,

Very good, thanks :-)

Just a minor change to your code:

        if Upper( SubStr( cPrompt, nAt + 1, 1 ) ) == Upper( Chr( nKey ) ) .and. IsWindowEnabled( aControls[ n ]:hWnd )
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion