[Lazarus] Bug 15390 and Showmodal

zeljko zeljko at holobit.net
Wed Apr 18 16:27:02 CEST 2012


On Wednesday 18 of April 2012 15:22:27 Martin wrote:
> On 18/04/2012 11:53, Hans-Peter Diettrich wrote:
> > patspiper schrieb:
> >>> No, FormClose() isn't called when modal form is hidden via Hide();
> >> 
> >> Correct
> >> 
> >>> , so form still exists and it can be called with ShowModal() or
> >>> Show() again.
> >> 
> >> I beg to differ here as Showmodal should not exit unless the modal
> >> form is closed.
> > 
> > A modal form (dialog) can be used to accept multiple user entries
> > (filename...). Then the form object must stay alife until the
> > application has read all entries. That's why a modal form only hides
> > itself on exit.
> 
> closed <> destroy
> 
> Close() depends on close action, which include free and hide.
> Close() on a modal Form in LCL ignores close action and always hides (by
> setting ModalResult = mrCancel.
> 
> Hide() or Visible:=False does not set ModalResult
> 
> In fact if in Delphi you hide a modalform, then ShowModal does not
> return. I don't know, if this is intended or accidental behaviour.
> While of course you can use this, there is a real danger of such a modal
> form become hidden, with no means of ever getting it back or exiting it.
> 
> Using a hidden modal form, to block all other forms (even if intended)
> appears to me an abuse of the modal concept. If an application wants to
> do this, it should do this explicitly. (But that is my personal opinion)
> 
> In LCL there is
>    Screen.DisableForms()

+1 , that's why I implemented hiding of modal form as it is - it simply works 
on all platforms, and Delphi behaviour looks pretty unlogical to me (but even 
that can work - see my today patches attached at issue).

zeljko

> 
> 
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120418/0823421e/attachment-0003.html>


More information about the Lazarus mailing list