Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 3 of 3 total |
Delete modal form |
Wed, Jun 19 2013 4:08 AM | Permanent Link |
Christian Kaufmann | Hi,
in Delphi I used a common pattern for dialogs: class procedure TMyForm.Execute; var f : TForm; begin f := TMyForm.Create(Application); try f.ShowModal finally f.Release; end; end; Since everything is async in EWB, I cannot do that. So my question is, where do I delete the temporary modal forms? I tried this: procedure TMyForm.FMyFormDlgClose(Sender: TObject); begin TForm(Sender).Free; end; it seems to work, but is this really a good way to do it? cu Christian |
Thu, Jun 20 2013 4:10 AM | Permanent Link |
Matthew Jones | I don't know the answer to your question, but I have just been using the default
create all forms at start and leave them around with just hide(close)/show operating. It might be more sensible to free them. One thing I do is use the "MyForm.OnFormClose := ParentCloseRoutine" action so that I know the form was closed, but I don't know where in the lifetime of the object that comes. In Delphi there is a "release" or something that ensures it is free'd when all the calls have completed. Something like that would be good, but you need to know the "global" pointer to the form is nil too. /Matthew Jones/ |
Thu, Jun 20 2013 2:52 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Christian,
<< I tried this: procedure TMyForm.FMyFormDlgClose(Sender: TObject); begin TForm(Sender).Free; end; it seems to work, but is this really a good way to do it? >> Yep, that's what the framework does for message dialogs: procedure TDesktop.DoMsgDlgClose(Sender: TObject); begin try TMsgDlgForm(Sender).DoResult(TMsgDlgForm(Sender).ModalResult); finally TMsgDlgForm(Sender).Free; end; end; Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Friday, November 1, 2024 at 07:01 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |