About HMG.4 Samples...

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 3966
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 21 times
Been thanked: 159 times

About HMG.4 Samples...

Post by Roberto Lopez » Tue Nov 29, 2011 7:19 pm

Hi All,

I'm trying to get up to date with unread messages from my absence.

I've found an interesting post by Mustafa.

These are the most relevant quotes:

Spanish (original):

"Cuando aparecio HMG4 vi que sinceramente no podia volverme a reciclar y continuaba con HMG 3 o desistia en este entorno de programación."

English (translated by me):

"When HMG4 appeared, I've understood that I couldn't recycle myself again and then I should continue with HMG3 or desist of this programming environment"

Another quote of the same post:

Spanish:

"Ya que no veo que HMG4 ,sea estructurada como HMG3 como lo está haciendo Marinas-Gui, seguiré con HMG3 , para mi es una maravilla."

English (translated by me - not literal):

"Since I not see that HMG4 be structured like HMG3 (as Marinas-Gui is doing) I'll keep with HMG3, for me is wonderful".

When I've started HMG-OBJECTS (later HMG.4) My goal was to build a library with an OOP heart and a Semi-OOP 'dress' on top of it. In such way that HMG users (all of them semi-OOP programmers) could still feeling 'at home'.

But, why Mustafa (and other HMG users) not feel good with HMG.4?

Should be no reason for that, since the semi-OOP layer is there and working pretty well.

You can really code HMG.4 almost exactly as you've done in MiniGUI and HMG 2.x/3.x.

ie:

Code: Select all

#include "hmg.ch"

FUNCTION Main

   DEFINE MAINWINDOW oWindow
      Row     10
      Col     10
      Width   400
      Height  400
      Title   'Nice OOP Demo!!!'
      OnInit  oWindow:Center()

   END WINDOW

   ACTIVATE WINDOW oWindow

   RETURN NIL
This will work perfectly with current HMG.4 SVN, (eliminating the -w3 flag or using /3 parameter at build) so... what is the problem?

I guess that the samples is the answer.

In fact, not the samples themselves, but how are they organized (of course I've organized them this way, so I'm not blaming anybody :) ).

When an HMG users, take a look at samples, he will find a lot of OOP samples and he could think that HMG.4 is only that.

So, my proposition is to reorganize the samples in two folders. One called 'samples.oop' and other called 'samples-semi-oop'.

Then, simply moving all semi-oop samples together, the HMG users will find that they can fell good at HMG.4 too.

If you agree, we can do it.

I'll wait for your opinions...
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
esgici
Posts: 4503
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 380 times
Been thanked: 111 times
Contact:

Post by esgici » Tue Nov 29, 2011 7:36 pm

Roberto Lopez wrote:...
I'll wait for your opinions...
My feeling isn't much different than Mustafa :(

And agree on "samples" point.

Personally me ( and I guess most of HMG users ) learned HMG by samples.

My opinion is before classification, we have make some other works on samples of HMG.4. Eliminating errors may be a step.

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

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

Post by mrduck » Tue Nov 29, 2011 8:13 pm

Hi Roberto,
very intresting your post.

I started a thread months ago... asking for comments. I received a couple of very disappointing replies. For some, hmg3/win32 is enough, for others, no time, no will to spend time learning a new thing....

I don't remember the names, I just remember about Ricci. He stated that HMG4 was slow and it was not possible to work as hmg3. But he, contrary to the other people, started to actually using hmg4, spent some time on his orchid project. One person did a speed comparative test and HMG4 won by large !!!
I told Ricci he could contact me and Luigi (remember that Luigi coded much of the core form handlings!) privately and he did. So we were able to do some changes to the code when he submitted problems...

Then he started to learn core code. I'm frank: HMG4 is WAY WAY WAY easier to understand than hmg3 or marinas code !! And now he has commit rights ! And he implemented some nice faetures I think are not possible with HMG3 and he is describing in his posts here.

He did his part of duty, like Roberto is doing now and me and Luigi did in the past ! Testing and submitting problems, and now starting to submit code !

So, I don't want to start a flame, but I think to have made clear statements in the past, several times: HMG4 was 90% compatible with HMG3 and now is a lot more...

What missed was the willingness of other people to spend time testing and do reports....

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Tue Nov 29, 2011 8:29 pm

Personally me ( and I guess most of HMG users ) learned HMG by samples
I am one of this. I really feel happy to understand thru samples codes. HMG4 seems really so good but I will have to learn. I have study Java and I am not really able to do any thing in Java due diferent way of programming. I know that I should learn OOP and I hope to join this ship with all of you and I will be so happy to learn more Harbour + HMG + QT strenght.
For now I really thank you all of you. I am waiting for next release of HMG4. I know that I could update thru svn but I do not like to use it.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Roberto Lopez
HMG Founder
Posts: 3966
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 21 times
Been thanked: 159 times

Post by Roberto Lopez » Wed Nov 30, 2011 1:33 am

esgici wrote:
Roberto Lopez wrote:...
I'll wait for your opinions...
My feeling isn't much different than Mustafa :(
The MiniGUI library/HMG2.x/3.x core is complex and many users don't know how it works. In fact they doesn't need to know how it works to use it.

The same applies to HMG.4.

The only important thing to HMG users is the semi-oop layer.

In HMG.4 this layer is working and the programming style is the same.

The two most important things about it are:

- Public window objects (no need to care about variable scopes).

- Controls accessible from anywhere in the form <window>.<control>.<property>

The following sample will work with current SVN (remember to build with /3 or suppress the '-w3' parameter from hbmk2 call).

Code: Select all

/*
 * $Id: demo_2.prg 760 2011-10-21 12:01:51Z l3wonsf $
*/

/*
 * HMG 4 demo
 * (c) 2010 Roberto Lopez <mail.box.hmg@gmail.com>
*/

#include "hmg.ch"

FUNCTION Main

   DEFINE MAINWINDOW oWindow1
      Row    10
      Col    10
      Width  400
      Height 400
      Title  'Nice OOP Demo!!!'
      OnInit oWindow1:Center()

      @ 40,40 Button oButton1        ;
         Caption 'OOP Button!!!'     ;
         On Click ButtonClick()

   END WINDOW

   ACTIVATE WINDOW oWindow1

RETURN NIL

/*----------------------------------------------------------------------*/

PROCEDURE ButtonClick()

   * SetProperty ( 'oWindow1' , 'oButton1' , 'Caption' , 'New!' )
   * Or oWindow1:oButton1:Caption := 'New!'
   * Or oWindow1.oButton1.Caption := 'New!'

   MsgInfo( oWindow1:oButton1:Caption , 'Standard Send Operator' )
   MsgInfo( oWindow1.oButton1.Caption , 'Alternate Send Operator' )
   MsgInfo( GetProperty( 'oWindow1' , 'oButton1' , 'Caption' ) , 'GetProperty()' )

RETURN
You could even use some other variant of DEFINE WINDOW command and it will work too.

Why change to HMG.4?

Because it has LOTS of new things that are not available at WIN32 API (the base for minigui and HMG) and because adding new features is a LOT EASIER than in previous HMG versions.
esgici wrote: And agree on "samples" point.

Personally me ( and I guess most of HMG users ) learned HMG by samples.

My opinion is before classification, we have make some other works on samples of HMG.4. Eliminating errors may be a step.
My idea is to move semi-oop (xbase samples) and work with them in its new location.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3966
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 21 times
Been thanked: 159 times

Post by Roberto Lopez » Wed Nov 30, 2011 1:37 am

Pablo César wrote:
Personally me ( and I guess most of HMG users ) learned HMG by samples
I am one of this. I really feel happy to understand thru samples codes. HMG4 seems really so good but I will have to learn. I have study Java and I am not really able to do any thing in Java due diferent way of programming. I know that I should learn OOP and I hope to join this ship with all of you and I will be so happy to learn more Harbour + HMG + QT strenght.
For now I really thank you all of you. I am waiting for next release of HMG4. I know that I could update thru svn but I do not like to use it.
My hope is that via the IDE and the reorganized samples, the path be for you (and other HMG users) more clear and easy...
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3966
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 21 times
Been thanked: 159 times

Post by Roberto Lopez » Wed Nov 30, 2011 2:09 am

mrduck wrote: <...>
So, I don't want to start a flame, but I think to have made clear statements in the past, several times: HMG4 was 90% compatible with HMG3 and now is a lot more...

What missed was the willingness of other people to spend time testing and do reports....
I don't want to start a flame either...

I'm just trying to understand what's happening and help with it.

HMG semi-OOP model, is elegant, nice, clean and simple.

You can create a window with some lines of code only and everybody (even a non programmer) could easily understand the code immediately (this is no my merit, I've was inspired on this by RAPIDQ).

Besides that, I've created samples that shows only one concept at a time. This helps a lot to new users searching for a clue about how to use a new tool.

Semi-oop is working in HMG.4, so, I'm sure that dedicating an exclusive section to simple semi-oop samples will make clear to all HMG community that HMG.4 is as easy to use as previous versions, being, at the same time, more powerful and fast.

Then... they will join us.

If there is no objections about that, I'll start the work.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3966
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 21 times
Been thanked: 159 times

Post by Roberto Lopez » Wed Nov 30, 2011 2:50 am

Roberto Lopez wrote: Then... they will join us.
I've forgot to mention a pretty important motivation to join HMG.4.

The world appear to be going to new platforms (specially Android and IOS).

A phone is not the best device to run our current applications, but a tablet computer could be.

As you already know, there is some initiatives about Harbour on Android and IOS (the same for QT).

I'm pretty confident that soon, we will have very good news about this.

Another reason to join HMG.4.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

Rossine
Posts: 87
Joined: Thu Jun 30, 2011 10:04 pm

Post by Rossine » Wed Nov 30, 2011 3:05 am

Hello Roberto and all,

I sometimes try to develop something in hmg.4 but my knowledge of QT is virtually zero and I feel it is a new and great way to go. If I could build my system developed in hmg.3 and do not occur compilation errors in hmg.4 would be wonderful, as compiled clipper made ​​in my system of 800,000 lines to harbour and no errors found in compilation. So I have more time to explore hmg.4 QT to keep changing my commands hmg.3 to work in the hmg.4 and save a lot of time reprogramming.

Thank you all for this fantastic work ;)

Best regards,

Rossine.

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Wed Nov 30, 2011 4:41 am

Very nice idea indeed, Roberto.

I am sure at least ( or even none at all ) changing some lines of our existing code, we can port all our programs of HMG3 to HMG4.

For example, window.activate is ok in HMG3. But we have to put window.activate(), I think. There is no need for much of code change, this can be done with a program editor with a simple find and replace.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

Post Reply