mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 07:42:59 +02:00
lcl: set TFileNameEdit.FilterIndex before OnAcceptFileName execution + formatting (issue #0017306)
git-svn-id: trunk@29916 -
This commit is contained in:
parent
7fe0a34e7b
commit
df3550bba9
@ -165,7 +165,7 @@ type
|
|||||||
FDefaultExt: String;
|
FDefaultExt: String;
|
||||||
FHideDirectories: Boolean;
|
FHideDirectories: Boolean;
|
||||||
FInitialDir: String;
|
FInitialDir: String;
|
||||||
FOnAcceptFN: TAcceptFileNameEvent;
|
FOnAcceptFileName: TAcceptFileNameEvent;
|
||||||
FOnFolderChange: TNotifyEvent;
|
FOnFolderChange: TNotifyEvent;
|
||||||
FFileNameChangeLock: Integer;
|
FFileNameChangeLock: Integer;
|
||||||
procedure SetFileName(const AValue: String);
|
procedure SetFileName(const AValue: String);
|
||||||
@ -186,7 +186,7 @@ type
|
|||||||
// TFileName properties.
|
// TFileName properties.
|
||||||
property FileName: String read FFileName write SetFileName;
|
property FileName: String read FFileName write SetFileName;
|
||||||
property InitialDir: String read FInitialDir write FInitialDir;
|
property InitialDir: String read FInitialDir write FInitialDir;
|
||||||
property OnAcceptFileName: TAcceptFileNameEvent read FOnAcceptFN write FonAcceptFN;
|
property OnAcceptFileName: TAcceptFileNameEvent read FOnAcceptFileName write FOnAcceptFileName;
|
||||||
property OnFolderChange: TNotifyEvent read FOnFolderChange write FOnFolderChange;
|
property OnFolderChange: TNotifyEvent read FOnFolderChange write FOnFolderChange;
|
||||||
property DialogKind: TDialogKind read FDialogKind write FDialogKind default dkOpen;
|
property DialogKind: TDialogKind read FDialogKind write FDialogKind default dkOpen;
|
||||||
property DialogTitle: String read FDialogTitle write FDialogTitle;
|
property DialogTitle: String read FDialogTitle write FDialogTitle;
|
||||||
@ -747,7 +747,7 @@ var
|
|||||||
O: TOpenDialog;
|
O: TOpenDialog;
|
||||||
S: TSaveDialog;
|
S: TSaveDialog;
|
||||||
begin
|
begin
|
||||||
Case AKind of
|
case AKind of
|
||||||
dkopen, dkPictureOpen:
|
dkopen, dkPictureOpen:
|
||||||
begin
|
begin
|
||||||
O := TOpenDialog.Create(Self);
|
O := TOpenDialog.Create(Self);
|
||||||
@ -778,11 +778,12 @@ begin
|
|||||||
case AKind of
|
case AKind of
|
||||||
dkOpen, dkPictureOpen :
|
dkOpen, dkPictureOpen :
|
||||||
begin
|
begin
|
||||||
|
FilterIndex := TOpenDialog(D).FilterIndex;
|
||||||
FN := TOpenDialog(D).FileName;
|
FN := TOpenDialog(D).FileName;
|
||||||
if (FN <> '') then
|
if (FN <> '') then
|
||||||
begin
|
begin
|
||||||
if Assigned(FOnAcceptFN) then
|
if Assigned(OnAcceptFileName) then
|
||||||
FOnAcceptFN(Self,Fn);
|
OnAcceptFileName(Self, FN);
|
||||||
end;
|
end;
|
||||||
if (FN <> '') then
|
if (FN <> '') then
|
||||||
begin
|
begin
|
||||||
@ -794,6 +795,7 @@ begin
|
|||||||
dkSave, dkPictureSave :
|
dkSave, dkPictureSave :
|
||||||
begin
|
begin
|
||||||
FileName := TSaveDialog(D).FileName;
|
FileName := TSaveDialog(D).FileName;
|
||||||
|
FilterIndex := TSaveDialog(D).FilterIndex;
|
||||||
FDialogFiles.Clear;
|
FDialogFiles.Clear;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user