mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 14:29:29 +02:00
Dialogs: don't call TOpenDialog.OnCanClose if ofOldStyleDialog in Options (Delphi compatibility). Part of Issue #0021147.
git-svn-id: trunk@52788 -
This commit is contained in:
parent
6e5cf2da5a
commit
8a444a31ef
@ -199,6 +199,7 @@ type
|
||||
function DefaultTitle: string; override;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
procedure DoCanClose(var CanClose: Boolean); override;
|
||||
procedure DoFolderChange; virtual;
|
||||
procedure DoSelectionChange; virtual;
|
||||
procedure IntfSetOption(const AOption: TOpenOption; const AValue: Boolean);
|
||||
|
@ -37,7 +37,7 @@ end;
|
||||
|
||||
procedure TFileDialog.DoCanClose(var CanClose: Boolean);
|
||||
begin
|
||||
debugln(['TFileDialog.DoCanClose: FUserChoice = ',ModalResultStr[FUserChoice],' HandleAllocated=',HandleAllocated]);
|
||||
//debugln(['TFileDialog.DoCanClose: FUserChoice = ',ModalResultStr[FUserChoice],' HandleAllocated=',HandleAllocated]);
|
||||
//Only call OnCanClose if user did not cancel the dialog, see:
|
||||
//http://docwiki.embarcadero.com/Libraries/Berlin/en/Vcl.Dialogs.TOpenDialog_Events
|
||||
if (FUserChoice = mrOK) then
|
||||
@ -432,6 +432,18 @@ begin
|
||||
FOptions := DefaultOpenDialogOptions;
|
||||
end;
|
||||
|
||||
procedure TOpenDialog.DoCanClose(var CanClose: Boolean);
|
||||
begin
|
||||
//Delphi never calls OnCanClose in this case
|
||||
if not (ofOldStyleDialog in Options) then
|
||||
inherited DoCanClose(CanClose)
|
||||
else
|
||||
begin
|
||||
FCanCloseCalled := True;
|
||||
CanClose := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TOpenDialog.DoFolderChange;
|
||||
begin
|
||||
if Assigned(OnFolderChange) then OnFolderChange(Self);
|
||||
|
Loading…
Reference in New Issue
Block a user