mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 21:55:56 +02:00
IDE: source editor popup menu: open fpdoc file of unit
git-svn-id: trunk@34841 -
This commit is contained in:
parent
9c60f59d00
commit
9238bba3a6
@ -214,6 +214,8 @@ type
|
||||
const Filename: string): TPascalHelpContextList; override;
|
||||
function ConvertCodePosToPascalHelpContext(
|
||||
ACodePos: PCodeXYPosition): TPascalHelpContextList;
|
||||
function GetFPDocFilenameForSource(SrcFilename: string;
|
||||
ResolveIncludeFiles: Boolean; out AnOwner: TObject): string; override;
|
||||
public
|
||||
property FCLHelpDB: THelpDatabase read FFCLHelpDB;
|
||||
property FCLHelpDBPath: THelpBaseURLObject read FFCLHelpDBPath;
|
||||
@ -1504,6 +1506,15 @@ begin
|
||||
AddContextsBackwards(TCodeTool(Tool),Node);
|
||||
end;
|
||||
|
||||
function TIDEHelpManager.GetFPDocFilenameForSource(SrcFilename: string;
|
||||
ResolveIncludeFiles: Boolean; out AnOwner: TObject): string;
|
||||
var
|
||||
CacheWasUsed: boolean;
|
||||
begin
|
||||
Result:=CodeHelpBoss.GetFPDocFilenameForSource(SrcFilename,ResolveIncludeFiles,
|
||||
CacheWasUsed,AnOwner);
|
||||
end;
|
||||
|
||||
procedure TIDEHelpManager.ShowHelpForMessage(Line: integer);
|
||||
|
||||
function ParseMessage(MsgItem: TIDEMessageLine): TStringList;
|
||||
|
@ -5344,6 +5344,8 @@ var
|
||||
CurWordAtCursor: String;
|
||||
AtIdentifier: Boolean;
|
||||
MainCodeBuf: TCodeBuffer;
|
||||
AnOwner: TObject;
|
||||
FPDocSrc: String;
|
||||
begin
|
||||
SourceEditorMenuRoot.MenuItem:=SrcPopupMenu.Items;
|
||||
SourceEditorMenuRoot.BeginUpdate;
|
||||
@ -5450,11 +5452,11 @@ begin
|
||||
if (MainCodeBuf<>nil) and (MainCodeBuf<>ASrcEdit.CodeBuffer)
|
||||
and (not MainCodeBuf.IsVirtual) then begin
|
||||
// this is an include file => add link to open unit
|
||||
AddContextPopupMenuItem(
|
||||
Format(lisOpenLfm,[CreateRelativePath(MainCodeBuf.Filename,ASrcEdit.Filename)]),
|
||||
true,@OnPopupMenuOpenFile);
|
||||
CurFilename:=MainCodeBuf.Filename;
|
||||
ShortFileName:=ExtractFileName(CurFilename);
|
||||
AddContextPopupMenuItem(
|
||||
Format(lisOpenLfm,[CreateRelativePath(CurFilename,ASrcEdit.Filename)]),
|
||||
true,@OnPopupMenuOpenFile);
|
||||
end;
|
||||
if FilenameIsPascalUnit(ShortFileName) then begin
|
||||
MaybeAddPopup('.lfm');
|
||||
@ -5471,6 +5473,10 @@ begin
|
||||
if (CompareFileExt(ShortFileName,'.lpi',true)=0)
|
||||
or (CompareFileExt(ShortFileName,'.lpk',true)=0) then
|
||||
AddContextPopupMenuItem(Format(lisOpenLfm,[ShortFileName]),true,@OnPopupMenuOpenFile);
|
||||
FPDocSrc:=LazarusHelp.GetFPDocFilenameForSource(CurFilename,false,AnOwner);
|
||||
if FPDocSrc<>'' then
|
||||
AddContextPopupMenuItem(Format(lisOpenLfm,[CreateRelativePath(FPDocSrc,CurFilename)]),
|
||||
true,@OnPopupMenuOpenFile);
|
||||
end;
|
||||
|
||||
{$IFnDEF SingleSrcWindow}
|
||||
|
@ -78,6 +78,12 @@ type
|
||||
|
||||
function ConvertSourcePosToPascalHelpContext(const CaretPos: TPoint;
|
||||
const Filename: string): TPascalHelpContextList; virtual; abstract;
|
||||
|
||||
// fpdoc
|
||||
function GetFPDocFilenameForSource(SrcFilename: string;
|
||||
ResolveIncludeFiles: Boolean;
|
||||
out AnOwner: TObject// a package or a project or LazarusHelp or nil for user defined
|
||||
): string; virtual; abstract;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user