mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 16:59:20 +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;
|
function DefaultTitle: string; override;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
|
procedure DoCanClose(var CanClose: Boolean); override;
|
||||||
procedure DoFolderChange; virtual;
|
procedure DoFolderChange; virtual;
|
||||||
procedure DoSelectionChange; virtual;
|
procedure DoSelectionChange; virtual;
|
||||||
procedure IntfSetOption(const AOption: TOpenOption; const AValue: Boolean);
|
procedure IntfSetOption(const AOption: TOpenOption; const AValue: Boolean);
|
||||||
|
@ -37,7 +37,7 @@ end;
|
|||||||
|
|
||||||
procedure TFileDialog.DoCanClose(var CanClose: Boolean);
|
procedure TFileDialog.DoCanClose(var CanClose: Boolean);
|
||||||
begin
|
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:
|
//Only call OnCanClose if user did not cancel the dialog, see:
|
||||||
//http://docwiki.embarcadero.com/Libraries/Berlin/en/Vcl.Dialogs.TOpenDialog_Events
|
//http://docwiki.embarcadero.com/Libraries/Berlin/en/Vcl.Dialogs.TOpenDialog_Events
|
||||||
if (FUserChoice = mrOK) then
|
if (FUserChoice = mrOK) then
|
||||||
@ -432,6 +432,18 @@ begin
|
|||||||
FOptions := DefaultOpenDialogOptions;
|
FOptions := DefaultOpenDialogOptions;
|
||||||
end;
|
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;
|
procedure TOpenDialog.DoFolderChange;
|
||||||
begin
|
begin
|
||||||
if Assigned(OnFolderChange) then OnFolderChange(Self);
|
if Assigned(OnFolderChange) then OnFolderChange(Self);
|
||||||
|
Loading…
Reference in New Issue
Block a user