In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

OnActivate with TMdiFrame Form

Foro público de Xailer en español
Responder
awr
Mensajes: 26
Registrado: Mar Jul 25, 2006 11:16 pm

OnActivate with TMdiFrame Form

Mensaje por awr »

Is the OnActivate supposed to fire everytime the form is restored? It seems
to me that the OnShow should but *not* the OnActivate.
I am trying to automatically show a MdiChild at startup, but I cannot use
the OnInitialize event. When I place the code "TMdiChild():New(
Self ):Show()" in the MdiFrame OnInitialize event, I get the following:
TMDICHILD:SHOW(414)
Error BASE/1004 Class: 'NIL' has no exported method: SENDMSG
Arguments: ( [ 1] = Type: N Val: 546 [ 2] = Type: N Val: 0)
No problem, I think, it must be because the MdiFrame is not yet shown, so I
put it in the OnActivate event. But every time I minimize and restore the
MdiFrame, the OnActivate code is fired and I get another MdiChild created.
Help me out please.
Thanks,
Andy
Ingo
Mensajes: 330
Registrado: Mié Jul 05, 2006 3:58 pm

OnActivate with TMdiFrame Form

Mensaje por Ingo »

Andrew,
I create and show the MdiChild after showing the MdiFrame like this:
Procedure Main()
Application:cTitle := "LEI§A"
Application:oIcon := "Law"
Init()
Application:Run()
Return
//---------------------------------------------------------- --------------------
Procedure Init()
LOCAL oMain
REQUEST HB_LANG_DE
HB_LANGSELECT( "DE" )
REQUEST HB_CODEPAGE_DE
HB_SetCodePage( "DE" )
....
....
WITH OBJECT oMain:=TMain():New( Application ) //creating MdiFrame
....
....
....
:Show()
END
ChildForm():New(oMain):Show() //creating MdiChild
RETURN
Regards
"Andrew W. Ross" <awr@jps.net> schrieb im Newsbeitrag
news:439a91ef$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
> Is the OnActivate supposed to fire everytime the form is restored? It
> seems to me that the OnShow should but *not* the OnActivate.
That's right.
The OnActivate event is produced every time the form is activated.
OnShow event is produced after creating and initializing the form as I think
so.
> I am trying to automatically show a MdiChild at startup, but I cannot use
> the OnInitialize event. When I place the code "TMdiChild():New(
> Self ):Show()" in the MdiFrame OnInitialize event, I get the following:
>
> TMDICHILD:SHOW(414)
> Error BASE/1004 Class: 'NIL' has no exported method: SENDMSG
> Arguments: ( [ 1] = Type: N Val: 546 [ 2] = Type: N Val:
> 0)
>
> No problem, I think, it must be because the MdiFrame is not yet shown, so
> I put it in the OnActivate event. But every time I minimize and restore
> the MdiFrame, the OnActivate code is fired and I get another MdiChild
> created.
I got the same error therefore I create and show the MdiChild after showing
the MdiFrame like this:
Procedure Main()
Application:cTitle := "LEI§A"
Application:oIcon := "Law"
Init()
Application:Run()
Return
//---------------------------------------------------------- --------------------
Procedure Init()
LOCAL oMain
....
WITH OBJECT oMain:=TMain():New( Application ) //creating MdiFrame
....
:Show()
END
TMdiChild():New(oMain):Show() //creating MdiChild
RETURN
Regards
Ingo
> Help me out please.
>
> Thanks,
>
> Andy
>
awr
Mensajes: 26
Registrado: Mar Jul 25, 2006 11:16 pm

OnActivate with TMdiFrame Form

Mensaje por awr »

Thanks Ingo. I see that I can do it that way. My question was is the
OnActivate event on a form "intentionally" set to fire every time the form
is restored. It's almost like a GotFocus event.
From the help file:
Event that is produced every time that the form is activated.
Parameters:
<oSender>:
Self reference
<oForm>:
Previous form that gives the current status to the form or NIL
Return value:
NIL
From the help file description, the word "activated" is ambiguous. If the
current behavior is by design, then it would be more accurate to replace
"activated" with "Receives Focus" or "Restored", or whatever -- something a
little more descriptive.
I just need to know this for the future. I discoverd this behavior by
placing a button on the MdiChild which when clicked, called a standard alert
message box. When the alert box was closed, the MdiFrame OnActivate event
fired.
I have attached a sample.
"Ingo" <ingo.jh@web.de> wrote in message
news:[email=439aa459@ozsrvnegro.ozlan.local...]439aa459@ozsrvnegro.ozlan.local...[/email]
> Andrew,
>
> I create and show the MdiChild after showing the MdiFrame like this:
>
> Procedure Main()
> Application:cTitle := "LEI§A"
> Application:oIcon := "Law"
> Init()
> Application:Run()
>
> Return
>
> //---------------------------------------------------------- --------------------
>
> Procedure Init()
> LOCAL oMain
> REQUEST HB_LANG_DE
> HB_LANGSELECT( "DE" )
> REQUEST HB_CODEPAGE_DE
> HB_SetCodePage( "DE" )
> ....
> ....
>
> WITH OBJECT oMain:=TMain():New( Application ) //creating MdiFrame
> ....
> ....
> ....
> :Show()
> END
> ChildForm():New(oMain):Show() //creating MdiChild
> RETURN
>
> Regards
>
>
>
> "Andrew W. Ross" <awr@jps.net> schrieb im Newsbeitrag
> news:439a91ef$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>> Is the OnActivate supposed to fire everytime the form is restored? It
>> seems to me that the OnShow should but *not* the OnActivate.
>
> That's right.
> The OnActivate event is produced every time the form is activated.
> OnShow event is produced after creating and initializing the form as I
> think
> so.
>
>> I am trying to automatically show a MdiChild at startup, but I cannot use
>> the OnInitialize event. When I place the code "TMdiChild():New(
>> Self ):Show()" in the MdiFrame OnInitialize event, I get the following:
>>
>> TMDICHILD:SHOW(414)
>> Error BASE/1004 Class: 'NIL' has no exported method: SENDMSG
>> Arguments: ( [ 1] = Type: N Val: 546 [ 2] = Type: N Val:
>> 0)
>>
>> No problem, I think, it must be because the MdiFrame is not yet shown, so
>> I put it in the OnActivate event. But every time I minimize and restore
>> the MdiFrame, the OnActivate code is fired and I get another MdiChild
>> created.
>
> I got the same error therefore I create and show the MdiChild after
> showing
> the MdiFrame like this:
>
> Procedure Main()
> Application:cTitle := "LEI§A"
> Application:oIcon := "Law"
> Init()
> Application:Run()
>
> Return
>
> //---------------------------------------------------------- --------------------
>
> Procedure Init()
> LOCAL oMain
> ....
> WITH OBJECT oMain:=TMain():New( Application ) //creating MdiFrame
> ....
> :Show()
> END
> TMdiChild():New(oMain):Show() //creating MdiChild
> RETURN
>
>
> Regards
>
> Ingo
>
>
>> Help me out please.
>>
>> Thanks,
>>
>> Andy
>>
>
>


Attached files MDISample1.zip (2.5 KB)Â
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

OnActivate with TMdiFrame Form

Mensaje por jfgimenez »

Andy,
> Thanks Ingo. I see that I can do it that way. My question was is the
> OnActivate event on a form "intentionally" set to fire every time the form
> is restored. It's almost like a GotFocus event.
Yes, it's fired every time the form gets focus. It's like the OnEnter event
for controls.
> From the help file description, the word "activated" is ambiguous. If the
> current behavior is by design, then it would be more accurate to replace
> "activated" with "Receives Focus" or "Restored", or whatever -- something
> a little more descriptive.
Sorry for the inconvenience. We'll try to modify the help files to explain
it better.
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
awr
Mensajes: 26
Registrado: Mar Jul 25, 2006 11:16 pm

OnActivate with TMdiFrame Form

Mensaje por awr »

Jose,
Thanks for the explanation. After experimenting a bit, I was able to achieve
what I wanted to do with the OnShow event. I am trying to avoid manual
coding as much as possible and let Xailer do the work for me.
BTW, the product is just amazing. I am having great fun experimenting with
some new ideas I have for an existing FiveWin, 16-bit application that I
need to redesign in 32-bit. So far, I think Xailer and Xharbour look like a
winner. You guys have done some awesome work.
Andy
"Jose F. Gimenez" <jfgimenez@wanadoo.es> wrote in message
news:439c04d4$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
> Andy,
>
>> Thanks Ingo. I see that I can do it that way. My question was is the
>> OnActivate event on a form "intentionally" set to fire every time the
>> form is restored. It's almost like a GotFocus event.
>
> Yes, it's fired every time the form gets focus. It's like the OnEnter
> event for controls.
>
>
>> From the help file description, the word "activated" is ambiguous. If the
>> current behavior is by design, then it would be more accurate to replace
>> "activated" with "Receives Focus" or "Restored", or whatever -- something
>> a little more descriptive.
>
> Sorry for the inconvenience. We'll try to modify the help files to explain
> it better.
>
> --
> Regards,
>
> Jose F. Gimenez
>
Ingo
Mensajes: 330
Registrado: Mié Jul 05, 2006 3:58 pm

OnActivate with TMdiFrame Form

Mensaje por Ingo »

Andy,
I agree with you. Xailer is really amazing. I just redesigned my first FW16
app. It's a great pleasure to work with the IDE.
Regards
Ingo
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

OnActivate with TMdiFrame Form

Mensaje por jfgimenez »

Andy,
> BTW, the product is just amazing. I am having great fun experimenting with
> some new ideas I have for an existing FiveWin, 16-bit application that I
> need to redesign in 32-bit. So far, I think Xailer and Xharbour look like
> a winner. You guys have done some awesome work.
Thanks for the kind words ;-)
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

OnActivate with TMdiFrame Form

Mensaje por jfgimenez »

Ingo,
> I agree with you. Xailer is really amazing. I just redesigned my first
> FW16 app. It's a great pleasure to work with the IDE.
Thanks to you also ;-)
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder