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.

Return values from windows

Xailer professional forum in English
Responder
Mahanimann
Mensajes: 216
Registrado: Dom Sep 23, 2007 11:08 pm

Return values from windows

Mensaje por Mahanimann »

Hi,
I need to receive values from windows. F.ex. the user chooses a record in a
browse pop-up window, the pop-up window closes, and the calling window
receives the value chosen (can be of any datatype).
With my very limited knowledge about Xailer/xHarbour I have solved this
(i.e. to get a return value from a window) with this:
CLASS TForm FROM XForm
DATA xReturnVal_From_PopUp_Window
END CLASS
The parent (oParent) in all pop-up windows are set to the calling window.
When the pop-up window closes, it puts the return value into
::oParent:xReturnVal_From_PopUp_Window.
This works fine, but there must be a neater way to do this? (Tweaking with
:nModalResult gave me only trouble :-) )
Thanks for any reply,
Paal
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9469
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Return values from windows

Mensaje por ignacio »

Paal,
Use the the property TForm:lHideOnClose. See the docs for further
information.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Mahanimann" <paaldalen@gmail.com> escribió en el mensaje
news:47138bc9$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Hi,
>
> I need to receive values from windows. F.ex. the user chooses a record in
> a browse pop-up window, the pop-up window closes, and the calling window
> receives the value chosen (can be of any datatype).
>
> With my very limited knowledge about Xailer/xHarbour I have solved this
> (i.e. to get a return value from a window) with this:
>
> CLASS TForm FROM XForm
> DATA xReturnVal_From_PopUp_Window
> END CLASS
>
> The parent (oParent) in all pop-up windows are set to the calling window.
> When the pop-up window closes, it puts the return value into
> ::oParent:xReturnVal_From_PopUp_Window.
>
> This works fine, but there must be a neater way to do this? (Tweaking with
> :nModalResult gave me only trouble :-) )
>
> Thanks for any reply,
> Paal
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

Return values from windows

Mensaje por NoName »

Paal,
Use the the property TForm:lHideOnClose. See the docs for further
information.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Mahanimann" <paaldalen@gmail.com> escribió en el mensaje
news:47138bc9$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Hi,
>
> I need to receive values from windows. F.ex. the user chooses a record in
> a browse pop-up window, the pop-up window closes, and the calling window
> receives the value chosen (can be of any datatype).
>
> With my very limited knowledge about Xailer/xHarbour I have solved this
> (i.e. to get a return value from a window) with this:
>
> CLASS TForm FROM XForm
> DATA xReturnVal_From_PopUp_Window
> END CLASS
>
> The parent (oParent) in all pop-up windows are set to the calling window.
> When the pop-up window closes, it puts the return value into
> ::oParent:xReturnVal_From_PopUp_Window.
>
> This works fine, but there must be a neater way to do this? (Tweaking with
> :nModalResult gave me only trouble :-) )
>
> Thanks for any reply,
> Paal
>
Mahanimann
Mensajes: 216
Registrado: Dom Sep 23, 2007 11:08 pm

Return values from windows

Mensaje por Mahanimann »

> Use the the property TForm:lHideOnClose. See the docs for further
> information.
Is TForm:Close() with TForm:lHideOnClose == .F. exactly the same as
TForm:End()?
Thanks,
Paal
Mahanimann
Mensajes: 216
Registrado: Dom Sep 23, 2007 11:08 pm

Return values from windows

Mensaje por Mahanimann »

> Use the the property TForm:lHideOnClose. See the docs for further
> information.
Is TForm:Close() with TForm:lHideOnClose == .F. exactly the same as
TForm:End()?
Thanks,
Paal
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Return values from windows

Mensaje por jfgimenez »

Paal,
>> Use the the property TForm:lHideOnClose. See the docs for further
>> information.
>
> Is TForm:Close() with TForm:lHideOnClose == .F. exactly the same as
> TForm:End()?
Almost the same, but not exactly equal. TForm:Close() send the message
WM_CLOSE to the form, and the form closes and destroys itself, while
TForm:End() simply destroys the form.
IOW, it's desirable to call always :Close(), excepting if you are setting
:lHideOnClose to .T. and you have to destroy the form after it has been
closed.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
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:

Return values from windows

Mensaje por jfgimenez »

Paal,
>> Use the the property TForm:lHideOnClose. See the docs for further
>> information.
>
> Is TForm:Close() with TForm:lHideOnClose == .F. exactly the same as
> TForm:End()?
Almost the same, but not exactly equal. TForm:Close() send the message
WM_CLOSE to the form, and the form closes and destroys itself, while
TForm:End() simply destroys the form.
IOW, it's desirable to call always :Close(), excepting if you are setting
:lHideOnClose to .T. and you have to destroy the form after it has been
closed.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Mahanimann
Mensajes: 216
Registrado: Dom Sep 23, 2007 11:08 pm

Return values from windows

Mensaje por Mahanimann »

> IOW, it's desirable to call always :Close(), excepting if you are setting
> :lHideOnClose to .T. and you have to destroy the form after it has been
> closed.
Ok. I call :End(), maybe this is why my app is chewing up memory. Child
windows do not release much memory when :End()'ed. I will check it out
tomorrow.
Thanks,
Paal
Mahanimann
Mensajes: 216
Registrado: Dom Sep 23, 2007 11:08 pm

Return values from windows

Mensaje por Mahanimann »

> IOW, it's desirable to call always :Close(), excepting if you are setting
> :lHideOnClose to .T. and you have to destroy the form after it has been
> closed.
Ok. I call :End(), maybe this is why my app is chewing up memory. Child
windows do not release much memory when :End()'ed. I will check it out
tomorrow.
Thanks,
Paal
Responder