Hi friends.
Here you can read my pov about HMG4 revision. Attached, you will also find an example of a revision of HMG4 (based on the image).
The image shows what I mean about the hierarchy.
- scheme
- g3879.png (7.86 KiB) Viewed 3726 times
The basic classes are: SHARED and BASEOBJ. See below about PARENT.
The differences are not huge. I believe you will be able to grasp the structure.
The only addition that I propose are:
A) the identification of a class that controls start of QT applications (see "app.start"). In this way we can have a big super class. I named HmgWindows.
B) a class to manage relationship (see "PARENT"). Why this? Because hmg-application needs some basic values but not all values from "BASEOBJ" and for other reason.
1)
The big difference is the New method for every object (like concentra job). Here you will find:
- the name of the object. It's mandatory to have one: with parameter or created
- the parent of the object. It's mandatory to have one: with parameter or retrieved with function (see 5 below)
- adding the HMG object to it's parent
- create the QT object (it's not the HMG create)
In this way we can have immediatly the inheritance: <HmgWindows:>form:control:control:....:value for HMG.
About Qt object we can minimize source code and other.
2)
Each object must have the CREATE method (except a few specific cases). This is like a "QT object setup"; all METHOD test ::lCreated value
3)
The other big difference are the source code for every method. Take a look and compare with HMG4.
4) Each object, which has children, should use the "CreatePendingChildControls. Theoretically, you could always use this function.
5)
To manage parent level, I used a simple array. Form, Tab and other modify the contents of this public array (push-in and take-out)
6) Future: I think DATA must be always PROTECTET. For this reason everyone DATA must have its METHOD. Take a look to oQtObject and QTobject METHOD.
QT have a lot of ability and possibility. Many time the difference it's only the "command". I'm speaking - for example - about
icon. Icon is a character var, it contains the reference to an image. But I can use this for window icon or about image in a button or in a label.
With HMG we can minimize use of DATA. Using a var (and its contents) depend on the object under construction:
eg. "::oQtObject:setWindowIcon( ::cIcon )", "::oQTObject:SetIcon( ::cIcon )", etc.
Please take a look to cIcon within window and button (see hmg-include.ch too).
Well, to
compile and run:
1) To compile lib and samples you have two possibility:
- 1.a) copy Harbour distribution package at the same level of svn folder
- 1.b) change path within:
- this row "SET HRBPATH=..\Harbour\bin" within buildlib.bat
- this row "SET HRBPATH=..\..\..\Harbour\bin" within buildapp.bat
- 1.c) run buildlib.bat to create lib; it creates hb_error.log
- 1.d) run build.bat (within samples\subfolder) to create sample; it creates hb_error.log
2) Before run samples, you must copy QTcore4.dll, QTgui4.dll, QTnetwork4.dll. There are two types of sample: HMGx style OOP style.
I am at your disposal for any further information.
Cheers