About hmg3 and hmg4 compatibility

Moderator: Rathinagiri

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: About hmg3 and hmg4 compatibility

Post by mrduck »

mrduck wrote:GetControlType in hmg3 is a function and it is ok in the hmg3 semi-oop style...

Code: Select all

Function GetControlType (ControlName,ParentForm)
The function should be ok in this way (I don't like macros, if it's possible to do in iother ways please tell me)

Code: Select all

Function GetControlType (xControlName,xParentForm)
Local mVar
   mVar := xParentForm + ":" + xControlName + ":cClass"
Return ( &mVar )
Done that, now is the line

Code: Select all

   aRet := GetProperty (  ParentForm  , ControlName , 'Item' , GetProperty( ParentForm , ControlName , 'Value' ) )
that doesn't work since hmg4 implementation has only 3 parameters.... I'm trying to understand what this line wants to get... do you how to translate it in hmg4 ?
Since I don't like to use macros I decided to change the calling code to use objects directly:

Code: Select all

   // cPesq := ValorDaColuna( "GIndice" ,  "Form_1" , 1 )  it called GetProperty
   v := Form_1:GIndice:Value

   cPesq := form_1:GIndice:cell( 1,v )

Then I spent a lot of time trying to understand why my grids were always empty.... the problem is in grid.prg where is still used ::lCreated to guard code with IFs... this use of ::lCreated has been changed and so the IF ::lCreated must be removed (not all, one by one checking what we are doing).
I temporarily solved setting lCreated=.T. in New().

Then I had to remove NOMAXIMIZE and NOSIZE since not present in hmg4 now.


Now the program starts and partially works... I attach a screenshot of hmg4 (left) and hmg3 (right)... there are some differences... :-)

- background color of the grid
- row header
- navigation cursor in the grid
- doublecking a cell in hmg4 grid enables it for editing
- the animation and icon but it was expected
Attachments
Immagine.JPG
Immagine.JPG (97.11 KiB) Viewed 2086 times
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: About hmg3 and hmg4 compatibility

Post by mrduck »

In order to have hmg4 grid behave by default like the hmg3 grid (do we REALLY want this ??) we should do some changes, also in the samples and solve some problems found
mrduck wrote: - row header
I added

Code: Select all

::showRowHeader():hide(.F.)
in grid():new() since "standard hmg3" grids don't have vertical headers...
- navigation cursor in the grid
I'm doing some tests and this may be a big problem because set rowbased navigation seems to break doubleclick handling. Should do some more tests.
- doublecking a cell in hmg4 grid enables it for editing
add "without calling the onDblClick codeblock"
This is related to the previous.
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: About hmg3 and hmg4 compatibility

Post by mrduck »

I did a couple of commits to add most of the changes listed in this thread to svn.

Please note that in grid.prg I set hmg3 defaults, so it may be needed to adapt some hmg4 code that uses GRID

I also added the command definitions that were needed to compile agenda.prg. Its code is still a mess and I want to polish it a bit.... does anybody have an idea on how to handle the .setfocus => sefocus() stuff ??

Francesco
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: About hmg3 and hmg4 compatibility

Post by mrduck »

About the issue of porting hmg3 code to hmg4 I can say that I was able to compile a HMG3 source given me by Luigi with hmg4 and run the program succesfully. It took me hours due to preprocessor hacks, errors in hmg4, Qt constraints, and several other issues...

In the process I completed the switch to a new parent/children handler and the removal of aControls.

I will keep to do testing and I will commit by the end of august.
Post Reply