mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 04:39:36 +02:00
TFilenameEdit: adjust InitialDir after user executes the dialog. This is analogue to how TOpenDialog behaves.
This commit is contained in:
parent
7446930ef3
commit
4c4c9631aa
@ -1506,10 +1506,15 @@ end;
|
|||||||
procedure TFileNameEdit.RunDialog;
|
procedure TFileNameEdit.RunDialog;
|
||||||
var
|
var
|
||||||
D: TCommonDialog;
|
D: TCommonDialog;
|
||||||
|
Res: Boolean;
|
||||||
begin
|
begin
|
||||||
D := CreateDialog(DialogKind);
|
D := CreateDialog(DialogKind);
|
||||||
try
|
try
|
||||||
if D.Execute then
|
Res := D.Execute;
|
||||||
|
//this is analogue to how TOpenDialog behaves, InitialDir is retrieved from the dialog, even if user cancels the dialog.
|
||||||
|
if (D is TOpenDialog) then
|
||||||
|
InitialDir := TOpenDialog(D).InitialDir;
|
||||||
|
if Res then
|
||||||
SaveDialogResult(DialogKind, D);
|
SaveDialogResult(DialogKind, D);
|
||||||
finally
|
finally
|
||||||
D.Free;
|
D.Free;
|
||||||
|
Loading…
Reference in New Issue
Block a user