Page 1 of 1

HMG 2.9.4 (Forum test I)

Posted: Thu Aug 13, 2009 2:58 am
by Roberto Lopez
Hi All,

This release is intended to fix one of the most difficult to track bug in HMG history!!!

Well... maybe not so difficult, but it was a very elusive one :)

Code: Select all

- Harbour MiniGUI 2.9.4 Changelog:

English:

	- Fixed. Multiple buttons having 'default button' style. Reported by Vanguarda.

Español:

	- Solucionado: Multiples botones con el estilo 'botón por defecto' simultaneamente. Reportado por Vanguarda.

Please test and report!

TIA.

Regards,

Roberto.

Re: HMG 2.9.4 (Forum test I)

Posted: Thu Aug 13, 2009 3:33 am
by Vanguarda
Thanks master, for this new version.

with best regards,

Re: HMG 2.9.4 (Forum test I)

Posted: Thu Aug 13, 2009 4:21 am
by Rathinagiri
Thanks Roberto for this hard work.

Re: HMG 2.9.4 (Forum test I)

Posted: Thu Aug 13, 2009 7:21 am
by esgici
Thanks a lot Maestro :)

Best Regards

--

Esgici

Re: HMG 2.9.4 (Forum test I)

Posted: Thu Aug 13, 2009 9:03 am
by gfilatov
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
...

Re: HMG 2.9.4 (Forum test I)

Posted: Thu Aug 13, 2009 12:18 pm
by Roberto Lopez
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
...
Thanks!!!

I'll check it ASAP.

Regards,

Roberto.

Re: HMG 2.9.4 (Forum test I)

Posted: Thu Aug 13, 2009 1:26 pm
by Roberto Lopez
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.

Re: HMG 2.9.4 (Forum test I)

Posted: Thu Aug 13, 2009 1:37 pm
by Roberto Lopez
Roberto Lopez wrote:
I'll optimized a little putting 'GetFormHandle()' and 'Len()'calls outside the loop, storing its values in variables.
So, the final code will be:

Code: Select all

		CASE T == 'BUTTON'

			IF _HMG_SYSDATA [ 38 ] [i] == .T.

				L := LEN ( _HMG_SYSDATA [1] )

				F := GetFormHandle( ParentForm )

				FOR J := 1 TO L

					If _HMG_SYSDATA [1] [J] == 'BUTTON'

						IF _HMG_SYSDATA [4] [J] == F

							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

Regards,

Roberto.

Re: HMG 2.9.4 (Forum test I)

Posted: Thu Aug 13, 2009 2:00 pm
by gfilatov
Roberto Lopez wrote:
Roberto Lopez wrote:
I'll optimized a little putting 'GetFormHandle()' and 'Len()'calls outside the loop, storing its values in variables.
So, the final code will be:
...
Hi Roberto,

Thanks a lot for your instant support!
:)

Re: HMG 2.9.4 (Forum test I)

Posted: Thu Aug 13, 2009 3:44 pm
by Roberto Lopez
gfilatov wrote: Thanks a lot for your instant support!
:)
:mrgreen:

Saludos,

Roberto.