mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 15:20:49 +02:00
LCL: added TFileNameEdit.OnFolderChange event (issue #17644)
based on patch by Denis Golovan git-svn-id: trunk@28437 -
This commit is contained in:
parent
99073bb864
commit
c4d4d4f6c3
@ -166,6 +166,7 @@ type
|
||||
FHideDirectories: Boolean;
|
||||
FInitialDir: String;
|
||||
FOnAcceptFN: TAcceptFileNameEvent;
|
||||
FOnFolderChange: TNotifyEvent;
|
||||
FFileNameChangeLock: Integer;
|
||||
procedure SetFileName(const AValue: String);
|
||||
protected
|
||||
@ -176,6 +177,7 @@ type
|
||||
procedure DoButtonClick (Sender: TObject); override;
|
||||
procedure RunDialog; virtual;
|
||||
procedure TextChanged; override;
|
||||
procedure DoFolderChange(Sender:TObject); virtual;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -185,6 +187,7 @@ type
|
||||
property FileName: String read FFileName write SetFileName;
|
||||
property InitialDir: String read FInitialDir write FInitialDir;
|
||||
property OnAcceptFileName: TAcceptFileNameEvent read FOnAcceptFN write FonAcceptFN;
|
||||
property OnFolderChange: TNotifyEvent read FOnFolderChange write FOnFolderChange;
|
||||
property DialogKind: TDialogKind read FDialogKind write FDialogKind default dkOpen;
|
||||
property DialogTitle: String read FDialogTitle write FDialogTitle;
|
||||
property DialogOptions: TOpenOptions read FDialogOptions write FDialogOptions;
|
||||
@ -842,6 +845,12 @@ begin
|
||||
inherited TextChanged; //do this _after_ we have updated FFileName
|
||||
end;
|
||||
|
||||
procedure TFileNameEdit.DoFolderChange(Sender: TObject);
|
||||
begin
|
||||
if Assigned(FOnFolderChange) then
|
||||
FOnFolderChange(Self);
|
||||
end;
|
||||
|
||||
{ TDirectoryEdit }
|
||||
|
||||
procedure TDirectoryEdit.SetDirectory(const AValue: String);
|
||||
|
Loading…
Reference in New Issue
Block a user