Page 1 of 2

HMG 3.0.21

Posted: Sun Feb 14, 2010 6:58 pm
by Roberto Lopez
- HMG 3.0.21 Changelog:

English:
--------

- Fixed: build.bat incorrect in various samples.

- Fixed: Misc. data-bound Grid problems: Filtered and conditional
indexed tables, SQLMIX and POSTGRE RDD locking bugs and some other
minor bugs. Thanks to raumi75, Mol and Vanguarda for reports on
problems.

- Fixed: Problem with Player control. Reported by Vanguarda.

- New: GRID.31, GRID.32 samples.

- Updated: HFCL. Contributed by Rathinagiri.


Español:
--------

- Solucionado: 'build.bat' incorrecto en varios ejemplos.

- Solucionado: Varios problemas en Grid: Tablas filtradas y con
índices condicionales, bloqueo con SQLMIX y POSTGRE y varios bugs menores.
Gracias a Raumi75, Mol y Vanguarda por los reportes.

- Solucionado: Problema con el control Player. Reportado por Vanguarda.

- Nuevo: Ejemplos GRID.31 y GRID.32.

- Actualizado: HFCL. Gracias a Rathinagiri.

Download / Descarga: www.hmgforum.com/site

Re: HMG 3.0.21

Posted: Sun Feb 14, 2010 8:52 pm
by Vanguarda
Hi friends,

Thanks Master for this new version

My best regards,

Re: HMG 3.0.21

Posted: Mon Feb 15, 2010 8:11 am
by esgici
Thanks a lot Maestro :)

Best Regards

--

Esgici

Re: HMG 3.0.21

Posted: Mon Feb 15, 2010 10:45 am
by raumi75
Thank you Roberto for the new release.

I tested the new Samples GRID.31 and GRID.32 and I am not sure, if the behaviour is intentional.

GRID.31 (SET DELETED Test)
I select the first row and click chose "RecNo" from the menu. Message: 1
I select the second row (Value 3, because row 2 is deleted). Recno is 3
I select the third row (Value 5, because row 4 is deleted). Recno IS 3 ALSO!
The Rows with the value 7 and 9 are both Recno 5.
The Rows with the value 10 and 11 are both Recno 7.

That was the sample without any modifications.

When I change the sample to SET DELETED OFF, the deleted rows are greyed out. Nice! I like that. The Recno-Function works right, when deleted is off.

Sample GRID.32 also gives wrong RecNos.



I tried to change the Sample to allow editing, but now got the error:

GRID: Editing filtered / condidtional indexed tables is not allowed. Program terminated

This error makes it a lot clearer, why the program misbehaves.

Re: HMG 3.0.21

Posted: Mon Feb 15, 2010 12:10 pm
by Roberto Lopez
raumi75 wrote:Thank you Roberto for the new release.

I tested the new Samples GRID.31 and GRID.32 and I am not sure, if the behaviour is intentional.

GRID.31 (SET DELETED Test)
I select the first row and click chose "RecNo" from the menu. Message: 1
I select the second row (Value 3, because row 2 is deleted). Recno is 3
I select the third row (Value 5, because row 4 is deleted). Recno IS 3 ALSO!
The Rows with the value 7 and 9 are both Recno 5.
The Rows with the value 10 and 11 are both Recno 7.

That was the sample without any modifications.

When I change the sample to SET DELETED OFF, the deleted rows are greyed out. Nice! I like that. The Recno-Function works right, when deleted is off.

Sample GRID.32 also gives wrong RecNos.

I tried to change the Sample to allow editing, but now got the error:

GRID: Editing filtered / condidtional indexed tables is not allowed. Program terminated

This error makes it a lot clearer, why the program misbehaves.
You are right.

I've discovered the problem many hours after publishing.

It's already fixed.

The fix will be included in the next release.

Here is it. You must replace the following functions in h_grid.prg and recompile the library.

Code: Select all

***********
function setdatagridrecno ( i , nRecNo  )
***

Local cRecordSource := ''
Local aValue
Local nLogicalPos := 0
Local j := 1

	cRecordSource	:= _HMG_SYSDATA [ 40 ] [ i ] [ 10 ]

	nBakReNo	:= &cRecordSource->(RecNo())

	aValue := _GetValue (  ,  ,  i )

	if ( empty ( &cRecordSource->( dbFilter () ) ) ) .and. ( .Not. Set ( _SET_DELETED ) )

		&cRecordSource->( dbGoTo ( nRecNo ) )
		nLogicalPos := &cRecordSource->( OrdKeyNo () )

	else

		MsgMiniGuiError("GRID: Set RecNo property not allowed for filtered tables. Program terminated" )

	endif

	&cRecordSource->( DbGoTo ( nBakReNo ) )

	_SetValue (  ,  ,  {  nLogicalPos , aValue [2] } , i )

	DataGridRefresh(i)

return nil

***********
function getdatagridrecno(i)
***

Local cRecordSource := ''
Local nItemCount
Local nHandle
Local aColumnFields := {}
Local lRet := .T.
Local j
Local aValue
Local nLogicalPos
Local nRecNo
Local nTopIndex
Local nBakReNo

	cRecordSource	:= _HMG_SYSDATA [ 40 ] [ i ] [ 10 ]

	aColumnFields	:= _HMG_SYSDATA [ 40 ] [ i ] [ 11 ]

	nHandle		:= _HMG_SYSDATA [ 3 ] [ i ] 

	nBakReNo	:= &cRecordSource->(RecNo())

	aValue := _GetValue (  ,  ,  i )


	if ( empty ( &cRecordSource->( dbFilter () ) ) ) .and. ( .Not. Set ( _SET_DELETED ) )

		&cRecordSource->( OrdKeyGoTo ( aValue[1] ) )

	else

		&cRecordSource->( dbGoTop() )

		&cRecordSource->( dbSkip( aValue[1] - 1 ) )

	endif

	nRecNo := &cRecordSource->(RecNo())

	&cRecordSource->( DbGoTo ( nBakReNo ) )

return nRecNo

Re: HMG 3.0.21

Posted: Mon Feb 15, 2010 12:51 pm
by Rathinagiri
Thanks Roberto.

Re: HMG 3.0.21

Posted: Mon Feb 15, 2010 1:19 pm
by raumi75
Thank you. I replaced the functions and now it works.

Raumi

Re: HMG 3.0.21

Posted: Tue Feb 16, 2010 4:18 am
by sudip
Thanks a lot Roberto for this version :)
It works fine. It takes 2/3 seconds only to open a large .dbf table with 522,813 records using my Celeron 1.66 laptop with 760mb ram and XP SP2. It's really very good :) I used following code for testing:

Code: Select all

#include <hmg.ch>

Function Main

   local mTable :=  GetFile ( { {'DBF Files','*.DBF'} } , "Select DBF File"), mAlias := ""
   local aFldnm := {}, aWidth := {}, aStruct := {}
   

   if empty(mTable)
      return nil
   endif
   use &mTable
   mAlias := alias()
   aStruct := dbstruct()
   for i = 1 to len(aStruct)
      aadd(aFldnm, aStruct[i, 1])
      aadd(aWidth, aStruct[i, 3]*10)
   next
   
   define window main at 0, 0 width 500 height 500 title mTable main

   	@ 10,10 GRID Grid_1 ;
			WIDTH 470 ;
			HEIGHT 440 ;
			HEADERS aFldnm ;
			WIDTHS aWidth;
			VALUE { 1 , 1 } ;
			ROWSOURCE mAlias ;
			COLUMNFIELDS aFldnm 
            
   end window
 
  Main.Center
  Main.Activate

Return
With best regards.
Sudip

Re: HMG 3.0.21

Posted: Fri Feb 19, 2010 11:24 pm
by Vanguarda
Hello my friends,

Roberto, i´ve a little doubt about activeX control.

I´ve a little project that i did for tests (is attached in this post).
Well, in this project i have a main ("Main.FMG") window with a button that call another window ("Test.FMG") that have a activex control. When a close the second window ("Test.FMG") i got error message of windows OS. When i not have the error on close the Test.FMG window, i click on the button of my MAIN window for call the second window again, so i got the same error again. Please, so kind, see the image bellow.

My doubt is: I can´t call a window with activeX control defined more than one time?!

I´ve use Windows 7 Ultimate version with theme Aero Default.

PS: Sorry for disturbing, and sorry my bad english.

With kind regards,

Re: HMG 3.0.21

Posted: Fri Feb 19, 2010 11:42 pm
by Vanguarda
Hi friends,

Roberto, i´ve a little wishe for HMG IDE.

When us added a new module (.PRG) the same is created like this:

Code: Select all

#include <hmg.ch>

Function Main

        Load Window Main
        Main.Center
        Main.Activate

Return
Exist some way for add new module function, create a new module with this initial lines?

Code: Select all

*============================================================
* Program......: <Name of program>
* Programmer...:
* Created at...: <currently date> / <currently time>
* Finished at...: 
*============================================================
*Description:
*============================================================
#include <hmg.ch>

Function Main

        Load Window Main
        Main.Center
        Main.Activate

Return
Please, it is a little wishe. If i say stupid things, let me know, ok?! :)

My best regards,

PS: Sorry my bad english