Hi Mauricio.
About main window I'm in agreement with you.
Little brief: we use QMainWindow because has a lot of "future"; instead can be used QDialog, but I don't know property. I think: for this reason, when HMG4 was started, Roberto (it's my opinion) choose this type of window.
So we don't mix QMainWindow (type of QT) with WND_MAIN (type of HMG4). We can have a lot of QmainWindow but only one WND_MAIN; the other HMG4 window must be: WND_STANDARD, WND_CHILD, WND_PANEL, WND_SPLITCHILD or WND_MODAL
About opened window or what is the sequence....
Please take this example: I need a Login form before to access the application (main window). If I can open a form (WND_MODAL, but...) only when a WND_MAIN it's still opened, we have a problem. Why?
Because I have try to use this code:
WITH OBJECT MainForm....
:OnInit := ExecuteLogin
.....
within ExecuteLogin I show a Modal form and my code is like this "IF LoginFailed MainForm:Release()".
But this instruction is inside the "MainForm OnInit" and this wan't work today: so, I can't shutdown the project.
Solution? I need to open a modal BEFORE the MainForm.
I don't know very well QT, but on internet I find same problems. On the other hand there is this Qt command: QApplicatioN:CloseAllWindows(), but like Qt docs say (if I understand): there is'nt a predefined sequence, windows are close random. I think mainwindow is the last one
IMHO, we must have these rules:
1) we can have only one WND_MAIN
2) we can open WND_MODAL without have WND_MAIN opened
3) we must have a WND_MAIN open and active to open other "child"
4) future: we can handle a sequencer: from 1 to N are open, from N to 1 can be closed...
About coding: ok for everyone? Yes, so good for me. I think the same. A simple workaround can be a simple error handling like this:
Code: Select all
IF PCOUNT() == 0
RETURN ...
ELSEIFVALTYPE( aValue ) == "A"
....
ELSE
hMgerror( cError )
ENDIF
.....
and
Code: Select all
FUNCTION HmgError( cError )
MsgStop( cError )
HMGAPP():QUIT()
QUIT
RETURN NIL
In this way, at this moment, we can have a simple handler and in the future find every HmgError and rewrite, in a proper way, the error handling. But it's a simple opinion.
Cheers