Hello everyone, I would like to have your opinion on whether to add two events to the form.
The names could be: "OnBeforeShow" and "OnAfterShow".
These two events would be triggered immediately before and after the statement "oQTObject: Show ()" in window.prg.
The reasons for this request is: often, it is useful to fill in the fields after a processing or perform a procedure, etc.
Since the form is not yet completely loaded I get errors
Another example that comes to me is this: in the OnInit function of the main form, I have to open another form. Based on the result of this operation I have to figure out whether to continue or not. With Hmg4 I have problems, but using the assumed event OnAfterShow everything works fine.
What do you think about this idea?
Best regards.
HMG4 event idea
Moderator: Rathinagiri
HMG4 event idea
Luigi from Italy
www.L3W.it
www.L3W.it
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG4 event idea
Hi Luigi,
Kindly create the code along with some samples to demonstrate the same. Definitely your suggestion will be useful to all.
Thanks.
Kindly create the code along with some samples to demonstrate the same. Definitely your suggestion will be useful to all.
Thanks.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: HMG4 event idea
Hi Luigil3whmg wrote: ...
What do you think about this idea?
...
Good idea
Please continue
Regards
--
Esgici
Viva INTERNATIONAL HMG
Re: HMG4 event idea
Hi guys,
Today it's not a good day..... I've written code but without good news
In fact, HMG4 have different core from HMG3: when you change a value inside OnInit event and other field depend by OnChange clause of this, with HMG3 you can receive error. with HMG4 no
I was hoping to find a way to see or do something immediately after the appearance of the form on the video, but without result. In according with documentation provided by QT, I created an event OnAfterShow, but I get the same result with the OnInit event. bAfterEvent first runs and then you see the form. In fact, putting a trivial MsgStop, I see the message first and then I see the form.
Anyway, this is a piece of code for windows.prg
And this was translation command to use with DEFINE WINDOW
If someone have a better idea....
Best regards
Today it's not a good day..... I've written code but without good news
In fact, HMG4 have different core from HMG3: when you change a value inside OnInit event and other field depend by OnChange clause of this, with HMG3 you can receive error. with HMG4 no
I was hoping to find a way to see or do something immediately after the appearance of the form on the video, but without result. In according with documentation provided by QT, I created an event OnAfterShow, but I get the same result with the OnInit event. bAfterEvent first runs and then you see the form. In fact, putting a trivial MsgStop, I see the message first and then I see the form.
Anyway, this is a piece of code for windows.prg
Code: Select all
/*----------------------------------------------------------------------*/ //L3W
METHOD OnAfterShow( bValue ) CLASS WINDOW //L3W
//L3W
IF ::lCreated //L3W
IF PCOUNT() == 0 //L3W
RETURN ::bOnAfterShow //L3W
ELSEIF PCOUNT() == 1 //L3W
::bOnAfterShow := bValue //L3W
IF .NOT. ::oQTObject:connect( QEvent_Show , {||EVAL( bValue ) } ) //L3W
::oQTObject:disconnect( QEvent_Show ) //L3W
IF .NOT. ::oQTObject:connect( QEvent_Show , {||EVAL( bValue ) } ) //L3W
// Error //L3W
ENDIF //L3W
ENDIF //L3W
ENDIF //L3W
ELSE //L3W
IF PCOUNT() == 0 //L3W
RETURN ::bOnAfterShow //L3W
ELSEIF pcount() == 1 //L3W
::bOnAfterShow := bValue //L3W
ENDIF //L3W
ENDIF //L3W
//L3W
RETURN NIL //L3W
Code: Select all
#xcommand ONAFTERSHOW <bvalue> => :OnAfterShow := <{bvalue}>
Best regards
Luigi from Italy
www.L3W.it
www.L3W.it