IDE: fpdoc editor: example browse button

git-svn-id: trunk@35012 -
This commit is contained in:
mattias 2012-01-29 10:58:55 +00:00
parent 558c1e6374
commit 891c0030b3
2 changed files with 12 additions and 2 deletions

View File

@ -47,7 +47,7 @@ uses
{$ENDIF}
// IDEIntf
IDEWindowIntf, ProjectIntf, LazIDEIntf, IDEHelpIntf, LazHelpIntf, Menus,
SrcEditorIntf,
SrcEditorIntf, IDEDialogs,
// IDE
IDEOptionDefs, EnvironmentOpts, PackageSystem, IDEProcs, LazarusIDEStrConsts,
FPDocSelectInherited, FPDocSelectLink, CodeHelp;
@ -1521,9 +1521,17 @@ end;
procedure TFPDocEditor.BrowseExampleButtonClick(Sender: TObject);
begin
if Doc=nil then exit;
if OpenDialog.Execute then
InitIDEFileDialog(OpenDialog);
OpenDialog.Title:=lisChooseAnExampleFile;
OpenDialog.Filter:=lisPascalFile+'|*.pas;*.pp;*.p|'+dlgAllFiles+'|'+FileMask;
OpenDialog.InitialDir:=ExtractFilePath(DocFile.Filename);
if OpenDialog.Execute then begin
ExampleEdit.Text := SetDirSeparators(ExtractRelativepath(
ExtractFilePath(DocFile.Filename), OpenDialog.FileName));
if ExampleEdit.Text<>FOldVisualValues[fpdiExample] then
Modified:=true;
end;
StoreIDEFileDialog(OpenDialog);
end;
procedure TFPDocEditor.CopyFromInheritedButtonClick(Sender: TObject);

View File

@ -3018,6 +3018,8 @@ resourcestring
lisFPDocFPDocSyntaxError = 'FPDoc syntax error';
lisFPDocThereIsASyntaxErrorInTheFpdocElement = 'There is a syntax error in '
+'the fpdoc element "%s":%s%s';
lisChooseAnExampleFile = 'Choose an example file';
lisPascalFile = 'Pascal file';
lisUnableToWriteToFile2 = 'Unable to write to file "%s".';
lisUnableToWriteTheProjectSessionFileError = 'Unable to write the project '
+'session file%s"%s".%sError: %s';