Hello!
I've run into some problem.
My OSX program has quit confirmation.
When I display a modal window, main menu gets disabled.
But if press Command-Q, it still triggers program close routine and displays quit confirmation.
Problem that it doesn't react to any input, so my program get locked.
Here's the test I made:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, LclType;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
Begin
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Dlg : TForm;
begin
Dlg := TForm.CreateNew(Self);
Dlg.ShowModal;
end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin
CanClose:=Application.MessageBox('Are you sure you want to quit?', 'Question', MB_YesNo) = IdYes;
end;
end.
What would you recommend to fix this?