From fddc582d78e1f4063c8ec670b1fd66396c6a3df7 Mon Sep 17 00:00:00 2001 From: graemeg Date: Fri, 9 May 2008 14:51:38 +0000 Subject: * Minor change so ShowModal forms also execute the OnClose event. --- src/gui/gui_form.pas | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/gui/gui_form.pas b/src/gui/gui_form.pas index 4ac0ac63..69e1470a 100644 --- a/src/gui/gui_form.pas +++ b/src/gui/gui_form.pas @@ -236,6 +236,8 @@ begin end; function TfpgForm.ShowModal: integer; +var + CloseAction: TCloseAction; begin FWindowType := wtModalForm; fpgApplication.PushModalForm(self); @@ -256,6 +258,12 @@ begin fpgApplication.PopModalForm; Result := ModalResult; + + if ModalResult <> 0 then + begin + CloseAction := caFree; // Dummy variable - we do nothing with it + DoOnClose(CloseAction); // Simply so the OnClose event fires. + end; end; procedure TfpgForm.MsgClose(var msg: TfpgMessageRec); -- cgit v1.2.3-70-g09d2