<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 18/04/12 17:27, zeljko wrote:
<blockquote cite="mid:201204181627.02841.zeljko@holobit.net"
type="cite">
<meta name="qrichtext" content="1">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">On Wednesday 18 of April
2012 15:22:27 Martin wrote:</p>
<p style="margin: 0px; text-indent: 0px;">> On 18/04/2012
11:53, Hans-Peter Diettrich wrote:</p>
<p style="margin: 0px; text-indent: 0px;">> > patspiper
schrieb:</p>
<p style="margin: 0px; text-indent: 0px;">> >>> No,
FormClose() isn't called when modal form is hidden via Hide();</p>
<p style="margin: 0px; text-indent: 0px;">> >> </p>
<p style="margin: 0px; text-indent: 0px;">> >> Correct</p>
<p style="margin: 0px; text-indent: 0px;">> >> </p>
<p style="margin: 0px; text-indent: 0px;">> >>> , so
form still exists and it can be called with ShowModal() or</p>
<p style="margin: 0px; text-indent: 0px;">> >>> Show()
again.</p>
<p style="margin: 0px; text-indent: 0px;">> >> </p>
<p style="margin: 0px; text-indent: 0px;">> >> I beg to
differ here as Showmodal should not exit unless the modal</p>
<p style="margin: 0px; text-indent: 0px;">> >> form is
closed.</p>
<p style="margin: 0px; text-indent: 0px;">> > </p>
<p style="margin: 0px; text-indent: 0px;">> > A modal form
(dialog) can be used to accept multiple user entries</p>
<p style="margin: 0px; text-indent: 0px;">> > (filename...).
Then the form object must stay alife until the</p>
<p style="margin: 0px; text-indent: 0px;">> > application
has read all entries. That's why a modal form only hides</p>
<p style="margin: 0px; text-indent: 0px;">> > itself on
exit.</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> closed <>
destroy</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> Close() depends on
close action, which include free and hide.</p>
<p style="margin: 0px; text-indent: 0px;">> Close() on a modal
Form in LCL ignores close action and always hides (by</p>
<p style="margin: 0px; text-indent: 0px;">> setting ModalResult
= mrCancel.</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> Hide() or
Visible:=False does not set ModalResult</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> In fact if in
Delphi you hide a modalform, then ShowModal does not</p>
<p style="margin: 0px; text-indent: 0px;">> return. I don't
know, if this is intended or accidental behaviour.</p>
<p style="margin: 0px; text-indent: 0px;">> While of course you
can use this, there is a real danger of such a modal</p>
<p style="margin: 0px; text-indent: 0px;">> form become hidden,
with no means of ever getting it back or exiting it.</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> Using a hidden
modal form, to block all other forms (even if intended)</p>
<p style="margin: 0px; text-indent: 0px;">> appears to me an
abuse of the modal concept. If an application wants to</p>
<p style="margin: 0px; text-indent: 0px;">> do this, it should
do this explicitly. (But that is my personal opinion)</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> In LCL there is</p>
<p style="margin: 0px; text-indent: 0px;">>
Screen.DisableForms()</p>
<p style="margin: 0px; text-indent: 0px;"><br>
</p>
<p style="margin: 0px; text-indent: 0px;">+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).</p>
</blockquote>
Patch is good but has one bug (Pls check bug report)<br>
<br>
Stephano<br>
</body>
</html>