Bart schrieb:
On 4/21/12, Hans-Peter Diettrich <[email protected]> wrote:
I'd suggest that an explicitly set ModalResult should be checked, before
actions are invoked that are incompatible with modal forms. But Delphi
also checks Kind *before* ModalResult, so this is a compatibility issue.
If you have a recent Delphi version can you test what the ModalResult
is when you close a Modal form by clicking on a TBitButton with Kind =
bkClose and Modalresult = mrClose (just put a TBitBtn on this form and
in OI set Kind = bkClose) ?
It will be the default result, when the ModalResult property is never
changed in code. I.e. the same as when the dialog is closed using ALT-F4
or the border icons. I assume that ModalResult is initialized during
ShowModal, else the result from the *previous* ShowModal would be returned.
From Delphi help:
mrNone 0 None. Used as a default value before the user exits.
(My Delphi (3) does have bkClose as a valid choice for TBitBtnKind,
but it does not have mrClose as a valid choice for TModalResult, so it
obviously will not return mrClose.)
From D7 help:
>>
TModalResult represents the value returned by a modal dialog. An
application can use any integer value as a modal result value.
<<
I.e. one can define mrClose and assign it to the close button's
ModalResult. But this won't help, when the button logic doesn't use the
ModalResult when Kind=bkClose.
DoDi
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus