mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 06:22:30 +02:00
replaced TopenDialog with TSelectDirectoryDialog
git-svn-id: trunk@5174 -
This commit is contained in:
parent
caff68648f
commit
e06d1ce300
@ -44,7 +44,7 @@ type
|
||||
AddTemplateButton: TButton;
|
||||
OkButton: TButton;
|
||||
CancelButton: TButton;
|
||||
OpenDialog: TOpenDialog;
|
||||
BrowseDialog: TSelectDirectoryDialog;
|
||||
procedure AddTemplateButtonClick(Sender: TObject);
|
||||
procedure BrowseButtonClick(Sender: TObject);
|
||||
procedure CancelButtonClick(Sender: TObject);
|
||||
@ -118,17 +118,17 @@ end;
|
||||
|
||||
procedure TPathEditorDialog.BrowseButtonClick(Sender: TObject);
|
||||
var y: integer;
|
||||
NewPath: string;
|
||||
begin
|
||||
if OpenDialog=nil then OpenDialog:=TOpenDialog.Create(Self);
|
||||
with OpenDialog do begin
|
||||
if BrowseDialog=nil then begin
|
||||
BrowseDialog:=TSelectDirectoryDialog.Create(Self);
|
||||
BrowseDialog.Options := BrowseDialog.Options + [ofFileMustExist];
|
||||
end;
|
||||
with BrowseDialog do begin
|
||||
Title:=lisPathEditSelectDirectory;
|
||||
if (not Execute) then exit;
|
||||
NewPath:=ExtractFilePath(Trim(Filename));
|
||||
if (not DirPathExists(NewPath)) then exit;
|
||||
y:=PathEdit.CaretY;
|
||||
if y>PathEdit.Lines.Count then y:=PathEdit.Lines.Count;
|
||||
PathEdit.Lines.Insert(y,NewPath);
|
||||
PathEdit.Lines.Insert(y,Trim(Filename));
|
||||
PathEdit.CaretY:=y+1;
|
||||
end;
|
||||
SelectCurrentPath;
|
||||
|
Loading…
Reference in New Issue
Block a user