implemented URL directory property editor

git-svn-id: trunk@6428 -
This commit is contained in:
mattias 2004-12-27 17:52:42 +00:00
parent c5e34297ad
commit 96d90202b9
3 changed files with 48 additions and 3 deletions

View File

@ -453,7 +453,7 @@ begin
// register property editors for URL handling
RegisterPropertyEditor(TypeInfo(AnsiString),
THTMLHelpDatabase,'BaseURL',TURLPropertyEditor);
THTMLHelpDatabase,'BaseURL',TURLDirectoryPropertyEditor);
end;
destructor THelpManager.Destroy;

View File

@ -738,6 +738,17 @@ type
function GetDialogTitle: string; virtual;
function GetInitialDirectory: string; virtual;
procedure SetFilename(const Filename: string); virtual;
function CreateFileDialog: TOpenDialog; virtual;
end;
{ TDirectoryPropertyEditor
PropertyEditor editor for directory properties.
Show an TSelectDirectoryDialog on Edit. }
TDirectoryPropertyEditor = class(TFileNamePropertyEditor)
public
function CreateFileDialog: TOpenDialog; override;
end;
@ -751,6 +762,16 @@ type
end;
{ TURLDirectoryPropertyEditor
PropertyEditor editor for URL properties.
Show an TOpenDialog on Edit. }
TURLDirectoryPropertyEditor = class(TURLPropertyEditor)
public
function CreateFileDialog: TOpenDialog; override;
end;
{ TSessionPropertiesPropertyEditor
PropertyEditor editor for TControl.SessionProperties properties.
Show a dialog on Edit. }
@ -4805,7 +4826,7 @@ end;
procedure TFileNamePropertyEditor.Edit;
begin
With TOpenDialog.Create(nil) do
With CreateFileDialog do
Try
Filter:=GetFilter;
Options:=GetDialogOptions;
@ -4844,6 +4865,19 @@ begin
SetStrValue(Filename);
end;
function TFileNamePropertyEditor.CreateFileDialog: TOpenDialog;
begin
Result:=TOpenDialog.Create(nil);
end;
{ TDirectoryPropertyEditor }
function TDirectoryPropertyEditor.CreateFileDialog: TOpenDialog;
begin
Result:=TSelectDirectoryDialog.Create(nil);
Result.Options:=Result.Options+[ofFileMustExist];
end;
{ TURLPropertyEditor }
procedure TURLPropertyEditor.SetFilename(const Filename: string);
@ -4865,6 +4899,14 @@ begin
inherited SetFilename(FilenameToURL(Filename));
end;
{ TURLDirectoryPropertyEditor }
function TURLDirectoryPropertyEditor.CreateFileDialog: TOpenDialog;
begin
Result:=TSelectDirectoryDialog.Create(nil);
Result.Options:=Result.Options+[ofFileMustExist];
end;
{ TSessionPropertiesPropertyEditor }
function TSessionPropertiesPropertyEditor.GetAttributes: TPropertyAttributes;

View File

@ -258,7 +258,7 @@ constructor TSelectDirectoryDialog.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
fCompStyle:=csSelectDirectoryDialog;
FTitle:= rsfdSelectDirectory;
FTitle:=rsfdSelectDirectory;
end;
function TSelectDirectoryDialog.CheckFile(var AFilename: string): boolean;
@ -278,6 +278,9 @@ end;
{ =============================================================================
$Log$
Revision 1.21 2004/12/27 17:52:42 mattias
implemented URL directory property editor
Revision 1.20 2004/04/10 17:58:57 mattias
implemented mainunit hints for include files