[Lazarus] Bug 15390 and Showmodal

patspiper patspiper at gmail.com
Wed Apr 18 20:05:35 CEST 2012


On 18/04/12 20:09, Martin wrote:
> On 18/04/2012 17:53, patspiper wrote:
>> On 18/04/12 17:39, Martin wrote:
>>>
>>>
>>> But this is not a bug.
>>> And Delphi docs, IMHO are not making a 100% clear statement about this.
>> It is a bug considering that both Delphi and Lazarus docs are clear 
>> about it: ShowModal does not return until the form is closed.
>
> That's not the point
>
> The point is: Close <> Destroy
> In fact, with modal active close does hide the form (and sets modal 
> result)
Closing a modal form hides it indeed, sets ModalResult, and makes 
ShowModal exit. Hiding is just one step of modal form closing.
>
> In anyway it does not say "until the method close is called".
> It says "form is closed" never mind how it is closed
Correct
>
>    "closing a form" is not the same as "calling close()"
>
> "calling close()" is only one of many ways to "close a form".
> e.g during Modal, you can set ModalResult.
OK
>
> Depending on close the property CloseAction = caHide, a call to 
> Close(), does in the end actually call Hide (or set Visible=False). 
> The call to Close can (optional) destroy the form. But the actual 
> closing is done by making it invisible.
>
> So who says, that calling Hide() is not a way of closing the form?
Try applying the same logic with CloseAction = caNone ;)

Furthermore, Hide() does not trigger the OnCloseQuery and OnClose events.
> It does the same thing. (the 2 calls have different additional side 
> effects, but that is a different story)
<joking mode on> Pulling off the computer's power plug is yet another 
way of closing a form with different side effects<joking mode off>

Finally, the force (Delphi) is not on your side :D

Stephano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120418/9a07d011/attachment-0003.html>


More information about the Lazarus mailing list