mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 04:29:28 +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;
|
AddTemplateButton: TButton;
|
||||||
OkButton: TButton;
|
OkButton: TButton;
|
||||||
CancelButton: TButton;
|
CancelButton: TButton;
|
||||||
OpenDialog: TOpenDialog;
|
BrowseDialog: TSelectDirectoryDialog;
|
||||||
procedure AddTemplateButtonClick(Sender: TObject);
|
procedure AddTemplateButtonClick(Sender: TObject);
|
||||||
procedure BrowseButtonClick(Sender: TObject);
|
procedure BrowseButtonClick(Sender: TObject);
|
||||||
procedure CancelButtonClick(Sender: TObject);
|
procedure CancelButtonClick(Sender: TObject);
|
||||||
@ -118,17 +118,17 @@ end;
|
|||||||
|
|
||||||
procedure TPathEditorDialog.BrowseButtonClick(Sender: TObject);
|
procedure TPathEditorDialog.BrowseButtonClick(Sender: TObject);
|
||||||
var y: integer;
|
var y: integer;
|
||||||
NewPath: string;
|
|
||||||
begin
|
begin
|
||||||
if OpenDialog=nil then OpenDialog:=TOpenDialog.Create(Self);
|
if BrowseDialog=nil then begin
|
||||||
with OpenDialog do begin
|
BrowseDialog:=TSelectDirectoryDialog.Create(Self);
|
||||||
|
BrowseDialog.Options := BrowseDialog.Options + [ofFileMustExist];
|
||||||
|
end;
|
||||||
|
with BrowseDialog do begin
|
||||||
Title:=lisPathEditSelectDirectory;
|
Title:=lisPathEditSelectDirectory;
|
||||||
if (not Execute) then exit;
|
if (not Execute) then exit;
|
||||||
NewPath:=ExtractFilePath(Trim(Filename));
|
|
||||||
if (not DirPathExists(NewPath)) then exit;
|
|
||||||
y:=PathEdit.CaretY;
|
y:=PathEdit.CaretY;
|
||||||
if y>PathEdit.Lines.Count then y:=PathEdit.Lines.Count;
|
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;
|
PathEdit.CaretY:=y+1;
|
||||||
end;
|
end;
|
||||||
SelectCurrentPath;
|
SelectCurrentPath;
|
||||||
|
Loading…
Reference in New Issue
Block a user