gfilatov wrote:Thanks a lot for this fix
But the problem is persist if you select the menuitem '
Focus Button 1' for
disabled Button 1.
I guess that we should to add the checking of enabled button state before setfocus in the function _SetFocus ().
Code: Select all
...
IF _HMG_SYSDATA [ 38 ] [i] == .T.
setfocus( H )
SendMessage ( H , BM_SETSTYLE , LOWORD ( BS_DEFPUSHBUTTON ) , 1 )
ENDIF
...
I've tested and 'almost' worked, but the currently focused control looses the 'default' appearance.
So, you must include the whole code inside IF...ENDIF.
Resulting in:
Code: Select all
CASE T == 'BUTTON'
IF _HMG_SYSDATA [ 38 ] [i] == .T.
FOR J := 1 TO LEN ( _HMG_SYSDATA [1] )
If _HMG_SYSDATA [1] [J] == 'BUTTON'
IF _HMG_SYSDATA [4] [J] == GetFormHandle( ParentForm )
SendMessage ( _HMG_SYSDATA [3] [J] , BM_SETSTYLE , LOWORD ( BS_PUSHBUTTON ) , 1 )
RedrawWindow ( _HMG_SYSDATA [3] [J] )
ENDIF
ENDIF
NEXT
setfocus( H )
SendMessage ( H , BM_SETSTYLE , LOWORD ( BS_DEFPUSHBUTTON ) , 1 )
ENDIF
I'll optimized a little putting 'GetFormHandle()' and 'Len()'calls outside the loop, storing its values in variables.
Thanks again for your help.
Regards,
Roberto.