I've done some more work on ABM2 and I think I've found some points I want to discuss with you.
It seems to me that all HMG windows are implemented with QMainWindow Qt object. I ask you to open at assistant and search for QMainWindow class and scroll down to the nice graph.
QMainWindow has several areas it may divided into. They are not mandatory, you can have or not have them, but if you use them your work is made more easy.
In Qt, for example, toolbars are moveable, you can put them at top, bottom, left and right. If you have a tool bar but don't include the objects in the form in a QWidget and assign it to the central widget position, it happens that the moving toolbar can overwrite the form objects. There may also be problems for input focus... and you need to add the toolbar height to objects row to not overwrite the toolbar at the top, but when moving it to another position that empty space is not nice to see. I experimented all these during ABM2 conversion...
The solution is to add the hmg objects of the form to a QWidget and then set that QWidget as the central widget of QMainWindow. IN this case QT will take care of all movements.
QWidget acts as a container of a group of objects, and this is already used in hmg TAB, to hold all the objects of a tab page.
How can we add a hmg object to a QWidget ?
As first step we need a QWidget object, so I created a hmg Widget class, whose only method is Create() and this is turn creates a QWidget.
Then I tried to use :parent to specify the container but it didn't work because in conflict with TAB.
As first step we need a QWidget object, so I created a hmg Widget class, whose only method is Create() and this is turn creates a QWidget.
Browsing the code I saw that all Create() class use this kind of code:
Code: Select all
IF valtype( ::oContainer ) == 'U'
::oQTObject := QLabel( ::oParent:oQTObject )
ELSE
::oQTObject := QLabel( ::oContainer:oQTObject )
ENDIF
and decided to set oContainer in my code to specify the container, and it worked.
As you know, Qt objects are created only at window:Activate() and so at the moment we must do all the dirty job in the on init function. In this function we assign the toolbar and the widget at the window and Qt will take care of everything.
Why did I explain all this ? Various reasons
1) do you want me to commit these changes ? at the moment they don't touch any core code, there is just one class and everything must be done in "user-code"
2) I'd like to have some more Qt features integrated in hmg and this can be done only after a discussion on what and how to implement the features, they may have side-effects
3) from my tests, using :parent interferes with TAB, it would be nice to better defines this, or better make :parent generic
4) what about adding layouts to hmg ? Docks ?
Would you like to create different threads for these topics ? Read the message in this more explicit way: are you willing to discuss and - perhaps - change some inner code of hmg ?