REALLY IMPORTANT: is anyone interested in HMG4 ?

Moderator: Rathinagiri

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

Re: REALLY IMPORTANT: is anyone interested in HMG4 ?

Post by mrduck »

rathinagiri wrote:And I could not get the result in HMG4. Your program gets compiled but nothing comes up.
Put ed1 definition before label2 definition...

but there is still a little problem in hmg4, test() is called at program start, and not at label click...... I'm investigating...
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: REALLY IMPORTANT: is anyone interested in HMG4 ?

Post by mrduck »

mrduck wrote:but there is still a little problem in hmg4, test() is called at program start, and not at label click...... I'm investigating...
In hmg.ch,
transform this line

Code: Select all

      [:OnClick   := <bOnClick>      ]   ;;
into

Code: Select all

      [:OnClick   := <{bOnClick}>      ]   ;;
and now everything works in hmg4
Carlos Britos
Posts: 245
Joined: Sat Aug 02, 2008 5:03 pm

Re: REALLY IMPORTANT: is anyone interested in HMG4 ?

Post by Carlos Britos »

mrduck wrote: Interesting indeed !
So, if I understand correctly, IN THIS TESTS, HMG4 is 10 times quicker than HMG3.. !!??

I don't know what hmgee is (extended ? but is it a rewrite ? why this big time difference with standard hmg3 ?). oohg is ?

since you are at it, can you also try marinas-gui ?
hmgee is hmg extended
hmgee and oohg are branch of the first hmg
About marinas some time ago i get the sources but were too complex for me.
PS: I understand that this is a test only and nothing can be said for real time use of the program. Other issues may be important to users...
yes sure. Also is interesting the different behaviour in different hardware,as rathinagiri show it.
Regards/Saludos, Carlos (bcd12a)
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: REALLY IMPORTANT: is anyone interested in HMG4 ?

Post by mrduck »

rathinagiri wrote:Hi

I have attached the Interest(ing) Calculator source after removing calls to hmg3 related hfcl/c pragma.

I have added hmg3(.t.) and -DHMG3 as well.

Can you guide me how to go with porting?
The first things to do are adding:
-DHMG3 as a compile switch in hbmk.hbm or where you want...
adding as first instructions of main:
hbqt_errorsys() // otherwise no error is shown on screen
hmg3( .T. ) // to enable


Then compile, get compilation errors, investigate and correct. Then when it compiles, run the program and get the errors, investigate and correct....

Thanks to your code I found some errors in hmg.ch, in missing keyboard defines, conflicting definitions of MAXIMIZE for windows, missing begin/end ini, execute file, setfocus as a function, events that should be fired later.... but MORE IMPORTANT I found a really dangerous situation: hmg4 uses objects to store its widgets and accesses them (quite) directly, expecially WINDOWs...
Now you have the main window called INTEREST... in loans.prg you... I just paste some lines of code:

Code: Select all

         counter := counter + 1
         interest := 0    // <======== THE PROBLEM IS HERE
      endif
   enddo
   interest.loanaccount.deleteallitems()
   interest.loanaccount.header(1) := head1
Using interest as a temporary variable you destroy the object stored previously in "interest"...

This is also a side-effect on how 3 and 4 use preprocessors:

Code: Select all

// original hmg3 code
   interest.loanaccount.deleteallitems()
   interest.loanaccount.header(1) := head1
// the same code after hmg3 preprocessor
doMethod( "interest", "loanaccount", "deleteallitems" )
setProperty("interest", "loanaccount", "header", 1, head1 )
// the same code after hmg3 preprocessor
   interest:loanaccount:deleteallitems()
   interest:loanaccount:header(1, head1 )
As you can see HMG4 uses the object directly (and so it is quick... as Carlos demostrated) while HMG3 needs to use functions... and no, I won't change HMG4 to use functions...

Another issue I found in your code is about setFocus... you always use

Code: Select all

  window.widget.setfocus()
BUT not in product.prg where you use a function setfocus( widget, window )... setFocus and I imagine a lot other similar functions are not present in HMG4... how many such functions are in HMG3 ? Can we try to use preprocessor on them ???


I'm now able to compile and run... gui is not perfect :-) , there are missing images and pressing some buttons gives error due to reset "interest" object variable... but it is a starting point... !

I had to remove from your code the begin/end ini sections (I don't know if they are important for testing the software) and execute file. I think that both can be ported easily from hmg3.

I attach a screenshot...

Can you please tell me what I should do in the program to test it ?

I will commit the changes in the next days since there are a couple that needs to be tested agains existing code and possible sideeffects.


Probably I will write a short doc on porting from hmg3 to 4... in the meanwhile I need more info on _setValue and _getValue...
Attachments
intcalc01.PNG
intcalc01.PNG (41.78 KiB) Viewed 5210 times
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: REALLY IMPORTANT: is anyone interested in HMG4 ?

Post by Rathinagiri »

Wow! That's so incredible Francesco. :)

Let me try too!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: REALLY IMPORTANT: is anyone interested in HMG4 ?

Post by mrduck »

rathinagiri wrote:Let me try too!

Wait for my commit, or you will lose a lot of time
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: REALLY IMPORTANT: is anyone interested in HMG4 ?

Post by Ricci »

mrduck wrote:
Ricci wrote:
Looks like I need a lot of time. :(
I get hundreds of warnings while compiling and errors which I don´t understand at program start. With the last version of HMG4 everything was fine.
That´s frustrating.
Seems like I have to build my program from the scratch, but 2000 lines of code only for testing ????
Please remember to define HMG3 before loading hmg.ch, for example in hbmk.hbm add following line
-DHMG3

Please have a look at include\hmg3.ch, it is not complete... it is a one-time job to complete it...

I'm starting to create a doMethod function... pay attention there are only 3 parameters... for example getting ITEM from a GRID is a 4 parameter job....

Code: Select all

FUNCTION doMethod( a1, a2, a3 )
   DO CASE
   CASE pCount() == 2
      &a1:&a2()
   CASE pCount() == 3
      &a1:&a2:&a3()
   ENDCASE
RETURN .T.

Please download the last svn, Luigi commited some patches I prepared yesterday for better hmg3 compatibility.
How do I download the svn?
PLEASE add this function call hmg3(.T.) to activate some more compatible layer...

After these changes, 4 minutes work please compile again and sen me the warning file...
Now I get a runtime error:
Scope violation (protected): IMAGE:OPARENT
Called from IMAGE:OPARENT(0)
Called from IMAGE:NEW(74)

Looks like the preprocessor didn´t translate the "@ 324,479 IMAGE ...." command to BITMAP ?
I already asked, is the source code for this program open-source ?
No, sorry.
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: REALLY IMPORTANT: is anyone interested in HMG4 ?

Post by mrduck »

Ricci wrote: How do I download the svn?
From sourceforge, you will find instructions on how to do it

I'm about to commit the changes I prepared yesterday.
Now I get a runtime error:
Scope violation (protected): IMAGE:OPARENT
Called from IMAGE:OPARENT(0)
Called from IMAGE:NEW(74)

Looks like the preprocessor didn´t translate the "@ 324,479 IMAGE ...." command to BITMAP ?
Can you please send me a PM with that line complete line ?

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

Re: REALLY IMPORTANT: is anyone interested in HMG4 ?

Post by mrduck »

Thanks to the code provided by Rathinagiri I could see some problems in HMG4 and solve them.

Changes in rathinagiri code are:
- remmed begin/end ini
- created a qrc file for icons/images
- rename "interest" variable to not conflict

Now the look is "more complete" but... well, not pleasant...

I see several problems for tab pages:
a) background color of tab page - it may be a Qt problem, should investigate SOLVED, it was a property that HMG4 set to labels
b) coordinate inside the tab page, all the widgets are too low - probably in HMG3 you have other 0,0 reference ?

I updated the image, now only point b) is valid
Attachments
intcalc03.PNG
intcalc03.PNG (52.5 KiB) Viewed 5194 times
User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

Re: REALLY IMPORTANT: is anyone interested in HMG4 ?

Post by concentra »

Hi.
mrduck wrote:So, it must be said, the only one that, up to now, uses HMG4 in a production environment....

So you say that NOW there are parts of your software that is already working using HMG4 library (I imagine a separate .exe... but I also remember you message about mixing WV? with hbQt... Can you tell me how to create such a mix and if it works correctly (yes, I believe it works :-) )
Only one EXE using WVG/WVT + HMG4-QT.
WVT is a pseudo-console environment, a GUI that emulates a console.
The main "window" is WVT that calls HMG4 functions and returns to WVT.
In samples\console\demo_1.prg you can play with this.
I know that there are still missing or artially implement methods in HMG4, expecially in DBF based GRID/BROWSE when a filter is set... but generally speaking, what do you think is present in Fivewin and not in HMG4 ?
Can you tell us a little about your porting experience ?
At first, I isolated a functional HMG4 lib and freezed it in order to avoid problems with changing code in the lib itself.
Then I coded some functions in HMG4 using the WVG/WVT + HMG4-QT approach, tested and liberated to production.
Basically data entry using layouts, frames, combos, textboxes, buttonboxes, images, radiogroups and virtualgrid with arrays.
No browses.
No printing.
Browses are not relaible, yet.
And printing... In my opinion needs a complete rewrite.
In fact I arrived in HMG4 looking for a way to port kind of a "print spooler" that I use to print old clipper syntax console printing commands in Windows only printers to Linux.
But I didn't like the printing system in HMG4 and abandoned the idea while falled in love with the HMG4 since its pretty close to FiveWin and I imagined that I could convert my FiveWin code to HMG4.
And I think I can code a different printing system to HMG4 since I have some advanced skills in printing systems.

Summarizing, in my opinion, I think the weakness of HMG4 at this moment are browse and printing.
[[]] Mauricio Ventura Faria
Post Reply