summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-05-09 14:51:38 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-05-09 14:51:38 +0000
commitfddc582d78e1f4063c8ec670b1fd66396c6a3df7 (patch)
tree38922b062ec21eb3bb03ef19b21edb7b41c90adc /src
parent68b28beb2a5eba7e1d249e1a857012d79452e37c (diff)
downloadfpGUI-fddc582d78e1f4063c8ec670b1fd66396c6a3df7.tar.xz
* Minor change so ShowModal forms also execute the OnClose event.
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui_form.pas8
1 files changed, 8 insertions, 0 deletions
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);