HMG 2.9.4 (Forum test I)

HMG announcements; Latest HMG-related news, releases, fixes and updates.

Moderator: Rathinagiri

Post Reply
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

HMG 2.9.4 (Forum test I)

Post 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.
Attachments
hmg.294.1.rar
(286.92 KiB) Downloaded 333 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Vanguarda
Posts: 543
Joined: Wed Feb 11, 2009 10:56 am
Location: Americana - SP
Contact:

Re: HMG 2.9.4 (Forum test I)

Post by Vanguarda »

Thanks master, for this new version.

with best regards,
--
Paulo Sérgio Durço (Vanguarda)


http://hmglights.wordpress.com/
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMG 2.9.4 (Forum test I)

Post by Rathinagiri »

Thanks Roberto for this hard work.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: HMG 2.9.4 (Forum test I)

Post by esgici »

Thanks a lot Maestro :)

Best Regards

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: HMG 2.9.4 (Forum test I)

Post 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
...
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 2.9.4 (Forum test I)

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 2.9.4 (Forum test I)

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 2.9.4 (Forum test I)

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: HMG 2.9.4 (Forum test I)

Post 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!
:)
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 2.9.4 (Forum test I)

Post by Roberto Lopez »

gfilatov wrote: Thanks a lot for your instant support!
:)
:mrgreen:

Saludos,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply