lcl: set TFileNameEdit.FilterIndex before OnAcceptFileName execution + formatting (issue #0017306)

git-svn-id: trunk@29916 -
This commit is contained in:
paul 2011-03-19 17:13:39 +00:00
parent 7fe0a34e7b
commit df3550bba9

View File

@ -165,7 +165,7 @@ type
FDefaultExt: String;
FHideDirectories: Boolean;
FInitialDir: String;
FOnAcceptFN: TAcceptFileNameEvent;
FOnAcceptFileName: TAcceptFileNameEvent;
FOnFolderChange: TNotifyEvent;
FFileNameChangeLock: Integer;
procedure SetFileName(const AValue: String);
@ -186,7 +186,7 @@ type
// TFileName properties.
property FileName: String read FFileName write SetFileName;
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 DialogKind: TDialogKind read FDialogKind write FDialogKind default dkOpen;
property DialogTitle: String read FDialogTitle write FDialogTitle;
@ -747,7 +747,7 @@ var
O: TOpenDialog;
S: TSaveDialog;
begin
Case AKind of
case AKind of
dkopen, dkPictureOpen:
begin
O := TOpenDialog.Create(Self);
@ -778,11 +778,12 @@ begin
case AKind of
dkOpen, dkPictureOpen :
begin
FilterIndex := TOpenDialog(D).FilterIndex;
FN := TOpenDialog(D).FileName;
if (FN <> '') then
begin
if Assigned(FOnAcceptFN) then
FOnAcceptFN(Self,Fn);
if Assigned(OnAcceptFileName) then
OnAcceptFileName(Self, FN);
end;
if (FN <> '') then
begin
@ -794,6 +795,7 @@ begin
dkSave, dkPictureSave :
begin
FileName := TSaveDialog(D).FileName;
FilterIndex := TSaveDialog(D).FilterIndex;
FDialogFiles.Clear;
end;
end;