From e06d1ce300cd6523065df540a72f54bc574cb032 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 5 Feb 2004 13:56:57 +0000 Subject: [PATCH] replaced TopenDialog with TSelectDirectoryDialog git-svn-id: trunk@5174 - --- ide/patheditordlg.pas | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ide/patheditordlg.pas b/ide/patheditordlg.pas index 2bde49602a..c4bf9b8493 100644 --- a/ide/patheditordlg.pas +++ b/ide/patheditordlg.pas @@ -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;